im trying to make a script on reading all of the files inside a directory but it seems i cant.... the only thing i can is to list the names of the file inside the directory.So is there a way for me to list it ? (Kinda new to perl and linux :U)
#!/usr/bin/perl
use strict;
use warnings;
#locate directories
my $DIR = "/home/aimanhalim/LOG";
opendir(DIR, $DIR) or die $!;
#open Directory and read all the file.
while (my $DIR = readdir(DIR)) {print "$DIR
";}
exit;
See Question&Answers more detail:os