Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: perl command line option - ( -x )

by siva kumar (Pilgrim)
on Jan 30, 2007 at 08:15 UTC ( [id://597313]=note: print w/replies, xml ) Need Help??


in reply to perl command line option - ( -x )

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://597313]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found