in reply to style q: duplication? of variables
Of course, there is no "One True Way," but this is clean and works.sub frobnicate { $_[0] =~ s/foo/bar/; $_[0] =~ s/\d/\&/g; } my $var = "foo 12345"; frobnicate($var); # $var is now "bar &&&&&"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: style q: duplication? of variables
by thpfft (Chaplain) on Aug 14, 2001 at 19:14 UTC |