bees.world has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to know, Is there a way to open many files one by one using loop? for eg. I have txt files name T1,T2,T3,T4 etc till T25, and I want output file O1, O2, O3.. etc after some workdone on it. Can I use it inside for loop to open every file, so that I dont have to enter it one by one in command prompt?? Help plz..

Replies are listed 'Best First'.
Re: open multiple file using loops
by Cristoforo (Curate) on Jul 01, 2011 at 10:18 UTC
Re: open multiple file using loops
by Anonymous Monk on Jul 01, 2011 at 10:44 UTC
    You probably do not want or need to open multiple filehandle, so my answer is , use Iterator::Diamond
      perl foo.pl arg1file arg2file arg3file
      arg1file... are in the global variable @ARGV, which Iterator::Diamond reads one by one by one without magic
Re: open multiple file using loops
by bees.world (Initiate) on Jul 01, 2011 at 12:50 UTC
    ohh thanks for the kind help monks..