venkat@perl has asked for the wisdom of the Perl Monks concerning the following question:
I am new to perl facing this problem.Please give me the solution.THANKS
when I run this for first file it's working fine but for second file I an not able to get the second filemy @files_list = glob "$inpath/filename*.txt"; foreach my $var (files_list){ my @array[i]=$var; i=i+1; } my @sorted_list = reverse sort @myarray; #@myarray contains the files foreach my $file (@sorted_list){ my $single_file = glob "$path/$file*.txt"; some stuff on files...................... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: glob is working only first time in foreach loop
by Corion (Patriarch) on Jan 27, 2016 at 15:16 UTC | |
|
Re: glob is working only first time in foreach loop
by toolic (Bishop) on Jan 27, 2016 at 15:10 UTC | |
|
Re: glob is working only first time in foreach loop
by LanX (Saint) on Jan 27, 2016 at 19:44 UTC |