Open Source Development Tutorials | Newsletter Signup | About Us
Search  

Go Back   Open Source Tutorials Forum > Programming Languages > Perl Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-24-2008, 10:18 AM
Anomander Anomander is offline
Junior Member
 
Join Date: Apr 2008
Posts: 1 Anomander is on a distinguished road
Default Perl Newbie - help

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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 11:09 PM.


Powered by: vBulletin Version 3.0.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright 2004 - 2006 GrindingGears.com. All Rights Reserved.