Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: help me please

by BUU (Prior)
on Apr 12, 2002 at 06:12 UTC ( #158500=note: print w/replies, xml ) Need Help??


in reply to help me please

/me hopes hes not violating any monastery standards.. everything on the command line is automagically placed into the @argv array, split on spaces. moreoever, the diamond operator automagicaly reads from the first arguement in the argv array (or something like that.. go look it up)

Replies are listed 'Best First'.
Re: Re: help me please
by mirod (Canon) on Apr 12, 2002 at 06:23 UTC

    That would actually be the @ARGV array.

    #!/usr/bin/perl -w use strict; my $filename= shift @ARGV; ....

    As BUU mentionned <> works automagically: you can call the following script with perl test.pl my_file

    #!/usr/bin/perl -w use strict; while( <>) { # reads from my_file ... }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158500]
help
Chatterbox?
virtualsue wellen auf dich

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-12-13 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (365 votes). Check out past polls.

    Notices?