The stupid question is the question not asked | |
PerlMonks |
Re: simple regex questionby pipeops (Novice) |
on Nov 30, 2010 at 15:39 UTC ( [id://874520]=note: print w/replies, xml ) | Need Help?? |
All,
I ended up using the following method with push. Here it creates 4 arrays from 1 based on its initial character on each line(they are all the same)
Thanks everyone for the help
foreach $line(@exceptions)
{
if ($line =~ m/^n/)
{
$line =~ s/^n//s;
push (@before, $line);
}
if ($line =~ m/^i/)
{
$line =~ s/^i//s;
push (@implementation, $line);
}
if ($line =~ m/^b/)
{
$line =~ s/^b//s;
push (@backup, $line);
}
if ($line =~ m/^o/)
{
$line =~ s/^o//s;
push (@offline, $line);
}
}
In Section
Seekers of Perl Wisdom
|
|