May 29, 2008, 6:00 AM
Post #1 of 2
I'm trying to make my program copy these txt files all into one,
looping filehandles problem
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..
print <....> $_;
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