DCPM: Re: return values

Neil Williams linux at codehelp.co.uk
Thu Jan 8 17:25:32 CST 2004


On Thursday 08 Jan 2004 11:16 pm, Neil Williams wrote about return values:
> Is it as easy as it would appear to report a return value from a perl
> script run from the command line?

Ok, I should have tried this before posting:

#!/bin/bash
perl -e 'exit(1);'
if [ $? -eq 1 ]; then
        perl -e 'print "script can start again\n";'
fi

So if I call exit I can restart the script. ? There's no chance of the module 
not being re-initialised? Should I use a 1 second sleep in-between?

-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20040108/00a3b09e/attachment.bin


More information about the Devoncornwall-pm mailing list