
z00m-z00m
New User
May 29, 2008, 6:00 AM
Post #1 of 2
(206 views)
|
|
looping filehandles problem
|
Can't Post
|
|
I'm trying to make my program copy these txt files all into one,
while( <$my_filehandle> ) { print $my_filehandle $_; } this code works fine, except im trying to print output from than one file. So when i change my code to the following,
my $counter = 0; while( $counter < 3 ) # if i have 3 files.. { while (<"@filehandles[$counter]">) { print <....> $_; } $counter++; } For some reason when i try to loop it it wont work, but when i copy and paste my 1st while statement with differend filehandles it works. I've tried using the foreach method of copying data, same thing it copies if hardcode my file handles but when i try to make them change using an array, or using $my_file handle = @filehandles[$counter]; but that doesn't work.. Anyone have any idea? Thx ahead of time
|