I'm a perl newbie, so i have a question.
given the following code, how can I get the value of the second regex?
It's possible that one, both, or none of the matches can occur on a single line.
Any suggestions on how to handle this would be great.
Thanks-
given the following code, how can I get the value of the second regex?
Code:
foreach my $line(@file) {
chomp($line);
$line =~ /\$#(\@)(\w+)#\$/g;
print "$2\n";
$line =~ /\$#(\?)(\w+)#$/g;
print "$2\n";
}
It's possible that one, both, or none of the matches can occur on a single line.
Any suggestions on how to handle this would be great.
Thanks-