did i wrong in writing syntax of the path at line opendir(DIR," ")?open RESULT, ">k2oris.dat"; #baca smua file yg ada d direktori opendir (DIR, "C:\Users\ask\TES") or die "$!"; my @files = grep {/.*?\.txt/} readdir DIR; close DIR; foreach my $file (@files) { open(FILE,"path/to/$files") or die "$!"; #read each file while (<FILE>){ . . } close RESULT;
In reply to read whole file in a directory by ask91
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |