Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Accessing variables

by pavanmach (Novice)
on Feb 02, 2010 at 08:15 UTC ( #820908=note: print w/ replies, xml ) Need Help??


in reply to Re: Accessing variables
in thread Accessing variables

hi, There is no open close error in the program as i have used autodie module as u have suggested and i am not into $@ at all. My problem is the value which i am assigned to a variable in first while loop is not accessible in second while loop, y so ? Your response will be highly appreciated.


Comment on Re^2: Accessing variables
Re^3: Accessing variables
by Krambambuli (Deacon) on Feb 02, 2010 at 08:52 UTC
    Maybe your code should look somewhat like
    #!/usr/bin/perl my ($file1,$file2); open(FILE1,"<$ARGV[0]"); while(<FILE1>) { chomp($_); $file1 = $_; $file1=~s/\s+//; open(FILE2,"<$ARGV[1]"); while(<FILE2>) { print "<$file1> \n"; } close FILE2; }
    ?

    What output do you wish or expect?


    Krambambuli
    ---
      haai, Actually i need to check whether each line of file1 matches with any line in file2. Thanks & Regards, Pavan

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://820908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2014-12-29 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls