Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 979925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:17:48+00:00 2026-05-16T04:17:48+00:00

in my little perl script (test.pl) I do the following in order to exit

  • 0

in my little perl script (test.pl) I do the following in order to exit from program if
EXIT_STATUS equal to 1

   if ( $EXIT_STATUS  == 1  )
       {
            system (exit);
      }

but I need also to get from the test.pl return code 1

for example

./test.pl

echo $?

how to enable return code 1 if EXIT_STATUS = 1 ?

lidia

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:17:49+00:00Added an answer on May 16, 2026 at 4:17 am

    That’s not how you should exit in perl. It’s:

    if ($EXIT_STATUS == 1) {
        exit 1;
    }
    

    and if you want to exit normally otherwise:

    if ($EXIT_STATUS == 1) {
        exit 1;
    }
    else {
        exit 0;
    }
    

    or (depending on your intention) more simply:

    exit $EXIT_STATUS;
    

    see: http://perldoc.perl.org/functions/exit.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a little datamining project where a perl script grabs info from a
A little background: I have a perl script which is performing a number of
I am new to Perl, but I know a little bit of C though.
My little Perl script on Windows tried to call a dependency library C:/strawberry/perl/vendor/lib/Term/ReadPassword/Win32.pm which
I'm working on a little script in Perl and I have problems with parameters
I need to stream-process using perl a 1Gb text file encoded in UTF-16 little-endian
I have a little Perl script (On Windows) that checks some files for me
I need to have a Python CGI script do some stuff (a little bit
I am moving a Perl (of which I have very little knowledge) script to
I wrote a little daemon in Perl that calls up FFMpeg to encode a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.