A Sample program for using -x option with directory name.
Unwanted Lines Here
...............
----------------
etc.,
#!/usr/bin/perl -w
use strict;
print "Hai Ashok ...\n";
system('ls');
__END__
If I run the above program as #perl test.pl I will be getting syntax error.
syntax error at test.pl line 3, near "......"
"use" not allowed in expression at test.pl line 9, at end of line
Execution of test.pl aborted due to compilation errors.
If I run the program as #perl -x test.pl
Output is
Hai Ashok ..
x.pl y.pl z.pl dirName1 dirName2
Here dirName1 and dirName2 are directories.
If I run the same progrma by #perl -xdirName1 test.pl
Output is
Hai Ashok ..
abc.pl xyz.pl
abc.pl and xyz.pl are the files under dirName1.