Re: command line arguments

2002-03-06 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> > Is there a way to get the command line arguments before they are > expanded by the shell? > > script.pl file* names* > > I want to get the file* and not the expanded list of file1 file2 file3 > file4 etc. > > I know I can put it in quotes but is ther

RE: command line arguments

2002-03-06 Thread Hanson, Robert
--Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:08 PM To: Hanson, Robert; Nikola Janceski; Beginners (E-mail) Subject: RE: command line arguments I was hoping for some way to capture it in perl instead with out having to change the co

Re: command line arguments

2002-03-06 Thread Chris Ball
> "Nikola" == Nikola Janceski <[EMAIL PROTECTED]> writes: Nikola> Is there a way to get the command line arguments before they Nikola> are expanded by the shell? Nope. Perl simply doesn't get to see them. It's part of your interaction with the shell. Nikola> I know I can put i

RE: command line arguments

2002-03-06 Thread Nikola Janceski
I was hoping for some way to capture it in perl instead with out having to change the command line arguments. -Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:05 PM To: 'Nikola Janceski'; Beginners (E-mail) Subject: RE: co

RE: command line arguments

2002-03-06 Thread Hanson, Robert
You should be able to just escape the *. Single quoting them should also work. script.pl file\* names\* script.pl 'file*' 'names*' Rob -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:03 PM To: Beginners (E-mail) Subject: command lin

Re: command line arguments

2002-02-06 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > This script gives me nothing: > > #!/usr/bin/perl -F/\t/ -ap > > print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 1816; ^ > print @F[14 .. 17] if $F[0] eq "H" and $F[5] = 5380;

Re: Command Line arguments.

2001-11-21 Thread Martin Pfeffer
On Tue, 20 Nov 2001 23:50:54 -0500, you wrote: my @args = @ARGV; @ARGV contains the command line parameter. martin >In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Nicolae Popovici) wrote: > >> Hi guys, >> >> Can anyone tell me how can I take the command line arguments in a perl >> scri

Re: Command Line arguments.

2001-11-21 Thread Scott R. Godin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Nicolae Popovici) wrote: > Hi guys, > > Can anyone tell me how can I take the command line arguments in a perl > script . I forgot how to do it . > Thanks for your support . Couple ways. process a loop around @ARGV... work with the Modules

RE: Command Line arguments.

2001-11-20 Thread RArul
The command-line arguments are stored in the built-in @ARGV array. Therefore, if you say something like : perl sample.pl argument1 argument2 argument3 then in your program you can access each of the command-line arguments as follows print $ARGV[0]; #prints argument1 print $ARGV[1]; #prints arg

Re: Command Line Arguments and @_

2001-06-04 Thread Hasanuddin Tamir
On Mon, 4 Jun 2001, Paul <[EMAIL PROTECTED]> wrote, > --- George Petri <[EMAIL PROTECTED]> wrote: > > > "When you launch a script from the command line, for example, @_ > > populates with all of the parameters passed in through the command > > line" > > Typo. @ARGV is correct, as you already

Re: Command Line Arguments and @_

2001-06-04 Thread Paul
--- George Petri <[EMAIL PROTECTED]> wrote: > "When you launch a script from the command line, for example, @_ > populates with all of the parameters passed in through the command > line" Typo. @ARGV is correct, as you already figured out. =o) __

Re: Command Line Arguments and @_

2001-06-04 Thread Jeff Pinyan
On Jun 4, Tony Cook said: >On Mon, 4 Jun 2001, George Petri wrote: > >> >> In a book called "Open Source Linux Web Porgramming" by Jones and Batchelor, >> it says (on Page 61): > >If your book says this, then it's wrong on 2 counts, both of which you >seem to have discovered yourself: Perhaps

Re: Command Line Arguments and @_

2001-06-04 Thread Gary Stainburn
Hi George, Perldoc -f shift gives you: =item shift ARRAY =item shift Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down. If there are no elements in the array, returns the undefined value. If ARRAY is omitted, shifts the C<@_> array

Re: Command Line Arguments and @_

2001-06-04 Thread Michael Fowler
On Mon, Jun 04, 2001 at 08:02:36PM +, George Petri wrote: > In a book called "Open Source Linux Web Porgramming" by Jones and > Batchelor, it says (on Page 61): > > "When you launch a script from the command line, for example, @_ populates > with all of the parameters passed in through the c

Re: Command Line Arguments and @_

2001-06-04 Thread Rolf
George Petri wrote: > However, if I use "shift @ARGV", I DO get the command line arguments. If the > shift function really does use @_ as its default argument, then why did shift > in the example code, use @ARGV as default? Does @_ really get populated > "with all of the parameters passed in th

Re: Command Line Arguments and @_

2001-06-04 Thread Tony Cook
On Mon, 4 Jun 2001, George Petri wrote: > > Hi! > > In a book called "Open Source Linux Web Porgramming" by Jones and Batchelor, > it says (on Page 61): > > "When you launch a script from the command line, for example, @_ populates > with all of the parameters passed in through the command l