in reply to Changing the numerical value from 0 to 1
You could match w/word boundaries:
for (@output5b) { s/\b0\b/1/ };
Or you could match from start to end:
for (@output5b) { s/^0$/1/ }
Or w/o a regex:
for (@output5b) { $_ = 1 if $_ == 0 }
Edit: I believe that ww and kcott provided sufficient reasons below to keep only option #2.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Changing the numerical value from 0 to 1
by hellohello1 (Sexton) on Jan 21, 2014 at 02:21 UTC | |
by Kenosis (Priest) on Jan 21, 2014 at 02:57 UTC |