Sprad has asked for the wisdom of the Perl Monks concerning the following question:
Is there a cleaner way to do that, preferably without having to use a temporary variable each time?$string = "blah foo blah"; . . . $tmp = $string; $tmp =~ s/foo/blah/; use($tmp);
---
A fair fight is a sign of poor planning.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non-destructive substitution?
by Abigail (Deacon) on Jul 03, 2001 at 01:16 UTC | |
by MeowChow (Vicar) on Jul 03, 2001 at 01:27 UTC | |
|
Re: Non-destructive substitution?
by epoptai (Curate) on Jul 03, 2001 at 01:17 UTC | |
|
Re: Non-destructive substitution?
by CharlesClarkson (Curate) on Jul 03, 2001 at 08:02 UTC | |
by bobione (Pilgrim) on Jul 03, 2001 at 15:32 UTC | |
by CharlesClarkson (Curate) on Jul 04, 2001 at 14:41 UTC |