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
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
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
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
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
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
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
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__
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
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
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
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
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/
> 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
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
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;
).
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/&
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
> 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
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
>
>
> > 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
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
> 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
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
"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]
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
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
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:
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
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
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
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
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
> -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
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
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
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
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
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:
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
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
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
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
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
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
> > 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'
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
> > 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
> > 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
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
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
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;
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
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
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
> 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
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&
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
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
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
>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
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
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
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
64 matches
Mail list logo