printsmy $foo = "foo"; print map {s/foo/bar/g; $_} do{$foo}; print "\n$foo\n";
This, however, does:bar bar
my $foo = "foo"; print map {s/foo/bar/g; $_} @{[$foo]}; print "\n$foo\n";
-Mark
In reply to Re: Re: Non-destructive string substitution
by kvale
in thread Non-destructive string substitution
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |