glob()
function.
#!/usr/bin/perl
@files = glob("@ARGV");
foreach (@files) {
print "File: $_\n";
}
Please notice that the @ARGV
is surrounded by double quotes. Without double quotes, it will return the count of arguments.
D:\>process_files.pl test*.pl myperl.pl exec_cmd.pl
File: TestBack.pl
File: TestCSV.pl
File: TestDate.pl
File: myperl.pl
File: exec_cmd.pl
No comments:
Post a Comment