file load
Russ Schnapp
rschnapp at ACM.org
Fri Apr 28 17:19:20 CDT 2000
~sdpm~
>> or, for fewer variable names:
>>
>> {
>> local $/ = undef;
>> $string = <FILE>;
>> }
>it can't be "my $/ = undef;" ??
Nope. That's the subtle difference between "my" and "local". The
former is more like a conventional local variable.
A "my" identifier masks globals that are referred to WITHIN the
block in which they are declared.
A "local" identifier in PERL actually is new instance of the variable
that masks ALL references to global, WHEREVER THEY MAY
OCCUR, so long as the block in which they are declared is active.
It's cute. It's handy. It's a nightmare, from a language design point
of view. It means that when you look at a variable reference, you
can't definitively say where the variable is defined.
Larry Wall provided us with a very functional, very powerful
language. If only he had had a language design background,
though. I'll fight my urge to whine about many other unnecessary
"features" of the language. (Can you tell that I'm not a big fan of
being able to do the same simple thing 5 different ways in a single
language?)
...Russ Schnapp
Schnapp Software Consulting
http://www.schnapp.org/
~sdpm~
The posting address is: san-diego-pm-list at hfb.pm.org
List requests should be sent to: majordomo at hfb.pm.org
If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:
unsubscribe san-diego-pm-list
If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.
More information about the San-Diego-pm
mailing list