in reply to a 'with' statement for perl
It seems to me that the first part, using with to topicalize is exactly what for does:
#!/usr/bin/perl -w use strict; my $foo = "a string"; print "before with: $foo\n"; for($foo) { s/a /not a /; } print "after with: $foo\n";
I believe that's indeed one of the reasons for the use of for as a keyword, instead or just foreach.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: a 'with' statement for perl
by broquaint (Abbot) on Apr 25, 2003 at 12:05 UTC |