[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sticky global



At 20.20 1/3/98, Xah Lee wrote:
>At 2:31 PM -0800 1998.01.03, Chris Nandor wrote:
>>$^E also wrongly sticks from script to script.
>
>Is there a way to check this? I tried
>
>$^E = 'f';
>print $^E;
>
>but apparantly there's no effect. (no action)

$^E can be assigned error numbers, not strings (if you had used the -w
flag, MacPerl would have told you that :-).  You can actually get a list of
all these numbers and their values from the file "Result Codes" in the
"Inside Macintosh X-Ref" volume, available from:

        http://gemma.apple.com/dev/techsupport/insidemac/xref/Contents.html

This volume is also good for tracking down what toolbox functions and
constants are documented where.

>I also tried
>
>open(F,"harddisk:badfilename") or die ("error: $^E")
>
>but couldn't demo the stickness.

$^E has nothing to do with open().  $^E is only given platform-specific
errors, and in the case of MacPerl, is only set with the Toolbox modules.
Try this:

#!perl -w
use Mac::MoreFiles;
my $path = $Application{dl345345345js} || die $^E;

or, to get the same error more quickly :-) :

#!perl -wl
$^E = -5012;
print $^E;

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#