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;
In reply to Re: Regex match on implicit default variable ($_) in a script, not a one liner
by james28909
in thread Regex match on implicit default variable ($_) in a script, not a one liner
by Todd Chester
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |