Re: Substitute Regex with 'e'

2005-02-15 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Hi Hello, I want to so a substititue a string Say my %hash = ( 1130, "a" , 2100, "b"); $x = 'SOMEJUNK 1130'; # I want $x to be'1130a' # This regex does not work $x=~s/^(.*?) (\d+)/ $2 . { defined $hash{$2} ? $hash{$2} : 'NOTFOUN

How to remove CPAN Modules

2005-02-15 Thread Aryldo G Russo Jr
Hi, this is my first message to this list, and I will begin with a problem (as a matter of fact until now the only thing I have are problems, hehe) IÂm trying to install bugzilla in my server and one of the steps I have to follow is install some CPAN modules. so far so good. the problem is th

linking perl two programms

2005-02-15 Thread E.Horn
Hello! Perhaps someone can help me! Is there the possibility to link one programm to another perl programm?so that on click the link and the next programm starts? Example: print ""; print " Hello"; print ""; print ""; print "Suche:$search"; print ""; ??? . Regards

Re: linking perl two programms

2005-02-15 Thread Ricardo SIGNES
* "E.Horn" <[EMAIL PROTECTED]> [2005-02-15T07:11:59] > Perhaps someone can help me! > Is there the possibility to link one programm to another perl > programm?so that on click the link and the next programm starts? > Example: > print ""; > print " Hello"; > print ""; > print ""; > print "Such

RE: Start reading from a specific line

2005-02-15 Thread DBSMITH
oops I missed a line: my $linect="$."; while ( ) { if ( $linect > 9 ) { do whatever ... } $linect++; } need to use double-quotes around variable $. thanks for the correction... keeps me on my perl learning toes. Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams

Re: hash speed

2005-02-15 Thread Wiggins d'Anconia
Please bottom post, and reply-all so that everyone can help and be helped. Nope. That's a here are the tools that you should be able to determine on your own which is faster. " teach a man to fish " http://danconia.org Ken Gillett wrote: That's a no then? On 14 Feb 2005, at 15:00, Wiggins

RE: Start reading from a specific line

2005-02-15 Thread Jeff 'japhy' Pinyan
On Feb 15, [EMAIL PROTECTED] said: my $linect="$."; while ( ) { if ( $linect > 9 ) { do whatever ... } $linect++; } need to use double-quotes around variable $. No you don't. my $linecount = $.; works just fine. And is there a reason you don't want to use $.? That is, why cr

Re: Start reading from a specific line

2005-02-15 Thread Eduardo Vázquez Rodríguez
I know that programming is not one of my best skills, but this code works for me, your help is very appreciate open(INPUT, $file) or die "Can't read from file: $! $file"; # Where we "move" the pointer to line number 10 $. = 0; do { $_ = } until $. == 10; wh

Unencrypted Password Files

2005-02-15 Thread John Baker
Greetings fellow perl lovers. I recently became the de facto sys admin at work, a responsibility that includes ensuring that the 10 or so machines we need are as secure as possible. These machines are used by three other peer groups. One of which has been writing scripts that pull data from u

RE: Start reading from a specific line

2005-02-15 Thread DBSMITH
you are correct, you do not need " " around $. thank you! I was using strict and warnings, but must of had another error. I am unfamiliar with the variable $.? I tried playing with it, but was unsuccessful. I could not find it in cookbook nor in programming perl. linect=$. linect=1; while ( )

Re: Start reading from a specific line

2005-02-15 Thread Jeff 'japhy' Pinyan
On Feb 15, Eduardo Vázquez Rodríguez said: open(INPUT, $file) or die "Can't read from file: $! $file"; # Where we "move" the pointer to line number 10 $. = 0; You don't need to initialize $. to 0. It's a magical variable that holds the right value. -- Jeff "japhy" Pinyan % How can

RE: Start reading from a specific line

2005-02-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > you are correct, you do not need " " around $. > thank you! > I was using strict and warnings, but must of had another error. > I am unfamiliar with the variable $.? I tried playing with it, but > was unsuccessful. I could not find it in cookbook nor in programming > pe

RE: Start reading from a specific line

2005-02-15 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > you are correct, you do not need " " around $. > thank you! > I was using strict and warnings, but must of had another error. > I am unfamiliar with the variable $.? I tried playing with it, but > was unsuccessful. I could not find it in cookbook nor in programming > per

RE: Start reading from a specific line

2005-02-15 Thread DBSMITH
Could not find this variable in perlvar under 5.8.0 for sun solaris can you explain it? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams "Jenda Krynicky"

RE: Start reading from a specific line

2005-02-15 Thread Jeff 'japhy' Pinyan
On Feb 15, [EMAIL PROTECTED] said: Could not find this variable in perlvar under 5.8.0 for sun solaris can you explain it? perlmonk:~ 101:$ perldoc perlvar ... $. Current line number for the last filehandle accessed. Each filehandle in Perl counts the number of lines that have

perl-shared/

2005-02-15 Thread deny
good afternoon all i ve a problem when i try compiling rddtool make[3]: Entering directory `/usr/local/rrdtool-1.0.49/perl-shared' make[3]: *** Pas de règle pour fabriquer la cible « /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/EXTERN.h », nécessaire pour « RRDs.o ». Arrêt. a have perl, v5

Effective Perl Programming - Still valid, dated 1998?

2005-02-15 Thread Gavin Henry
Dear all, I like the look of this book and I wanted to know if it is still valid for today's Perl: http://www.amazon.co.uk/exec/obidos/ASIN/0201419750/ref=ase_stonehengeconsul/026-0149589-0073218 I suppose certain parts of Perl, i.e. the fundamentals don't change, so it is probably worth it. M

RE: Start reading from a specific line

2005-02-15 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > Could not find this variable in perlvar under 5.8.0 for sun solaris > can you explain it? > > Derek B. Smith No. It has always been there since I can remember. (Perl 5.001 I think, definitely Perl 5.003) Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =

Re: hash speed

2005-02-15 Thread Jay
On Tue, 15 Feb 2005 09:48:23 -0500, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > Please bottom post, and reply-all so that everyone can help and be helped. > > Nope. That's a here are the tools that you should be able to determine > on your own which is faster. " teach a man to fish " >

/$RE{URI}{HTTP}{-keep}/;

2005-02-15 Thread Brian Volk
Hi All, I have a list of text files, some contain url's and some don't. I'm trying to extract the url's and print only the url to a new file w/ the same name in a new directory. I think I'm close, but the new files are empty.. If someone could please take a look and let me know what I'm doin

Re: /$RE{URI}{HTTP}{-keep}/;

2005-02-15 Thread EWALKER 1016705
On Tuesday 15 February 2005 11:06 am, Brian Volk wrote: > #!/usr/bin/perl >   > use warnings; > use strict; > use Cwd; > use File::Basename; > use Regexp::Common qw /URI/; >   > my $dir = "C:/brian/small"; >  opendir (SM, $dir) or die "Can't open $dir: $!"; >   > my @files = map { "$dir/$_" } grep

RE: Start reading from a specific line

2005-02-15 Thread Graeme St. Clair
Well, it is, you know. In my 3rd Edn, July 2000 printing, it's indexed about half way down the left column on p1011, where it is also described as $INPUT_LINE_NUMBER. Admittedly, the first reference (to p103) is off, as some refs are in this edn. But it's only just over onto p104. And p665 (cor

RE: Start reading from a specific line

2005-02-15 Thread DBSMITH
Yes there was some mis-communication as I thought he was referring to variable $.? as opposed to $. Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 "Graeme St.

Re: Start reading from a specific line

2005-02-15 Thread John W. Krahn
Jenda Krynicky wrote: From: [EMAIL PROTECTED] Could not find this variable in perlvar under 5.8.0 for sun solaris can you explain it? No. It has always been there since I can remember. (Perl 5.001 I think, definitely Perl 5.003) It has been there since Perl verion 1.0 but back then it was readonly

getting +*-/ from $operator= in print

2005-02-15 Thread Oliver Fuchs
Hi, I am a very beginner to perl so may be this question is stupid or too low leveled then please ignore. I tried to wright a little calculator in perl - nothing difficult - very simple: #!/usr/bin/perl -w print "First value: "; chomp ($value1=); print "Second value: "; chomp ($value2=); print "

Re: Start reading from a specific line

2005-02-15 Thread John W. Krahn
Jeff 'japhy' Pinyan wrote: On Feb 15, Eduardo Vázquez Rodríguez said: open(INPUT, $file) or die "Can't read from file: $! $file"; # Where we "move" the pointer to line number 10 $. = 0; You don't need to initialize $. to 0. It's a magical variable that holds the right value. That depends.

Request for regex: Strip last dash in a record

2005-02-15 Thread Peter_Farrar
Hi All, The code below does what I want to do, but it takes 3 lines and a temporary array (yuck). I can't come up with a one line regex substitution. Anyone got one? my $tmp = reverse split //, $_; $tmp =~ s/-//; $_ = reverse split //, $tmp; TIA, Peter ** CONFIDENTIALITY NOTICE ** N

Re: getting +*-/ from $operator= in print

2005-02-15 Thread Ankur Gupta
print "First value: "; chomp ($value1=; print "Second Value: "; chomp ($value2=; print "Operator: "; chomp ($value3=; print ($value1 $value3 $value2, "\n"); But that was malfaunctioning. Is there a way to put the STDIN for the operator directly in the print line or do I always have to keep it that

snmp requests

2005-02-15 Thread DBSMITH
All, to get the number of interfaces via a snmp call from a perl program I would say: get_request("1.3.6.1.2.1.2.1.0"); After referencing the MIB, I can follow the path to interfaces, but I get lost at 0 as there is no 0 on the MIB map. Is there another map? BEGIN - - - - - - - - iso 0 org3 do

snmp requests CORRECTED!

2005-02-15 Thread DBSMITH
All, to get the number of interfaces via a snmp call from a perl program I would say: get_request("1.3.6.1.2.1.2.1.0"); After referencing the MIB, I can follow the path to interfaces, but I get lost at 0 as there is no 0 on the MIB map. Is there another map? BEGIN - - - - - - - - iso 1 org 3 d

Re: getting +*-/ from $operator= in print

2005-02-15 Thread John W. Krahn
Oliver Fuchs wrote: Hi, Hello, I am a very beginner to perl so may be this question is stupid or too low leveled then please ignore. I tried to wright a little calculator in perl - nothing difficult - very simple: #!/usr/bin/perl -w print "First value: "; chomp ($value1=); print "Second value: "; c

Re: Request for regex: Strip last dash in a record

2005-02-15 Thread Peter_Farrar
>[EMAIL PROTECTED] wrote: > >>Hi All, >> >>The code below does what I want to do, but it takes 3 lines and a temporary >>array (yuck). I can't come up with a one line regex substitution. Anyone >>got one? >> >>my $tmp = reverse split //, $_; >>$tmp =~ s/-//; >>$_ = reverse split //, $tmp; > >can

Re: Request for regex: Strip last dash in a record

2005-02-15 Thread Ankur Gupta
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi All, The code below does what I want to do, but it takes 3 lines and a temporary array (yuck). I can't come up with a one line regex substitution. Anyone got one? my $tmp = reverse split //, $_; $tmp =~ s/-//; $_ = rever

RE: Request for regex: Strip last dash in a record

2005-02-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >> >>> Hi All, >>> >>> The code below does what I want to do, but it takes 3 lines and a >>> temporary array (yuck). I can't come up with a one line regex >>> substitution. Anyone got one? >>> >>> my $tmp = reverse split //, $_; >>> $tmp =~

RE: /$RE{URI}{HTTP}{-keep}/;

2005-02-15 Thread Brian Volk
> -Original Message- > From: EWALKER 1016705 [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 2:20 PM > To: beginners@perl.org > Cc: Brian Volk > Subject: Re: /$RE{URI}{HTTP}{-keep}/; > > > On Tuesday 15 February 2005 11:06 am, Brian Volk wrote: > > #!/usr/bin/perl > >   > > u

Re: /$RE{URI}{HTTP}{-keep}/;

2005-02-15 Thread Shiping Wang
At 12:19 PM 2/15/2005 -0700, EWALKER 1016705 wrote: On Tuesday 15 February 2005 11:06 am, Brian Volk wrote: > #!/usr/bin/perl > > use warnings; > use strict; > use Cwd; > use File::Basename; > use Regexp::Common qw /URI/; > > my $dir = "C:/brian/small"; > opendir (SM, $dir) or die "Can't open $dir

Re: Request for regex: Strip last dash in a record

2005-02-15 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi All, Hello, The code below does what I want to do, but it takes 3 lines and a temporary array (yuck). It does? Could you please explain what exactly you want to do? Just going by your subject line, this will work (assuming $_ contains the data.) s/(.*)-/$1/; I can't c

RE: snmp requests CORRECTED!

2005-02-15 Thread Tyson Sommer
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 3:52 PM > To: 'Perl Beginners ' > Subject: snmp requests CORRECTED! > > > All, > > to get the number of interfaces via a snmp call from a perl > program I would > say: > > ge

Re: Request for regex: Strip last dash in a record

2005-02-15 Thread Peter_Farrar
> >If you just want to remove the last occuring '-' character, then the >following would work. > >s/(.*)-(.*)/$1$2/; Well, huh. That does work. Though it reminds me only of how little I understand why. Thanks, you've made it look easy. ** CONFIDENTIALITY NOTICE ** NOTICE: This e-m

Re: /$RE{URI}{HTTP}{-keep}/;

2005-02-15 Thread Brian Volk
Shiping Wang wrote: At 12:19 PM 2/15/2005 -0700, EWALKER 1016705 wrote: On Tuesday 15 February 2005 11:06 am, Brian Volk wrote: > #!/usr/bin/perl > > use warnings; > use strict; > use Cwd; > use File::Basename; > use Regexp::Common qw /URI/; > > my $dir = "C:/brian/small"; > opendir (SM, $dir) or

Re: Request for regex: Strip last dash in a record

2005-02-15 Thread Ken Simon
[EMAIL PROTECTED] wrote: If you just want to remove the last occuring '-' character, then the following would work. s/(.*)-(.*)/$1$2/; Well, huh. That does work. Though it reminds me only of how little I understand why. Thanks, you've made it look easy. His regex works because perl uses greedy

Re: Effective Perl Programming - Still valid, dated 1998?

2005-02-15 Thread Randal L. Schwartz
> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: Gavin> I suppose certain parts of Perl, i.e. the fundamentals don't Gavin> change, so it is probably worth it. There are definitely some timeless parts, but there are also some parts that have better solutions now. Gavin> Should I buy this

Re: Effective Perl Programming - Still valid, dated 1998?

2005-02-15 Thread Pablo Wolter
Hi, I have a stupid question to you guys; I need to install Net::Ftp module on a solaris production machine and feeling insecure to screw up the system installing the wrong one. How can I now wich module version to install? I do that all the time on my linux machine, but this time is a productio

Class::MethodMaker Query

2005-02-15 Thread Siddharth Uppal
Hi, Since yesterday I've been scratching my head over the different behavior of the two pieces of codes listed under "listing-1" and "listing-2", because I expect the two to behave in a similar manner. --start listing-1--- package Foo; use strict; use warning