Re: No Such File Error on Simple Scrape

2006-05-22 Thread Jaime Murillo
On Monday 22 May 2006 14:49, [EMAIL PROTECTED] wrote: > When I execute the script below, I get the error message "No such file or > directory at simple2.pl line 21." Line 21 is the Open OUT statement. > This script parallels a tutorial script that does work and I don't see the > error. It does pr

Re: One liner to return unique IPs from web log?

2006-05-17 Thread Jaime Murillo
On Wednesday 17 May 2006 07:57, Zembower, Kevin wrote: > I'm trying to write a perl one-liner to return the unique IP addresses > from a Apache web log, like this: > > perl -ne 'print if s/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) .*/$1/' > access.log | nawk '!x[$0]++' > > I tried to combine it with th

Re: hash assignments

2006-05-15 Thread Jaime Murillo
On Monday 15 May 2006 14:40, Smith, Derek wrote: > I have this system output > > > > --- Logical volumes --- > > LV Name /dev/vg00/lvol1 > > VG Name /dev/vg00 > > > And I have this multiple lvols populated into 2 arrays like printed like > so: > > > > Mirr

Re: Chomp method

2006-04-26 Thread Jaime Murillo
On Wednesday 26 April 2006 22:51, AndrewMcHorney wrote: > Hello Hey Andrew > > I am wondering how the chomp function works. I am looking to see how > I can truncate new line and/or carriage returns from a string. Will > chomp do nothing if there are no carriage return or line feed at the > end. If

Re: deleting an element from an array

2006-04-22 Thread Jaime Murillo
On Saturday 22 April 2006 17:26, Johan Meskens CS3 jmcs3 wrote: > hello Hi Johan > > > i want to delete an element from an anonymous array in a hash with: > > delete ${$alltheworlds{ $d }}[$num]; > First type the command perldoc -f delete This explains why you are receiving the results you are

Re: print_r

2006-04-21 Thread Jaime Murillo
On Friday 21 April 2006 11:53, Charles K. Clarkson wrote: > BTW, I think indent() could be rewritten. I think these do > the same thing as your indent(). > > sub indent { > my $indent = shift; > return '' unless defined $indent; > return '' x $indent; > } > > # Or: > > sub inde

Re: Extracting a bit of a scalar variable

2006-04-21 Thread Jaime Murillo
On Friday 21 April 2006 10:15, Smith, Derek wrote: > -Original Message- > From: Smith, Derek > Sent: Friday, April 21, 2006 10:22 AM > To: Perl Beginners > Subject: RE: Extracting a bit of a scalar variable > > > Original Message- > From: Dr.Ruud [mailto:[EMAIL PROTECTED] > Sent: Fr

Re: How to redefine an autoload sub.

2006-04-16 Thread Jaime Murillo
On Thursday 13 April 2006 09:19, [EMAIL PROTECTED] wrote: > #!/usr/local/bin/perl > > write_function1("first"); > print auto_function(), "\n"; > # This will print: > # auto_function first > > write_function1("second"); > # How would I undefine the autoloaded version of auto_function? > print auto_f

Re: hash value and grep / get some files searched and indexed

2006-04-10 Thread Jaime Murillo
On Monday 10 April 2006 01:20, Alan_C wrote: > On Sunday 09 April 2006 19:34, John W. Krahn wrote: > > Alan_C wrote: > > > Hi. > > #!/usr/bin/perl -w > > use strict; > > > > my @search4 = @ARGV;# keywords > > > > @ARGV = glob 'xtst*'; > > my @lines; > > while ( <> ) { > > if ( s/^#:// ) {

Re: hash value and grep / get some files searched and indexed

2006-04-08 Thread Jaime Murillo
On Saturday 08 April 2006 01:08, Alan_C wrote: > On Friday 07 April 2006 03:34, John W. Krahn wrote: > > Alan_C wrote: > > > Hi, > > > > Hello, > > [ snip ] > > #!/usr/bin/perl -w > > use strict; > > > > @ARGV = glob 'xtst*'; > > > > my %data; > > > > while ( <> ) { > > my ( $key, @keywords )

Re: Very Basic Web Scrape

2006-04-07 Thread Jaime Murillo
On Friday 07 April 2006 13:15, [EMAIL PROTECTED] wrote: > I'm trying to learn web scraping and am stopped at the basic point of > scraping a portion > of a web page. I'm able to scrape a full page and save it as *.xml or > *.htm, and I think > I understand regex, but the following fails: > > > ***

Re: Help Required on the Script

2006-04-05 Thread Jaime Murillo
On Tuesday 04 April 2006 23:46, Mazhar wrote: > Hi Guyz, Hi Mazhar, > i am writin a script to automate the command snmpwalk by > reading the contents of a file. Below is the snippet > > $file_name="somefile.txt"; > > open(FILE,"< $file_name"); > > while() > { > my $ip; >

Re: loop until empty string

2006-03-23 Thread Jaime Murillo
On Thursday 23 March 2006 15:51, Christopher Spears wrote: > I've been reading the Intermediate Perl book and am > trying to solve one of the exercises. I wrote a > script that takes input from the keyboard and uses the > input as a regular expression to search for files in a > directory. If the