I have to open all the files in a directory, the name of which will be given in the command line arguement .My code is
; #!usr/bin/perl -w use strict; use warnings; my $handle=$ARGV[0]; opendir(D,$handle) or die "cannot open"; my @files=readdir(D); foreach my $file(@files) {open (MYFILE,"$file") or die"oops"; } closedir(D)
The directory in command line has 5 files. It gives output as oops .I am a noob to perl so it will be helpful if you provide a basic explanation and the code i need to use . thanks
In reply to cant open files from a directory by garny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |