> "Adam" == Adam Morton <[EMAIL PROTECTED]> writes:
Adam> So, we've covered the nice, general, modular way to do it, but
Adam> no one so far has mentioned the quick and dirty way.
And, of course, you can:
push @ARGV, $filename;
as a shortcut to having to bother issuing an open(
> On Thursday, May 2, 2002, at 12:32 , Josef E. Galea wrote:
>
> > How can I pass parameters (eg: a file name) to a Perl script
So, we've covered the nice, general, modular way to do it, but no one so far
has mentioned the quick and dirty way.
If you want to specify a file name for purposes of
On Thursday, May 2, 2002, at 12:32 , Josef E. Galea wrote:
> How can I pass parameters (eg: a file name) to a Perl script
you will ultimately want to deal with
perldoc GetOpt::Long
as the complexity of the command line argument sequence grows.
given something like:
#!/usr/bin/p
Just curious, Josef - are you using Windows and have you adjusted the file
type binding for open? If you are using windows and have not adjusted the
binding do so as follows:
goto My Computer, View, Options, File Types. Then find the perl .pl
extension and edit the file type, edit the open action,
> "Josef" == Josef E Galea <[EMAIL PROTECTED]> writes:
Josef> How can I pass parameters (eg: a file name) to a Perl script
If you mean via the console, parameters (or 'arguments') magically end
up in the @ARGV array, which you can access inside your script. An
example of this would be (
On Thu, 2002-05-02 at 15:32, Josef E. Galea wrote:
> How can I pass parameters (eg: a file name) to a Perl script
>
> Josef
@ARGV contains the arguments to the script. So if I say
prog.pl first 2 third
then $ARGV[0] is 'first', $ARGV[1] is 2, and $ARGV[2] is 'third'.
--
Today is Boomtime th
If you just want to pass a limited number of parameters, in a specified
order, where they will always be there, it's easiest. They are then stored
in the array @ARGV.
script.pl filename.txt
has the string filename.txt in $ARGV[0]
If you want to use flags and optional parameters and such then r
On Thu, 2 May 2002 21:32:49 +0200 "Josef E. Galea" <[EMAIL PROTECTED]> wrote:
> How can I pass parameters (eg: a file name) to a Perl script
The paramaters will be passed into the array @ARGV so that:
perl test.pl file1 file1 file3
will come into the script as:
$ARGV[0] = 'file
what kind of problem you hav ?
martin
On Tue, 27 Nov 2001 22:04:25 +0530, you wrote:
>I'd like some help running single line programs from the command line with
>the -e parameter. I keep having problems.
>
>Thanks.
>
>Pc
>
>
>
>_
>Do You Y
At this site excluding shipping and handling "Learning Perl 3rd
Edition" costs $20.50
http://www.bookpool.com/.x/n5qthihx78/ss/1?qs=Learning+Perl+3rd+editio
n&Go.x=9&Go.y=13
>I' m afraid i can't aford that book or any such book-i tried every single
>store and here's the big problem:almost all
On Tue, Aug 14, 2001 at 11:20:00PM +0300, menihtas wrote:
> This is a very "abstract question-subject "but I'm counting on your help :
> It concerns functions'/methods' parameters - "threading" parametres into
> functions and methods
You tell us what your question concerns, and what it's generall
11 matches
Mail list logo