in reply to Newbie Question -- Changing File Path?
Then, use concatenation to join the $path with the file name!use Getopt::Long; my %opt = (); GetOptions( \%opt, #general file path "path=s", #file name "file=s", ); my $path = $opt{path}; my $file = $opt{file};
my $fullFile = $path . $file; unlink($fullFile) or die "$!\n";
foreach my $arrayFile(@array) { my $fullFile = $path . $arrayFile; unlink($fullFile) or die "$!\n"; }
|
|---|