Re: Help with Getopt::Std

2011-10-22 Thread Peter Scott
On Sat, 22 Oct 2011 11:58:38 +1300, newbie01 perl wrote: > Am just trying to port 1:1. Quite painful trying to figure out how to > get awk-like behavior in Perl especially when trying to do some > calculation on some specific fields. Awk is Perl's closest ancestor on the evolutionary tree, from on

Re: Help with Getopt::Std

2011-10-21 Thread newbie01 perl
Hi Brandon, Thanks for your response. Getopt::Std seems to be the simplest one, so am tryiing that one out first :-) Am just trying to port 1:1. Quite painful trying to figure out how to get awk-like behavior in Perl especially when trying to do some calculation on some specific fields. I&#x

Re: Help with Getopt::Std

2011-10-20 Thread Brandon McCaig
On Thu, Oct 20, 2011 at 11:45 PM, newbie01 perl wrote: > Playing around with Getopt::Std as am trying to convert a UNIX > Korn Shell Script to a Perl script. > > Is it possible to check for what are the values for opterr, > optarg, optind? How? :(- There are many Getopt:: packag

Help with Getopt::Std

2011-10-20 Thread newbie01 perl
Hi all, Playing around with Getopt::Std as am trying to convert a UNIX Korn Shell Script to a Perl script. Is it possible to check for what are the values for opterr, optarg, optind? How? :(- I've been Googling for quite sometime now and can't find an example of Perl scripts that

Re: Getopt::Std and warnings

2007-12-14 Thread reader
John W.Krahn <[EMAIL PROTECTED]> writes: > On Friday 14 December 2007 09:09, [EMAIL PROTECTED] wrote: >> >> I want a warning message without having to do special coding with >> Getopt::Std. > > Getopt is one of those itches that a lot of people have

Re: Getopt::Std and warnings

2007-12-14 Thread John W . Krahn
On Friday 14 December 2007 09:09, [EMAIL PROTECTED] wrote: > > I want a warning message without having to do special coding with > Getopt::Std. Getopt is one of those itches that a lot of people have felt like scratching: http://search.cpan.org/search?query=getopt&mode=module If G

Getopt::Std and warnings

2007-12-14 Thread reader
I want a warning message without having to do special coding with Getopt::Std. I'd like for options passed to getops() with the (:) colon to give a warning message or even possibly die (Haven't decided that yet) if no argument accompanies them. But first: The Getopt::Std documentati

Re: What happened to Getopt::Std ?

2007-06-14 Thread Miguel Santinho
Em (On) Wed, Jun 13, 2007 at 09:29:27AM -0400, John Peacock escreveu (wrote): > The Kurila project is a fork of Perl5 without the strict backwards > compatibility required of v5.10.0, as a theoretical experiment. You'll note > now that under CPAN, it shows up as Is CPAN (Comprehensive __Perl__

Re: What happened to Getopt::Std ?

2007-06-13 Thread John Peacock
Mumia W. wrote: I don't know what is going on. It smells like an attempt to compromise people's systems, although it could be a mistake. Then maybe you should use Google or even look at the distro, before making wild accusations: http://www.nntp.perl.org/group/perl.perl5.porters/2007/04/msg1

Re: What happened to Getopt::Std ?

2007-06-13 Thread Mumia W.
On 06/13/2007 08:29 AM, John Peacock wrote: Mumia W. wrote: I don't know what is going on. It smells like an attempt to compromise people's systems, although it could be a mistake. Then maybe you should use Google or even look at the distro, before making wild accusations: http://www.nntp.p

Re: What happened to Getopt::Std ?

2007-06-13 Thread Miguel Santinho
Em (On) Wed, Jun 13, 2007 at 09:03:09AM +0100, Jorge Almeida escreveu (wrote): > http://search.cpan.org/search?m=module&q=getopt&s=21 What is this Perl Kurila? and why is this (apparently) creating conflicts with some namespaces? http://search.cpan.org/~tty/kurila-0_02/ Miguel pgprv5pnkRfrR.p

Re: What happened to Getopt::Std ?

2007-06-13 Thread Mumia W.
On 06/13/2007 03:03 AM, Jorge Almeida wrote: http://search.cpan.org/search?m=module&q=getopt&s=21 Hmm: http://search.cpan.org/~tty/kurila-0_02/ Hmm: http://search.cpan.org/src/TTY/kurila-0_02/ It looks like this person, TTY, uploaded a modified version of Perl to his/her CPAN director

What happened to Getopt::Std ?

2007-06-13 Thread Jorge Almeida
http://search.cpan.org/search?m=module&q=getopt&s=21 -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Getopt::Std producing unexpected results

2006-12-19 Thread RICHARD FERNANDEZ
> Getopt::Std only works with single hyphen switches, the only > exceptions being '--', '--help' and '--version'. > > perldoc Getopt::Std > > > Getopt::Std also processes swithes in clusters so "-abcd > filename" is th

Re: Getopt::Std producing unexpected results

2006-12-18 Thread John W. Krahn
RICHARD FERNANDEZ wrote: > Hi Folks, Hello, > I've written a little mytest.pl using Getopt::Std: > > > #!/usr/bin/perl > use warnings; > use strict; > use Getopt::Std; > > getopt('hl'); > our ($opt_h, $opt_l); > > my $hostname = $opt_h

Getopt::Std producing unexpected results

2006-12-18 Thread RICHARD FERNANDEZ
Hi Folks, I've written a little mytest.pl using Getopt::Std: #!/usr/bin/perl use warnings; use strict; use Getopt::Std; getopt('hl'); our ($opt_h, $opt_l); my $hostname = $opt_h ? $opt_h : undef; my $file = $opt_l ? $opt_l : undef; my @volgroups = @ARGV;

Re: hwo to configure the Getopt:::STD options for command line arguments.

2006-10-16 Thread W.P.Nijhof
). Try this use Getopt::Std; use strict; our ($opt_a, $opt_b, $opt_c); getopts( 'a:b:c:' ); print join "\n", ($opt_a, $opt_b, $opt_c); HtH WayPay -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/&

hwo to configure the Getopt:::STD options for command line arguments.

2006-10-16 Thread perl pra
hi All, I have to call some perl scripts with command line arguements from another perl script. (some thing like this) perl -s -a $ENV{X} -b $ENV{Y} -c $ENV{Z} ; ( -a , -b, -c are also the arguments to call the script) ( the $ENV{x}=C:\xyz\abc,$ENV{Y}=abc,$ENV{Z}=5). I understand we

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: Using Getopt::Std

2004-01-13 Thread Hacksaw
> > > > Hi, > > i am using the Getopt::Std package in my code. > > > > > > use Getopt::Std; > > > > getopts('s:'); > > > > $a = $opt_s By the way, you don't really need to assign the $opt_x variables to a new va

Re: Using Getopt::Std

2004-01-13 Thread William.Ampeh
Put quotes around your arguments. Use single quotes if you are not doing variable substitution, and double quotes if otherwise. That is: my_program.pl -s 'will[1]' "$will" __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Using Getopt::Std

2004-01-13 Thread Wiggins d Anconia
> Hi, > i am using the Getopt::Std package in my code. > > > use Getopt::Std; > > getopts('s:'); > > $a = $opt_s > > > this is how i run my program from command line " > > > my_program.pl -s pattern > > now if "pa

Using Getopt::Std

2004-01-13 Thread Perl
Hi, i am using the Getopt::Std package in my code. use Getopt::Std; getopts('s:'); $a = $opt_s this is how i run my program from command line " > my_program.pl -s pattern now if "pattern" is something like abcd[12] how do i make my program accept the index 12

Re: Problem with Getopt::Std

2003-01-31 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > print "$stringGoodbye\n"; Whoops--sorry, that should be: print $string . "Goodbye\n"; Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Problem with Getopt::Std

2003-01-31 Thread R. Joseph Newton
Pedro Antonio Reche wrote: > chop($program); Don't use chop. Use chomp. I suppose there are some contexts in which the use of chop would be appropriate, but there is also a good chance that is is cutting off critical data, since it arbitrarily shortens the string by one character, regardl

Re: Problem with Getopt::Std

2003-01-30 Thread John W. Krahn
Pedro Antonio Reche wrote: > > Hi all, I using the code below that uses the Getopt::Std to process the > arguments from the command line (init subroutine). However, for some > reason I do not get the arguments from the switches. If anyone sees > what is the mistake I will be happ

Re: getopt::std problem ignoring options

2003-01-30 Thread Wiggins d'Anconia
Jayesh Patel wrote: So to make my script dummy proof, I am trying to find easy ways of parsing the input the getopts ignores. I guess what I am looking for is a getopt::std that saves the part that it ignores in a special variable. Does anyone do this ? I don't like the getopt:

RE: getopt::std problem ignoring options

2003-01-30 Thread Jayesh Patel
Never mind. I found that ARGUE has exactly what I'm looking for. dumb mistake. Thanks, Jayesh -Original Message- From: Jayesh Patel Sent: Thursday, January 30, 2003 7:59 PM To: 'Wiggins d'Anconia'; Jayesh Patel Cc: '[EMAIL PROTECTED]' Subject: RE: getopt

RE: getopt::std problem ignoring options

2003-01-30 Thread Jayesh Patel
ooking for is a getopt::std that saves the part that it ignores in a special variable. Does anyone do this ? I don't like the getopt::long because I use many options. Also with the -- & something=something, things look ugly and the developers like things simple. Thanks in advance, Jayesh

Re: getopt::std problem ignoring options

2003-01-30 Thread Wiggins d'Anconia
p.s. for those interested I have a cheat sheet I made a while ago at the following (I am sure I will clean it up at some point and make it harder to print ;-) but for now it is at least useful): http://danconia.org/online/GetOpt_QuickRef.txt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: getopt::std problem ignoring options

2003-01-30 Thread Wiggins d'Anconia
Jayesh Patel wrote: Hi all, Just wondering how some of you are handling this issue that I have. I am using the getopt::std. When I pass in parameters to my script with a possible mistake, the getopts ignores the rest of my switches. For example: script.pl -a something -b something

Re: getopt::std problem ignoring options

2003-01-30 Thread kevin r
EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Subject: getopt::std problem ignoring options Date: Thu, 30 Jan 2003 16:14:44 -0500 Hi all, Just wondering how some of you are handling this issue that I have. I am using the getopt::std. When I pass in parameters to my script with a possible m

RE: getopt::std problem ignoring options

2003-01-30 Thread Toby Stuart
> -Original Message- > From: Jayesh Patel [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 31, 2003 8:15 AM > To: '[EMAIL PROTECTED]' > Subject: getopt::std problem ignoring options > > > Hi all, > > Just wondering how some of you are ha

getopt::std problem ignoring options

2003-01-30 Thread Jayesh Patel
Hi all, Just wondering how some of you are handling this issue that I have. I am using the getopt::std. When I pass in parameters to my script with a possible mistake, the getopts ignores the rest of my switches. For example: script.pl -a something -b something else -c another_one -d etc

RE: Problem with Getopt::Std

2003-01-30 Thread Bob Showalter
Pedro Antonio Reche wrote: > Hi all, I using the code below that uses the Getopt::Std to process > the arguments from the command line (init subroutine). However, for > some reason I do not get the arguments from the switches. > ... > getopts('pab'); If the options

Problem with Getopt::Std

2003-01-30 Thread Pedro Antonio Reche
Hi all, I using the code below that uses the Getopt::Std to process the arguments from the command line (init subroutine). However, for some reason I do not get the arguments from the switches. If anyone sees what is the mistake I will be happy to hear about it. #!/usr/sbin/perl -w use Getopt

Re: Getopt::Std issues

2002-08-02 Thread George Schlossnagle
you're specifying that -n takes an argument, but then passing it none, so it's interpreting the trailing -h as such, On Friday, August 2, 2002, at 01:32 PM, [EMAIL PROTECTED] wrote: > I'm not sure if this is a problem with Getopt::Std or if it's just me, > bu

Re: Getopt::Std issues

2002-08-02 Thread ccurtis
On Fri, Aug 02, 2002 at 01:32:52PM -0400, [EMAIL PROTECTED] wrote: > I'm not sure if this is a problem with Getopt::Std or if it's just me, but > I'm having some issues getting this to cooperate: > > use Getopt::Std; > my %OPT = (); > getopt('dhnt:

Getopt::Std issues

2002-08-02 Thread ccurtis
I'm not sure if this is a problem with Getopt::Std or if it's just me, but I'm having some issues getting this to cooperate: use Getopt::Std; my %OPT = (); getopt('dhnt:', \%OPT); and later... if (exists($OPT{'h'})) { ## print usage an

use Getopt::Std was Re: Getting data from console

2002-05-29 Thread drieux
On Wednesday, May 29, 2002, at 09:27 , drieux wrote: [..] > perldoc Getopt::Standard before the monkeyBoys[tm] start screeching and flapping their wings - that should have been perldoc Getopt::Std I keep forgetting when we spend the $100 and buy the vowel from vanna. So t

RE: getopt::std

2002-05-21 Thread Mark Anderson
ng? >> ie I call "dowhatever.pl -s 192.168.1.1 -o didthis.txt" >> >> How would I go about getting this working? > >I don't know what the PLEAC perl project is, but the documentation >for Getopt::Std is real clear on how to do this. What is the >specif

getopt::std

2002-05-21 Thread Postman Pat
Greetings, I am trying to do command line processing using the above lib, but am not quite getting the syntax from the PLEAC perl project. For instance I have the following args allowed: -s x.x.x.x | server.domain.com > server is ip/host -o outfile > output to outfile -h > display help. I under

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Paul Johnson
On Sat, May 11, 2002 at 08:43:13AM -0700, drieux wrote: > > On Friday, May 10, 2002, at 07:07 , Tanton Gibbs wrote: > > >Yes you can say > > > >our $opt_m; > > > >or > > > >use vars qw($opt_m); > > > >at the top of your program (depending on perl version). > > I've been preached the orthodoxy o

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Felix Geerinckx
on Sat, 11 May 2002 18:10:41 GMT, Jonathan e. paton wrote: > You've never seen the implementation of 'use vars' then :) The > tail end of which is: > [...] > Which I assure you has a LOT to do with importing into symbol tables. > This is the reason 'use vars' is package scoped. Thanks for clar

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Note that 'use vars' is supposedly depreciated, so don't > > use it if your script depends on 5.6 features. Placing > > 'our' in a lexical scope probably makes it externally > > visible until you leave the scope, 'use vars' imports > > into your symbol table. Hope this is right :) > > That'

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Felix Geerinckx
on Sat, 11 May 2002 17:00:27 GMT, Jonathan e. paton wrote: > Note that 'use vars' is supposedly depreciated, so don't > use it if your script depends on 5.6 features. Placing > 'our' in a lexical scope probably makes it externally > visible until you leave the scope, 'use vars' imports > into yo

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Yes you can say > > > > our $opt_m; > > > > or > > > > use vars qw($opt_m); > > > > at the top of your program (depending on perl version). > > I've been preached the orthodoxy of the later - but > have never understood the distinction... > > Yes, have read coping with scoping. > > anyone h

Re: our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread Jonathan E. Paton
> > Yes you can say > > > > our $opt_m; > > > > or > > > > use vars qw($opt_m); > > > > at the top of your program (depending on perl version). > > I've been preached the orthodoxy of the later - but > have never understood the distinction... > > Yes, have read coping with scoping. > > anyone h

our v. use vars - wasRe: use Getopt::Std; and use strict;

2002-05-11 Thread drieux
On Friday, May 10, 2002, at 07:07 , Tanton Gibbs wrote: > Yes you can say > > our $opt_m; > > or > > use vars qw($opt_m); > > at the top of your program (depending on perl version). I've been preached the orthodoxy of the later - but have never understood the distinction... Yes, have read copi

Re: use Getopt::Std; and use strict;

2002-05-10 Thread John W. Krahn
Hans Holtan wrote: > > Hi everyone, > I have a problem using Getopt::Std. I depend on use strict for all my > code, and when I use Getopt::Std all the variables it creates (to > hold the command line option values) are flagged by strict because > they have not been scoped. I ge

Re: use Getopt::Std; and use strict;

2002-05-10 Thread Tanton Gibbs
Yes you can say our $opt_m; or use vars qw($opt_m); at the top of your program (depending on perl version). - Original Message - From: "Hans Holtan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 10, 2002 9:30 PM Subject: use Getopt::Std;

use Getopt::Std; and use strict;

2002-05-10 Thread Hans Holtan
Hi everyone, I have a problem using Getopt::Std. I depend on use strict for all my code, and when I use Getopt::Std all the variables it creates (to hold the command line option values) are flagged by strict because they have not been scoped. I get errors like this: Line 70: Global symbol

Re: getopt::std

2002-04-05 Thread Michael Lamertz
On Fri, Apr 05, 2002 at 04:05:13PM -0500, Michael Gargiullo wrote: > I'm on a Redhat 7.0 box with the default install of Perl. I want to use the > Getopt::std module, but it's not installed. I went to cpan.org and they > have the docs, but it looks like that module is suppo

getopt::std

2002-04-05 Thread Michael Gargiullo
I'm on a Redhat 7.0 box with the default install of Perl. I want to use the Getopt::std module, but it's not installed. I went to cpan.org and they have the docs, but it looks like that module is supposed to be installed with the perl executables, not as a seperate module. Any ide

Re: Getopt::Std problem

2001-12-16 Thread scarl-mitchell
> dan radom <[EMAIL PROTECTED]> said: > I'm having a problem with Getopt. If I pass the -p option the script uses the proxy >as it should. If i pass it -p -o it ignores the unless (exists($args{o})) and writes >to $outfile anyway. Any idea why it's doing that? You want to use getopts() and

Getopt::Std problem

2001-12-15 Thread dan radom
I'm having a problem with Getopt. If I pass the -p option the script uses the proxy as it should. If i pass it -p -o it ignores the unless (exists($args{o})) and writes to $outfile anyway. Any idea why it's doing that? dan use LWP::Simple; use Getopt::Std; getopt('o:p&

Getopt::Std question

2001-11-14 Thread CZachary
Hello, I've been trying to update a former coworkers perl code. But, I am new to perl. I am having trouble understanding the Getopt::Std module. I would like to add a fourth option to the code below, but I not sure how to add it and get it to work. Also I would like to know where I can

Re: use Getopt::Std question

2001-07-27 Thread Michael Fowler
On Thu, Jul 26, 2001 at 09:32:41PM -0700, Bob Bondi wrote: > Question: Is there a way to capture the case of bad flags? Getopt::Std already emits error messages when it encounters a flag it's not configured to deal with. You could try setting up a $SIG{__WARN__} handler. If Getopt

use Getopt::Std question

2001-07-26 Thread Bob Bondi
I really like this set of functions, very handy indeed. I've done this: my %opts = (); getopt('psuctfh', \%opts);#proxy serviceport url testclass testcase filename my $proxy = $opts{p}; my $serviceport = $opts{s}; my $thisurl = $opts{u}; my $testclass = $opts{c}; my $testcase = $opts{t}; my $this

Re: Using getopt::std return hash with value of 1 rather than argument

2001-07-05 Thread Craig Moynes/Markham/IBM
>The perldoc for getopt::std states: >Hash keys will be x (where x is the switch name) with key >values the value of the argument or 1 if no argument is >specified This is true for getopt, but not getopts. Getopts puts the parameter in the hash table (I am working on 5.005_03 b

Using getopt::std return hash with value of 1 rather than argument

2001-07-05 Thread charles
lect what you have above, the value for the key appears to be "1" rather than the actual argument specified on the command line. The perldoc for getopt::std states: Hash keys will be x (where x is the switch name) with key values the value of the

Re: Getopt::STD

2001-07-03 Thread Michael Fowler
On Tue, Jul 03, 2001 at 07:13:58PM -0500, [EMAIL PROTECTED] wrote: > I've read through > http://search.cpan.org/doc/JHI/perl-5.7.1/lib/Getopt/Std.pm I wouldn't suggest using this as your reference for core Perl modules. You should use perldoc on the command-line, or failing that, www.perldoc.com

Getopt::STD

2001-07-03 Thread charles
I've read through http://search.cpan.org/doc/JHI/perl-5.7.1/lib/Getopt/Std.pm and it seems as though the following syntax should work: getopt("nh",\%option); however, it does not. when i use getopts rather than getopt getopts("nh",\%option); it does work. did i misread the cpan page that i re