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
> 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";

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!

Re: aliasing - was:[nice2haveit]

2001-07-19 Thread Stuart Rocks
> >Then how would you write "I am not a coward" > > with ($foo) > { > print "I am not a"; ##What do I use here or do I have to issue a >##separate print like... > print; > } > > Ilya Well in Perl5, for the print to use default value it's just 'print;'. The same applie

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread Stuart Rocks
> > So, in this case, a "with" synonym for "for" would work. > > > Particularly if '$_' was implied... So with Perl 6's '.' replacing '->', > and 'with' aliasing 'for': > >with ( $XL.{Application}.{ActiveSheet} ) { > .cells(1,1) = "Title"; > .language() = "English"; >} This is m

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread Stuart Rocks
> > So, in this case, a "with" synonym for "for" would work. > > > Particularly if '$_' was implied... So with Perl 6's '.' replacing '->', > and 'with' aliasing 'for': > >with ( $XL.{Application}.{ActiveSheet} ) { > .cells(1,1) = "Title"; > .language() = "English"; >} This is m