Well if you look at the proposed...
$_ = "monkey ";
$foo = "coward";
with ($foo){
print;
print "$_";
}
Would print "coward monkey", which will give you unexpected results if you
are used to having the same output for both, "coward coward".
But I guess the above would not replace $_ which would be very inconvenient
if you had to output it with a whole bunch of other stuff. Like "I am not a
coward" which can be easily done with print "I am not a $_"; will now have
to be written in two separate lines, and possibly more if there is more to
follow.
Ilya
-----Original Message-----
From: Garrett Goebel
To: 'Stuart Rocks'; [EMAIL PROTECTED]
Sent: 07/19/2001 12:34 PM
Subject: what's with 'with'? (was: [aliasing - was:[nice2haveit]])
From: Stuart Rocks [mailto:[EMAIL PROTECTED]]
>
> Both the following would work:
>
> with($foo){
> print "I am not a $foo\n";
> # or:
> print "I am not a ";
> print;
> }
Okay... I've been mostly ignoring this thread. But can someone reiterate
the
difference between the above and
for($foo){
print "I am not a $foo\n";
# or:
print "I am not a ";
print;
}
???