In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Dean Theophilou) wrote:
> Hello:
>
> I would like to exit a perl program such that upon exiting, it will return a
> text string to the calling program. How would I go about doing this?
>
> exit $SomeTextString;
>
> doesn't work, since "exit" evaluates the above scalar as an integer. Thank
> you
> in advance.
>
> Dean Theophilou
> Genisar
>
why not wrap it in an END block?
END {
print "$yourstringhere\n";
}
I've done that on some occasions, like a file list downloader I hacked
together that would report how many *.zip files I had in the local
download archive no matter whether I exit the program because I've
downloaded and removed all the files in the remote directory, or because
I manually told it to exit early without downloading the rest.
END {
my @files = glob "*.zip";
print "\n**You currently have ", scalar @files, " *.zip files in your
new_files directory.**\n\n";
}
print pack "H*", "4a75737420416e6f74686572204d61635065726c204861636b65722c0d";
--
Scott R. Godin | e-mail : [EMAIL PROTECTED]
Laughing Dragon Services | web : http://www.webdragon.net/
It is not necessary to cc: me via e-mail unless you mean to speak off-group.
I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]