in reply to Newbie Question -- Changing File Path?

TIMTOWTDI!

Use Getopt::Long to get the user to enter command line options, i.e. the path.
use Getopt::Long; my %opt = (); GetOptions( \%opt, #general file path "path=s", #file name "file=s", ); my $path = $opt{path}; my $file = $opt{file};
Then, use concatenation to join the $path with the file name!
my $fullFile = $path . $file; unlink($fullFile) or die "$!\n";


Or if we're dealing with an array of files in the same dir :

foreach my $arrayFile(@array) { my $fullFile = $path . $arrayFile; unlink($fullFile) or die "$!\n"; }


HTH

Azatoth a.k.a Captain Whiplash

Make Your Die Messages Full of Wisdom!
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?