Perl Newbie - help


Read With Formatting | Free Open Source Tutorials Account

Perl Programming
Thread: Perl Newbie - help


Anomander
Hi All,
newbie-ish question here. I have this script:

foreach $test (@num)
{
foreach $record (@neet)
{
if ($record =~ /$test/){
print "$record \n";
print $test;
}
}
}

For some reason, the $test variable doesn't seem to be carrying into the second "foreach" loop. Does anyone know why this is so? I suspect it might be an issue with the "$" character having a special meaning within REs. Please assist.