Gosh has asked for the wisdom of the Perl Monks concerning the following question:
The program outputs "&& &" but I expect "&&&"my $line = "& & &"; $line =~ s/(\W)\s+(\W)/$1$2/g; print $line;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string substitution
by Corion (Patriarch) on Dec 04, 2010 at 10:35 UTC | |
by Gosh (Initiate) on Dec 04, 2010 at 11:23 UTC | |
by GrandFather (Saint) on Dec 06, 2010 at 20:14 UTC | |
|
Re: string substitution
by AnomalousMonk (Archbishop) on Dec 04, 2010 at 12:17 UTC | |
|
Re: string substitution
by BrowserUk (Patriarch) on Dec 04, 2010 at 10:46 UTC |