Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Nested While loop not working

by vinoth.ree (Parson)
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


Comment on Re^3: Nested While loop not working
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2014-09-17 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (55 votes), past polls