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

Reading in parameters

by basicdez (Pilgrim)
on Mar 13, 2002 at 12:52 UTC ( #151359=perlquestion: print w/replies, xml ) Need Help??

basicdez has asked for the wisdom of the Perl Monks concerning the following question:

Okay I am now passing my needed parameters with a system call, but how do I pick them up on the other end. With what I have here, I am getting nothing passed into!

Here is the line I am trying, but it is not working...

my ( $arg1 , $arg2, $arg3 ) = @_; #To read parameters system (" $number $name $type"); #To send them
Please help me if you can? </code>

Replies are listed 'Best First'.
Re: Reading in parameters
by derby (Abbot) on Mar 13, 2002 at 12:55 UTC

    That was answered in the original thread.

    my( $arg1, $arg2, $arg3 ) = @ARGV

    You don't really need to assign to argX, perl automatically places the command line args in the @ARGV array for you.


Re: Reading in parameters
by ChOas (Curate) on Mar 13, 2002 at 12:58 UTC

    In use the following:
    my ( $arg1 , $arg2, $arg3 )=@ARGV;
    And they should magically appear, and be usable, in

    And might I advice you to use:
    system (,$number,$name,$type);
    If you`re not gonna use the shell, just do it for safety`s sake...

    Hope this helps!


    print "profeth still\n" if /bird|devil/;
Re: Reading in parameters
by PrimeLord (Pilgrim) on Mar 13, 2002 at 14:57 UTC
    In the spirit of TIMTOWTDI you could always look at Getopt::Std. It would give you a little more flexibilty with your arguments.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://151359]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2022-05-23 15:49 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (82 votes). Check out past polls.