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

How can I send parameters to a perl program from a shell script. code: example.pl abc >>a.txt The above code is not taking abc as parameter. "a.txt" is just an output file and "example.pl" is the perl fil
  • Comment on passing parameters to perl from shell script

Replies are listed 'Best First'.
Re: passing parameters to perl from shell script
by muntfish (Chaplain) on Jul 18, 2005 at 13:44 UTC

    You're checking @ARGV, right? (see perlvar)

    It would help if you could tell us what you've already tried, and how it is failing to work as you expected.


    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&
Re: passing parameters to perl from shell script
by ikegami (Patriarch) on Jul 18, 2005 at 14:00 UTC
Re: passing parameters to perl from shell script
by blazar (Canon) on Jul 18, 2005 at 14:25 UTC
    How can you say it is not taking it? Try to include this line at the top of your script:
    print "@ARGV\n";
Re: passing parameters to perl from shell script
by aditya.singh (Acolyte) on Jul 19, 2005 at 08:52 UTC
    As it has been pointed out, you are to check @ARGV.
    In case you are using @ARGV, post a (minimal) perl script which illustrates your problem.