Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Command line args

by VSarkiss (Monsignor)
on Jun 06, 2001 at 19:04 UTC ( [id://86255]=note: print w/replies, xml ) Need Help??


in reply to Command line args

You've got a bit of a mish-mosh here.

Command line arguments are passed in the array @ARGV, not the scalar $ARGV. It doesn't matter whether you use it before or after "use DBI", so if the behavior of your program changes when you do that, you must be making some other change as well, but I can't tell what without looking at the (Perl) code.

Finally, that error message is from your program, not bash; if bash tried to open a file and couldn't, it would only say: data2: No such file or directory Somewhere in your code, you must be saying something along the lines of open X, $filename or die "Can't open $filename: $!"; So the next question: does the file data2 exist??

So.... To answer your question "How do you pass strings as command line parameters?": they're passed in @ARGV; see, for example, man perlrun.

To answer your question, "What am i doing wrong?": It's not clear, maybe several things. Code snippet would help.

HTH

Replies are listed 'Best First'.
Re: Re: Command line args
by iamcal (Friar) on Jun 06, 2001 at 19:20 UTC
    Stated that a big wrong - i meant to say $ARGV[0] wasn't containing anything. But this was because is was confusing <> and <STDIN>.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-07-12 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.