RE: match pattern

2009-09-19 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: raphael() [mailto:raphael.j...@gmail.com] > Sent: Friday, September 18, 2009 10:40 > To: Perl BEGIN > Subject: match pattern > > Hi > > How do I pick out matching words if there are more than one > on the same > line? > > > Example > > INFILE.TXT > > www

Re: push and split

2009-09-19 Thread Dr.Ruud
Noah Garrett Wallach wrote: I am attempting to read a text file in to two array variables. --- text file --- hostname1 ip1 hostname2 ip2 --- text file --- so basically I would like to have the items in column become an the elements of an array @routers and then the items in column two in

Re: push and split

2009-09-19 Thread Chas. Owens
On Fri, Sep 18, 2009 at 22:06, Dr.Ruud wrote: > Noah Garrett Wallach wrote: > >> I am attempting to read a text file in to two array variables. >> >> --- text file --- >> hostname1 ip1 >> hostname2 ip2 >> >> --- text file --- >> >> >> so basically I would like to have the items in column become an

Re: push and split

2009-09-19 Thread Shawn H Corey
Chas. Owens wrote: On Fri, Sep 18, 2009 at 22:06, Dr.Ruud wrote: Noah Garrett Wallach wrote: Parallel arrays are bad, use an AoA. snip An Aardvark of Action? No, those are best used for signal processing. Oh, wait, you mean an [Array of Arrays][1]. And I thought it was Annoying, Obnoxious

typical errors beginners make

2009-09-19 Thread Gabor Szabo
Hi, there are a bunch of errors that beginners make a lot and that perl does not catch or that the given error message is too generic. use warning; == In my perl training classes the first thing I teach is to use strict; and use warnings; For some reason - maybe because my students are

Re: typical errors beginners make

2009-09-19 Thread Jenda Krynicky
From: Gabor Szabo > For some reason - maybe because my students are not English speakers - > many of them type > > use warning; > > Which gives them the following error: > > Can't locate warning.pm in @INC (@INC contains: > /home/gabor/perl5lib/lib/perl5/site_perl/5.10.0/i486-

Re: matching multi occurrences or nothing

2009-09-19 Thread John W. Krahn
Noah Garrett Wallach wrote: Hi there Perl folks, Hello, Okay I am trying to figure this out. I am trying to match the following: $line = "blah&blah&blah" so I have the following line to match that $line =~ /((?:blah).*?){0,5}/; But I want to capture "blah" in a variable like $capture =