RE: Looking for a equivalant function in Perl for main(int argc, char *argv[ ])

From: Bob Showalter (Bob_Showalter_at_taylorwhite.com)
Date: 04/28/04


To: 'Shilpa Arvind' <shilparvind@hotmail.com>, beginners@perl.org
Date: Wed, 28 Apr 2004 15:12:17 -0400

Shilpa Arvind wrote:
> Hi,
>
> In C programming language we have a function which looks like this:
>
> main(int argc, char *argv[ ]).
>
> Is there a equivalant function in Perl. I was looking at @ARGV but i
> feel it does not behave the same way as the above function does. I
> might be wrong.

@ARGV does not contain the program name as the first element. That is placed
in $0 instead. Read the relevant sections in perldoc perlvar. Also read the
section on "C Traps" in perldoc perltrap.



Relevant Pages

  • Re: How to get at the perl options
    ... BM> Some of them show up as magic variables: see perldoc perlvar. ... >> ask for these in 16 years of hacking perl. ... See the ugly hacks done in perl debugger to ... call perl and pass argv to it. ...
    (comp.lang.perl.misc)
  • Re: Looking for a equivalant function in Perl for main(int argc, char *argv[ ])
    ... On Apr 28, 2004, at 1:50 PM, Shilpa Arvind wrote: ... > In C programming language we have a function which looks like this: ... > Is there a equivalant function in Perl. ... I was looking at @ARGV but i ...
    (perl.beginners)
  • Python 2nd favorite language in Linux Journal poll
    ... favorite programming language. ... In the 2005 poll, Python is 2nd, its ... three is Perl, while PHP slips to fourth place, closely followed by ... The voting was close this year, too; only 59 votes separated C ...
    (comp.lang.python)
  • Re: revisiting web development in Perl...where to start?
    ... There's no trick to this -- you use a programming language to spit out ... ASP ... Seibel came out with a wildly popular book that touches on generating ... The Perl frameworks listed include Catalyst, Interchange, Mason, and ...
    (comp.lang.perl.misc)
  • Re: cgi_bin
    ... But he does not have a question about the Perl programming language, ... And neither is it about Perl. ... If I had asked on a newsgroup about web server configuration, I think I would have been less likely to get a helpful answer than I was here. ... actually caused by some regulars' disinterest in CGI and in giving those ...
    (comp.lang.perl.misc)