Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Nested While loop not working

by vinoth.ree (Monsignor)
on Mar 11, 2014 at 09:43 UTC ( #1077823=note: print w/replies, xml ) Need Help??


in reply to Re^2: Nested While loop not working
in thread Nested While loop not working

No, Your code is working for me without removing the second loop.

use strict; use warnings; open(file_one,"<","ABC")or die $!; while(my $line = <file_one>) { open(file_two,"<","CDE") or die $!; while(my $line2=<file_two>) { print "line : $line line2 : $line2 \n"; } close(file_two); }

line : test
line2 : CDE

line : test
line2 : CDEEE

line : test
line2 : CDEEEE

line : test121212121
line2 : CDE

line : test121212121
line2 : CDEEE

line : test121212121
line2 : CDEEEE

line : adskjdsadjdka
line2 : CDE

line : adskjdsadjdka
line2 : CDEEE

line : adskjdsadjdka
line2 : CDEEEE

Update:

Added file content.

ABC:

test
test121212121
adskjdsadjdka

CDE:

CDE
CDEEE
CDEEEE


All is well

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1077823]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-12-08 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (136 votes). Check out past polls.