$h4X4_|=73}{ has asked for the wisdom of the Perl Monks concerning the following question:
I can not figure out why its output changes.
my $nothing = ''; my $list = <<LIST; thing 1 thing 2 $nothing thing 3 thing 4 LIST $list =~ s/\s{2}/2/g; print $list; # output: #thing 1 #thing 22thing23 #thing24
I would like the output.
thing 1 thing 2 thing23 thing24
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl regex. Why does this happen?
by hippo (Archbishop) on Jun 03, 2016 at 09:29 UTC | |
|
Re: Perl regex. Why does this happen?
by BrowserUk (Patriarch) on Jun 03, 2016 at 09:32 UTC | |
by OneTrueDabe (Acolyte) on Jun 07, 2016 at 01:29 UTC | |
by AnomalousMonk (Archbishop) on Jun 07, 2016 at 04:02 UTC | |
by tye (Sage) on Jun 07, 2016 at 15:53 UTC | |
|
Re: Perl regex. Why does this happen?
by Anonymous Monk on Jun 03, 2016 at 10:34 UTC |