Re: Getopt::Long

2012-05-16 Thread Manfred Lotz
Hi Rajesh, On Wed, 16 May 2012 16:11:13 +0530 Rajesh Saha wrote: > Hi, > > Sorry for one typo. Read "GetOptions" in place of "Getoptions" . > > Regards, > Rajesh > > > Here is how I do it: #! /usr/bin/perl use strict; use warnings; u

Re: Getopt::Long

2012-05-16 Thread Brandon McCaig
On Wed, May 16, 2012 at 10:56:59AM +, Michael Brader wrote: > Hi, Hello: > Your problem is that Getopt::Long is consuming your -help as > the argument to -abc before it can be recognised. You might be > able to do something with the other Getopt::* modules, but the > followin

RE: Getopt::Long

2012-05-16 Thread Michael Brader
Hi, Your problem is that Getopt::Long is consuming your -help as the argument to -abc before it can be recognised. You might be able to do something with the other Getopt::* modules, but the following piece of code will do what you want if you really need it: use List::MoreUtils qw(any); use

Re: Getopt::Long

2012-05-16 Thread Rajesh Saha
Hi, Sorry for one typo. Read "GetOptions" in place of "Getoptions" . Regards, Rajesh On Wed, May 16, 2012 at 2:39 PM, Rajesh Saha wrote: > Hi, > > In my program, I am using the module Getopt::Long > > My intension is that if the user chooses "--h

Getopt::Long

2012-05-16 Thread Rajesh Saha
Hi, In my program, I am using the module Getopt::Long My intension is that if the user chooses "--help", the program should show the help message without bothering whether other options has been used or not. My program (say, test.pl) : use Getopt::Long my $abc; my $help; Getoption

Re: Getopt::Long in perl

2010-07-29 Thread Jim Gibson
On 7/29/10 Thu Jul 29, 2010 1:17 AM, "Sooraj S" scribbled: > Hi, > > I am using Getopt::Long to accept the command line arguments. > > Logic > - > I have two mandatory options. > 1.mod1_num > 2.mod2_num > > Both of them can accept

Getopt::Long in perl

2010-07-29 Thread Sooraj S
Hi, I am using Getopt::Long to accept the command line arguments. Logic - I have two mandatory options. 1.mod1_num 2.mod2_num Both of them can accept either a 3digit number or another parameter "preserve" which inturn accepts a 3digit number. eg: my_script -mod1_num 123 -mo

Re: getopt::long

2010-07-06 Thread Octavian Rasnita
Hi, use strict; use warnings; use Getopt::Long; my %hash; GetOptions(\%hash, "first=s", "second|s=s", "third=i"); print $hash{first}, $hash{second}, $hash{third}, "\n"; -- Octavian - Original Message - From: "Unknown User" To:

getopt::long

2010-07-06 Thread Unknown User
um, I am pretty sure getopt::long keeps all input data in a hash, does anybody know whether i can use that hash itself in my code, and if so, how? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Getopt::Long

2010-06-17 Thread Robert Wohlfarth
On Thu, Jun 17, 2010 at 6:50 AM, Shawn H Corey wrote: > On 10-06-17 02:36 AM, Unknown User wrote: > >> I have the following code: >> >> GetOptions( >>"n|name=s" => \$name, >>"a|age=i" => \$age, >>"s|sex=s" => \$sex, >> ) || die "Bad options\n";; >> > > But they are comp

Re: Getopt::Long

2010-06-17 Thread Chas. Owens
that. >> >> What would be the correct method to die if one of the options is not >> complete? >> > > But they are complete.  'name' is placed in $name, '-a' is placed in $sex, > and @ARGV is left with ( '20' ). snip Good poi

Re: Getopt::Long

2010-06-17 Thread Shawn H Corey
On 10-06-17 02:36 AM, Unknown User wrote: I have the following code: GetOptions( "n|name=s" => \$name, "a|age=i" => \$age, "s|sex=s" => \$sex, ) || die "Bad options\n";; GetOptions( "name=s" =>\$name, "age=i" => \$age, "sex=s" => \

Re: Getopt::Long

2010-06-17 Thread Chas. Owens
hat i expected this code to do is to die if a bad option was given, > say -s without an arguement, as in ./myprog -n name -s -a 20 > However, it does not do that. > > What would be the correct method to die if one of the options is not complete? GetOptions should print a warning and

Getopt::Long

2010-06-16 Thread Unknown User
I have the following code: GetOptions( "n|name=s" => \$name, "a|age=i" => \$age, "s|sex=s" => \$sex, ) || die "Bad options\n";; What i expected this code to do is to die if a bad option was given, say -s without an arguement, as in ./myprog -n name -s -a 20 However, it d

Re: Getopt::Long and Log::StdLog problem

2008-08-05 Thread rafailowski
Mr. Shawn H. Corey wrote: On Tue, 2008-08-05 at 08:57 +0200, rafailowski wrote: Thx but adding __END__ return me this error, anyway the problem is solve with a BEGIN block (cf.Rob Dixon). $ perl test.pl --log-level=debug Name "main::STDLOG" used only once: possible typo at /usr/local/share

Re: Getopt::Long and Log::StdLog problem

2008-08-05 Thread Mr. Shawn H. Corey
On Tue, 2008-08-05 at 08:57 +0200, rafailowski wrote: > Thx but adding __END__ return me this error, anyway the problem is solve > with a BEGIN block (cf.Rob Dixon). > > $ perl test.pl --log-level=debug > Name "main::STDLOG" used only once: possible typo at > /usr/local/share/perl/5.10.0/Log/Std

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
} stay undef and print $cmd_args_ref->{"log_level"}; return the good value. I don't understand why in : use Log::StdLog {...}, the value of $cmd_args_ref->{"log_level"} stay always undef??? Sorry, I was thinking about the problem correctly. Try: #!/usr/

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Rob Dixon wrote: rafailowski wrote: I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 level => $cmd_args_ref->{"log_level&

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
of > > $cmd_args_ref->{"log_level"} stay always undef??? > > > > > > Sorry, I was thinking about the problem correctly. Try: > > #!/usr/bin/perl > use Getopt::Long; > use Log::StdLog; > > my %cmd_args = (); > my $cmd_args_ref = \%cm

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Rob Dixon
rafailowski wrote: > > I have a problem with Getopt::Long and Log::StdLog. > > An example script, i always have the following error : > Use of uninitialized value in hash element at > /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 > > level => $cmd_args_ref->

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
rint $cmd_args_ref->{"log_level"}; return the good value. > > I don't understand why in : use Log::StdLog {...}, the value of > $cmd_args_ref->{"log_level"} stay always undef??? > > Sorry, I was thinking about the problem correctly. Try: #!/usr/bin/pe

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Mr. Shawn H. Corey wrote: On Tue, 2008-08-05 at 01:05 +0200, rafailowski wrote: Hi all, I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
On Tue, 2008-08-05 at 01:05 +0200, rafailowski wrote: > Hi all, > > I have a problem with Getopt::Long and Log::StdLog. > > An example script, i always have the following error : > Use of uninitialized value in hash element at > /usr/local/share/perl/5.10.0/Log/StdLog.

Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Hi all, I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 level => $cmd_args_ref->{"log_level"} is always unde

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread John W. Krahn
Chas Owens wrote: > On 6/3/07, Chas Owens <[EMAIL PROTECTED]> wrote: >> On 6/3/07, Chas Owens <[EMAIL PROTECTED]> wrote: >> snip >> > my $tidy = "/usr/bin/tidy"; >> > my @tidy_args = qw(--foo --bar -- example); >> > my $path = get_path(); >> > my $file = $path . get_file(); >> > >> > system($tidy,

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Mike Lesser
Okay, I eliminated the tidy with some more robust regex. D'oh! Case closed! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Chas Owens
On 6/3/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 6/3/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > my $tidy = "/usr/bin/tidy"; > my @tidy_args = qw(--foo --bar -- example); > my $path = get_path(); > my $file = $path . get_file(); > > system($tidy, @tidy_args, $file); Opps, forgot the erro

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Chas Owens
On 6/3/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip my $tidy = "/usr/bin/tidy"; my @tidy_args = qw(--foo --bar -- example); my $path = get_path(); my $file = $path . get_file(); system($tidy, @tidy_args, $file); Opps, forgot the error checking. system($tidy, @tidy_args, $file) or die qq(

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Chas Owens
On 6/3/07, Mike Lesser <[EMAIL PROTECTED]> wrote: snip Then I attempted to use Tidy, sans HTML::Tidy, through Shell. The HTML::Tidy lib won't work on my system. So, I have been futzing with tidy and I'v e discovered that tidy and simple commands like cd fail, most likely because of the spaces in

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Mike Lesser
On Jun 3, 2007, at 1:59 PM, Chas Owens wrote: On 6/3/07, Mike Lesser <[EMAIL PROTECTED]> wrote: snip I have to assume that paths can be converted easily for use in shells and such, without resorting to RegEx. Any ideas? snip Aside from the multi argument version of system that Tom has alread

Fwd: Paths, Spaces, Getopt::Long

2007-06-03 Thread Mike Lesser
Begin forwarded message: From: Mike Lesser <[EMAIL PROTECTED]> Date: June 3, 2007 3:48:56 PM EDT To: "Chas Owens" <[EMAIL PROTECTED]> Subject: Re: Paths, Spaces, Getopt::Long On Jun 3, 2007, at 1:59 PM, Chas Owens wrote: On 6/3/07, Mike Lesser <[EMAIL PROTECTED

Fwd: Paths, Spaces, Getopt::Long

2007-06-03 Thread Mike Lesser
Well I'm not sure. I may be explaining this badly. I'll go thru all the details in case it helps. The path I pass when I'm executing the script is escaped, which I assume is correct. Once that path is read by Getopt, I print it and, voila, no escapes, just nice-to-read spaces. This pa

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Chas Owens
On 6/3/07, Mike Lesser <[EMAIL PROTECTED]> wrote: snip I have to assume that paths can be converted easily for use in shells and such, without resorting to RegEx. Any ideas? snip Aside from the multi argument version of system that Tom has already mentioned, the bigger question is "Why are you

Re: Paths, Spaces, Getopt::Long

2007-06-03 Thread Tom Phoenix
On 6/3/07, Mike Lesser <[EMAIL PROTECTED]> wrote: I use the module Getopt::Long to read arguments, one of which is a file path that may have spaces. The path string that is returned from Getopt has spaces without escape chars. The string seems to be fine for Perl use, but not so gre

Paths, Spaces, Getopt::Long

2007-06-03 Thread Mike Lesser
Hi all. I have a problem that _must_ have a very simple solution (that I can't find). I use the module Getopt::Long to read arguments, one of which is a file path that may have spaces. The path string that is returned from Getopt has spaces without escape chars. The string seems

Re: Getopt::Long

2005-11-08 Thread Bob Showalter
Chris Knipe wrote: Hi all, Just a quick question and a couple of lines of really simple code use Getopt::Long; ... GetOptions ('h' => \$h, 'b=s' => \$s ); Sub ShowHelp() { That should be sub ShowHelp { Perl isn't VB :)

Re: Getopt::Long

2005-11-08 Thread Shawn Corey
Chris Knipe wrote: So, this is more of a block question I think, but how I can get the above example to show the help screen FIRST, and THEN complain about the missing value for -s Why? Here's an example of how to do it: #!/usr/bin/perl use strict; use warnings; use File::Basename; use

RE: Getopt::Long

2005-11-07 Thread Timothy Johnson
als sign indicates that this option requires a value. The letter "s" indicates that this value is an arbitrary string. Other possible value types are "i" for integer values..." -Original Message- From: Chris Knipe [mailto:[EMAIL PROTECTED] Sent: Monda

Getopt::Long

2005-11-07 Thread Chris Knipe
Hi all, Just a quick question and a couple of lines of really simple code use Getopt::Long; ... GetOptions ('h' => \$h, 'b=s' => \$s ); Sub ShowHelp() { print "this is help" } Sub DoSomethingWithString() { ... } If ($s)

Re: getopt long behaviour

2005-09-09 Thread Manish Sapariya
riya wrote: Shouldn't following snippet throw error message when it is called without any parameter? I can't see any error messsage, why? Because this didn't have an error. If you want it to quit, force it to quit. #!/usr/bin/perl use Getopt::Long; GetOption

Re: getopt long behaviour

2005-09-09 Thread Jeff 'japhy' Pinyan
[PLEASE don't top-post; it makes it hard to follow the conversation] On Sep 9, Manish Sapariya said: On 09/09/2005 05:56 PM, Chris Devers wrote: On Fri, 9 Sep 2005, Manish Sapariya wrote: Shouldn't following snippet throw error message when it is called without any parameter? Because this

Re: getopt long behaviour

2005-09-09 Thread Manish Sapariya
Shouldn't following snippet throw error message when it is called without any parameter? I can't see any error messsage, why? Because this didn't have an error. If you want it to quit, force it to quit. #!/usr/bin/perl use Getopt::Long; GetOption

Re: getopt long behaviour

2005-09-09 Thread Chris Devers
On Fri, 9 Sep 2005, Manish Sapariya wrote: > Shouldn't following snippet throw error message when > it is called without any parameter? > > I can't see any error messsage, why? Because this didn't have an error. If you want it to quit, force it to quit. #!/us

getopt long behaviour

2005-09-09 Thread Manish Sapariya
Shouldn't following snippet throw error message when it is called without any parameter? I can't see any error messsage, why? # /tmp/test.pl Executed successfully # -- #!/usr/bin/perl use Getopt::Long; GetOptions("verbose" => \$ve

Re: GetOpt::Long

2005-04-22 Thread John Doe
ing "use strict" and "use warnings" which alway gives good hints :-), and it works - but maybe in the sense you mentioned that it works for you too: === begin script (test3.pl) === use strict; use warnings; use Getopt::Long; sub notify_email { local @ARGV = @_; my (@recipien

RE: GetOpt::Long

2005-04-21 Thread Olivier, Wim W
tify_email { local @ARGV = @_; # Get the sub's params into the master param array for GetOpt::Long $ENV{"NTsendmail"} = $conf{'smtp'}; $sender = $conf{'smtpsender'}; GetOptions ("r=s" => [EMAIL PROTECTED], # -r [EMAIL PROT

RE: GetOpt::Long

2005-04-21 Thread Bob Showalter
Olivier, Wim W wrote: > Hi Bob, Hi. Don't top-post please. > If > I comment out this if statement, I don't get the error anymore. An > clues as > to the correct syntax??? > > I run the subroutine as follows: > > if ($conf{'pnl_check_for_analytics_email'} =~ 'ON') >{ notify_email -r [EMAI

RE: GetOpt::Long

2005-04-21 Thread Olivier, Wim W
Hi Bob, (Offer Kaye, thanks for the reply as well!) I used the method below (local @ARGV = @_;) to get the values of @_ into @ARGV for the use of Getopt::Long. It appears to be working fine like that. I now have another problem with, it appears, syntax. The IF statement is part of a block in

Re: GetOpt::Long

2005-04-20 Thread Offer Kaye
On 4/20/05, Olivier, Wim W wrote: > Hi all, > > Is it possible to use GetOpt::Long (or something similar) in a subroutine Getargs::Long - http://search.cpan.org/dist/Getargs-Long/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

RE: GetOpt::Long

2005-04-20 Thread Bob Showalter
Olivier, Wim W wrote: > Hi all, > > Is it possible to use GetOpt::Long (or something similar) in a > subroutine > using @_ instead of in the standard way (using @ARGV)? This should work: sub foo { local @ARGV = @_; GetOptions(...blah...); ... } -- To

RE: GetOpt::Long

2005-04-20 Thread Tim Johnson
How about something like this? It doesn't make it like GetOpt::Long, but it does handle what you want. Or you could just require that people pass an array to your subroutine and save yourself a little work. If there is only one recipient, then it's a one-ele

GetOpt::Long

2005-04-20 Thread Olivier, Wim W
Hi all, Is it possible to use GetOpt::Long (or something similar) in a subroutine using @_ instead of in the standard way (using @ARGV)? I want to have the following scenario, but use GetOpt in a subrouting within the main script and pass options (and values) to the subroutine. The values

Re: need help for Getopt::Long; --resolved

2005-03-25 Thread Shiping Wang
At 10:46 AM 3/25/2005 -0600, Shiping Wang wrote: Hi, I have problem to match array defined in Getopt::Long and transfer to new file: If I do: try.pl --InputData sample.txt --Trait=_BMI --covars=age, _DBP, _SBP --Race=Others with this file: GFAMID GDADID GMOMID ID SEX HYT3 _SBP _DBP _BMI

need help for Getopt::Long;

2005-03-25 Thread Shiping Wang
Hi, I have problem to match array defined in Getopt::Long and transfer to new file: If I do: try.pl --InputData sample.txt --Trait=_BMI --covars=age, _DBP, _SBP --Race=Others with this file: GFAMID GDADID GMOMID ID SEX HYT3 _SBP _DBP _BMI RACE AGE _HTMED antiht How can I get it to

Re: Getopt::Long , handles the number zero differently..

2004-12-21 Thread John W. Krahn
Mike Donnelly wrote: Using the example code below, I find that I can use getopt handily to pass all sorts of variables to my script, as long as a value passed is not a 0 (zero) How to I use getopt::long and be able to pass the number zero as a value? Code, and behavior follows

Getopt::Long , handles the number zero differently..

2004-12-21 Thread Mike Donnelly
Using the example code below, I find that I can use getopt handily to pass all sorts of variables to my script, as long as a value passed is not a 0 (zero) How to I use getopt::long and be able to pass the number zero as a value? Code, and behavior follows

Re: Getopt::Long , handles the number zero differently..

2004-12-21 Thread Mike Donnelly
--- [EMAIL PROTECTED] wrote: > > > - Original Message - > From: Mike Donnelly <[EMAIL PROTECTED]> > Date: Tuesday, December 21, 2004 10:58 am > Subject: Getopt::Long , handles the number zero > differently.. > > Hello > > > > > &

Re: Getopt::Long , handles the number zero differently..

2004-12-21 Thread mgoland
- Original Message - From: Mike Donnelly <[EMAIL PROTECTED]> Date: Tuesday, December 21, 2004 10:58 am Subject: Getopt::Long , handles the number zero differently.. Hello > > > Using the example code below, I find that I can Please paste working code > use

Getopt::Long , handles the number zero differently..

2004-12-21 Thread Mike Donnelly
Using the example code below, I find that I can use getopt handily to pass all sorts of variables to my script, as long as a value passed is not a 0 (zero) How to I use getopt::long and be able to pass the number zero as a value? Code, and behavior follows

Re: Getopt::Std vs. Getopt::Long

2004-07-14 Thread Wiggins d Anconia
> I have been using Getopt::Std for some time and I'm pretty happy with it. > I've been reading about Getopt::Long and it seems to support everything in > Getopt::Std and has some nice conveniences. Does anyone have experience > converting scripts (or just development pro

Getopt::Std vs. Getopt::Long

2004-07-14 Thread perl.org
I have been using Getopt::Std for some time and I'm pretty happy with it. I've been reading about Getopt::Long and it seems to support everything in Getopt::Std and has some nice conveniences. Does anyone have experience converting scripts (or just development process) from Std to L

Re: Getopt::Long::Configure('auto_help')

2004-01-08 Thread Wiggins d Anconia
od file to open? > > Form perldoc Getopt::Long > > Configuring Getopt::Long > Getopt::Long can be configured by calling subroutine > Getopt::Long::Configure(). This subroutine takes a list of quoted > strings, each specifying a configuration option to be enabled, e

Getopt::Long::Configure('auto_help')

2004-01-08 Thread Paul Kraus
Getopt::Long Configuring Getopt::Long Getopt::Long can be configured by calling subroutine Getopt::Long::Configure(). This subroutine takes a list of quoted strings, each specifying a configuration option to be enabled, e.g. "ignore_case", or disabled, e.g. "no_ign

RE: Using GetOpt::Long

2002-09-19 Thread David Samuelsson (PAC)
Samuelsson (PAC) Cc: [EMAIL PROTECTED] Subject: Re: Using GetOpt::Long On Thu, Sep 19, 2002 at 10:02:32AM +0200, David Samuelsson (PAC) wrote: > I want it so it will execute the subs in the order according to the lines > when i start the scrippt, and i will try to keep to default -value cause

Re: Using GetOpt::Long

2002-09-19 Thread Michael Fowler
--. You don't want to make other people use the '--' switches to use the script? Why not? Getopt::Long will probably accommodate you in this, but I would suggest reserving the single '-' for one-letter options, and the double '-' for long options. That way, the

RE: Using GetOpt::Long

2002-09-19 Thread Jeff AA
> -Original Message- > From: David Samuelsson (PAC) > [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 09:03 > To: 'Jeff AA'; [EMAIL PROTECTED] > Subject: RE: Using GetOpt::Long > > > I want it so it will execute the subs in the order accor

RE: Using GetOpt::Long

2002-09-19 Thread David Samuelsson (PAC)
PROTECTED] Subject: RE: Using GetOpt::Long > -Original Message- > From: David Samuelsson (PAC) > [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 08:09 > To: '[EMAIL PROTECTED]' > Subject: Using GetOpt::Long > > > I found this module was a part off

RE: Using GetOpt::Long

2002-09-19 Thread Jeff AA
> -Original Message- > From: David Samuelsson (PAC) > [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 08:09 > To: '[EMAIL PROTECTED]' > Subject: Using GetOpt::Long > > > I found this module was a part off the package, and tried it > out,

Using GetOpt::Long

2002-09-18 Thread David Samuelsson (PAC)
this: use Getopt::Long; if (!GetOptions("reg_backup" => \$reg_backup, "html" => \$html) ){err_exit("$usage\n",0);} if (defined ($reg_backup) ){reg_backup()} if (defined($html)){create_html()} etc.. when i execute the script it does as its

a bit over the top wraper for Getopt::Long

2002-08-30 Thread drieux
his. http://www.wetware.com/drieux/pbl/perlTrick/CommandLine/do_get_opt_long.txt This was derived from a form we had been using as a sorta stock way to spin up bunches of command line options with Getopt::Long - http://www.wetware.com/drieux/pbl/perlTrick/CommandLine/simple_get_long.txt I just always promi

Re: Getopt::Long option prefix

2002-08-26 Thread Karl Kaufman
Hi David, >From what I've seen, Getopt::Long default behavior is to accept either '--opt|-opt'. (Tested on Solaris 2.6 w/ Perl 5.005_03) test.pl #!/usr/local/bin/perl use strict; use diagnostics; use Getopt::Long; my %pagerdest = (); Getopt::Long::Configure(

Re: Parameter parsing with Getopt::Long in functions

2002-06-15 Thread Robert Kasunic
Hello Paul, On Sat, Jun 15, 2002 at 06:27:18PM +0200, Paul Johnson wrote: > > sub test_params() > > { > >@ARGV=@_; > local @ARGV = split " ", shift; > Hopefully you can work out what the problem was and why the fix works. I can't believe how blind I've been. Thank you very much. I now c

Re: Parameter parsing with Getopt::Long in functions

2002-06-15 Thread drieux
nt "ARGV: @ARGV\n"; >> } >> >> &test_params("-a argument_a -b -c"); >> &test_params("--opta argument_a -b -c"); >> &test_params("-b"); >> &test_params("-c -b"); H! My complements The probl

Re: Parameter parsing with Getopt::Long in functions

2002-06-15 Thread drieux
On Saturday, June 15, 2002, at 09:10 , Robert Kasunic wrote: > > I'm trying to use Getopt::Long for parsing parameters passed to a > function. I tried to test if that works by using the following script. > > --- > #

Re: Parameter parsing with Getopt::Long in functions

2002-06-15 Thread Paul Johnson
On Sat, Jun 15, 2002 at 06:10:23PM +0200, Robert Kasunic wrote: > Hello, > > I'm trying to use Getopt::Long for parsing parameters passed to a > function. I tried to test if that works by using the following script. > > --

Parameter parsing with Getopt::Long in functions

2002-06-15 Thread Robert Kasunic
Hello, I'm trying to use Getopt::Long for parsing parameters passed to a function. I tried to test if that works by using the following script. --- #!/usr/bin/perl -w use strict; use Getopt::Long; sub test_params() { @ARGV=@_;

RE: getOpt::long?

2002-03-13 Thread Nikola Janceski
try $ perldoc Getopt No documentation found for "Getopt". However, try perldoc Getopt::Long perldoc Getopt::Std perldoc Getopt::Long.html perldoc Getopt::Std.html -Original Message- From: Jason Larson [mailto:[EMAIL PROTECTED]] Sent: Wednesday

RE: getOpt::long?

2002-03-13 Thread Jason Larson
> -Original Message- > From: michael [mailto:[EMAIL PROTECTED]] > Subject: Re: getOpt::long? > > > > > I am a true perl newbie. > > > > If you continue like this you will stay one. > > > :-) Thanks for all the feedback. I had intended to send

Re: getOpt::long?

2002-03-13 Thread Jenda Krynicky
From: "michael" <[EMAIL PROTECTED]> > :-) Thanks for all the feedback. I had intended to send the assignment as an > attachment and ask about: > 1) Configuring my win2k box so that I could use the command line to run a > perl program without having to type 'perl' before the name

Re: getOpt::long?

2002-03-13 Thread michael
- Original Message - From: "Jenda Krynicky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 7:10 AM Subject: Re: getOpt::long? > From: Michael <[EMAIL PROTECTED]> > > > I am a true perl newbie. > &g

Re: getOpt::long?

2002-03-13 Thread Jenda Krynicky
From: Michael <[EMAIL PROTECTED]> > I am a true perl newbie. If you continue like this you will stay one. > I am supposed to: > > Write a program that finds lines in an input file and copies them to an > output file . The program takes the following arguments: > >an in

Re: getOpt::long?

2002-03-12 Thread Chas Owens
On Tue, 2002-03-12 at 21:50, Michael wrote: > I am a true perl newbie. I am supposed to: > > -- > -it does make a difference- >-michael- > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Okay, so what is the question? -- T

getOpt::long?

2002-03-12 Thread Michael
usage of Getopt functions, type the following commands: $ perldoc Getopt::Std $ perldoc Getopt::Long Take into account the following conditions: The input file should exist. If the output file does NOT exist, create one. If exists, append the output to the file. What if the end offset is

Re: Getopt::Long problem (Allegedly)

2002-01-30 Thread Briac Pilpré
me software which uses -s as an option and need to handle the options > the same in the PERL replacement. Is there a bug with "s:s"? > By default, Getopt::Long is case insensitive. Try adding the "bundling" and "ignore_case" options. cf perldoc Getopt::Long (Co

Getopt::Long problem (Allegedly)

2002-01-30 Thread Angus Laycock
d. I am trying to replace some software which uses -s as an option and need to handle the options the same in the PERL replacement. Is there a bug with "s:s"? use Getopt::Long; my $DATABASE = ""; my $PASSWORD = ""; my $USER = ""; my $SERVER = "&qu

Re: GetOpt::Long - Usage question

2001-08-15 Thread Michael Fowler
On Wed, Aug 15, 2001 at 02:49:34PM -0700, pn wrote: > #/usr/bin/perl -w > use strict; > > # Forward declarations > > my $opt_help; This is your problem right here. Getopt::Long sets the package global $main::opt_help, but now that you've declared the variable lexi

GetOpt::Long - Usage question

2001-08-15 Thread pn
Hi, I am unable to get the following inherited code, using Getopt::Long, to work. It is my understanding that Perl will automatically create a $opt_help variable ( for a -help command line option). However, when I try to print it's value, it returns a null value. In addition, the "he

Re: can't able to understand this behaviour of Getopt::Long

2001-08-03 Thread Michael Fowler
On Fri, Aug 03, 2001 at 04:05:33PM +0530, Rajanikanth Dandamudi wrote: > - > #!/usr/local/bin/perl > use Getopt::Long; > > my $filename; > print "Before : ARGV = @ARGV\n"; > $ret = GetOptions('abc=s' =&

can't able to understand this behaviour of Getopt::Long

2001-08-03 Thread Rajanikanth Dandamudi
Hello, I am not able to understand the following behaviour of perl Getopt::Long. Here is the snippet of code that I am not able to understand: Start of code - #!/usr/local/bin/perl use Getopt::Long; my $filename; print "Before : ARGV = @A

Re: is there a module ala getopt::long that will ... as well as command-line completion

2001-07-30 Thread Paul Johnson
On Mon, Jul 30, 2001 at 10:36:50AM -0700, Matt Lyon wrote: > here's one for the group... is there a module ala getopt::long that will do > the arg-getting as well as command-line completion with a predefined > list/hash/etc... of keywords? Command line completion is done by a she

is there a module ala getopt::long that will ... as well as command-line completion

2001-07-30 Thread Matt Lyon
here's one for the group... is there a module ala getopt::long that will do the arg-getting as well as command-line completion with a predefined list/hash/etc... of keywords? -mL -- Life would be so much easier if its source code was well-commented. -- To unsubscribe, e-mail: [EMAIL PROT

Re: Getopt::Long

2001-07-21 Thread iain truskett
* Bicknell, Frank ([EMAIL PROTECTED]) [21 Jul 2001 08:12]: [...] > Using Getopt::Long, it's possible to watch for negated options: > -nostuff ... and it's possible to alias options "stuff|such" allows > -stuff to be the same as -such. [...] > $ stuff -nosu

Getopt::Long

2001-07-21 Thread Bicknell, Frank
I'm not sure if this is the right forum, but here goes (I'm a beginner at posting questions to the list?) Using Getopt::Long, it's possible to watch for negated options: -nostuff ... and it's possible to alias options "stuff|such" allows -stuff to be the same as