Yes.. i´ve already use that..!! Is this the best way or the most efficent way? Or is preferably to use modules instead of perl built in commands?
I´ve made this code:
use strict; use warnings; my $path="c:\\teste"; sub procura_ficheiros{ ($path)=@_; opendir(DIR, $path) ||die "$!"; my @files=grep{/\.c$/} readdir(DIR); close (DIR); return @files; } my @res=procura_ficheiros($path); foreach my $fich (@res){ my $final=$path."\\".$fich; print "Ficheiro: $path\\$fich\n"; print "Final: $final\n"; }
It works.. but is it the most efficcient??
Thank you once againNuno
In reply to Re: Re: Get file names
by nofernandes
in thread Get file names
by nofernandes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |