Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does $$ and $?>> do??? 2

Status
Not open for further replies.

DCCoolBreeze

Programmer
Jul 25, 2001
208
0
0
US
What do the following statements do?:

$file. = $filename.$$

and

if ($?>>8)

I can not seem to locate anything in the documentation I have

Thanks in advance
 
$$ = process id of this script
$? = status of last returned pipe

I am not sure what the if($?>>8) means. Hope this helps.
 
Try man perlvar:

$$ The process number of the Perl running this script.
(Mnemonic: same as shells.)



$? The status returned by the last pipe close, backtick
(``) command, or system() operator. Note that this
is the status word returned by the wait() system
call (or else is made up to look like it). Thus,
the exit value of the subprocess is actually ($? >>
8)
, and $? & 255 gives which signal, if any, the
process died from, and whether there was a core
dump. (Mnemonic: similar to sh and ksh.)

Note that if you have installed a signal handler for
SIGCHLD, the value of $? will usually be wrong
outside that handler.

Inside an END subroutine $? contains the value that
is going to be given to exit(). You can modify $?
in an END subroutine to change the exit status of
the script.

Under VMS, the pragma use vmsish 'status' makes $?
reflect the actual VMS exit status, instead of the
default emulation of POSIX status.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top