Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Command line argument Error..

by roboticus (Chancellor)
on Jan 31, 2013 at 11:14 UTC ( #1016290=note: print w/ replies, xml ) Need Help??

in reply to Command line argument Error..


It sounds like your command shell is mangling the arguments for you (most do in one way or another).

Most shells will try to expand the argument list for you when they see a wildcard. Putting quotes around the arguments tells the shell to pass the argument to the script as written. Example:

$ perl t* t.100, t.100.md5, t.10.md5, $ perl 't*' t* $ cat use strict; use warnings; print join(", ", @ARGV),"\n";

In the first run, perl didn't get t*, the shell expanded t* to a list of all matching files and gave that list to the perl script. For the second run, I quoted the argument, so perl actually sees t*.

I'd go further, but your question is somewhat difficult for me to interpret: "but problem is I cannot use like this in my script". I can't tell what's giving you a problem from this point. Care to elaborate?


When your only tool is a hammer, all problems look like your thumb.

Comment on Re: Command line argument Error..
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-11-27 11:18 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (724 votes), past polls