Manisha has asked for the wisdom of the Perl Monks concerning the following question:
Hi PerlMonks I am a newbie in perl .. I am using nested while loops to open two files for searching data as below
open(file_one,"ABC"); while(my $line = <file_one>) { open(file_two,"CDE"); while(my $line2=<file_two>) { print "line : $line line2 : $line2 \n"; } close(file_two); }
The problem is nothing is printed against line : <blank> line2: <somevalue>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nested While loop not working
by choroba (Cardinal) on Mar 11, 2014 at 08:58 UTC | |
by Manisha (Initiate) on Mar 11, 2014 at 09:10 UTC | |
by vinoth.ree (Monsignor) on Mar 11, 2014 at 09:43 UTC | |
|
Re: Nested While loop not working
by kcott (Archbishop) on Mar 11, 2014 at 10:10 UTC | |
by Manisha (Initiate) on Mar 11, 2014 at 10:33 UTC | |
by kcott (Archbishop) on Mar 12, 2014 at 06:49 UTC | |
by Anonymous Monk on Mar 12, 2014 at 09:34 UTC | |
by Manisha (Initiate) on Mar 12, 2014 at 09:37 UTC | |
|
Re: Nested While loop not working
by vinoth.ree (Monsignor) on Mar 11, 2014 at 09:19 UTC | |
by Manisha (Initiate) on Mar 11, 2014 at 09:40 UTC | |
by Anonymous Monk on Mar 11, 2014 at 09:43 UTC | |
|
Re: Nested While loop not working
by sivaramraj (Initiate) on Mar 11, 2014 at 12:40 UTC |