Hi, I am trying to match multiple strings per line from a file and extract them into an array. Apparently the first match is assigned $1, how do I know what the last match is ie $last?? I would like to set up a for loop to enter these values into an array: psuedo code below to extract all html tag per line in the file master, array is mastertags:
while (<$master>)
{
$_=~/(<.*?>)/g;
for (my $i=1; $i <= last value; $i++)
{
$mastertags [$x]=$i;
$x++;
}
}
while (<$master>)
{
$_=~/(<.*?>)/g;
for (my $i=1; $i <= last value; $i++)
{
$mastertags [$x]=$i;
$x++;
}
}
Comment