Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])

2001-07-19 Thread Stuart Rocks
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; } Try this under the current for system, cause it's unclear what will happen for those new to Perl: $foo=monkey; $_= coward; for($foo){

Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])

2001-07-19 Thread Stuart Rocks
Why would you want it to print Monkey Hero, I would expect $_ to be localized, rather than global, which could prove more convenient. No, it's still localized. But the With would mean that $_ in a way becomes a normal variable like $foo was, and the $foo is now the 'default variable'.

Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])

2001-07-19 Thread Stuart Rocks
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 Um, of course the original way is still possible!