
Vlhadv
Novice
Dec 27, 2007, 6:39 PM
Post #1 of 2
(805 views)
|
Will this work?
|
Can't Post
|
|
Hi everyone!!! I have never tried this code yet but i just want to ask if this would work? Code: my $dirname = "/my/directory/temp/".$foldername; #folder name is extracted from database my $filename = <filename>; #filename is also extracted from database opendir(HANDLER, $dirname) or die "Directory cannot be open!"; my $tmpFile = grep{/$filename/} readdir HANDLER; close HANDLER; move($dirname.$filename, "/my/directory/archive/".$foldername); Question: $filename may contain a file with or without an extension. Will this work on both ways? Will it also work if there are spaces within the filename?
|