I question this too, since as you mentioned with, in my experience works
nicely to reference and object like
with(object)
{
.foo();
.bar();
....
}
Ilya
-----Original Message-----
From: Mark Koopman
To: [EMAIL PROTECTED]
Sent: 07/19/2001 12:42 PM
Subject: Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])
Garrett Goebel wrote:
> 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;
> }
>
> ???
>
>
pure syntax. does anyone else question making aliases like 'with' from
'for'?
a 'with' alias could open the door on purely confusing code like this:
with( my $i; $i < 10; $i++ ){ ... }
instead of having an standard 'with' that only works on objects like
this:
with( MyObject->new() ) {
.setIt("blah");
...
}
--
-mark koopman
WebSideStory 10182 Telesis Court
San Diego CA 92121 858-546-1182 ext 318