in reply to Regex match on implicit default variable ($_) in a script, not a one liner
Heres another way, which you can also iterate through the array easily (once you have built one ofcourse) :)
use strict; use warnings; my @array = "abc\ndef\nghi\n"; print $1 . $3 if $array[0] =~ /(.*)(\ndef)(.*)/s;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex match on implicit default variable ($_) in a script, not a one liner
by Laurent_R (Canon) on Oct 24, 2015 at 18:43 UTC | |
by Todd Chester (Scribe) on Oct 24, 2015 at 20:02 UTC |