Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Mr. Shawn H. Corey wrote: On Mon, 2008-08-04 at 20:47 -0400, Mr. Shawn H. Corey wrote: On Tue, 2008-08-05 at 01:33 +0200, rafailowski wrote: Yes, without argument, the error is normal : $ perl test.pl Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLo

iterating over m//g matches and capturing groups

2008-08-04 Thread Mike C
I'd like to iterate over each of a m//g style regex's FULL matches, even though it contains capturing groups. Then, for each FULL match, I'd like to examine the capturing groups that are local to that match. The thing I'm struggling with is that, while it's easy to iterate over full matches when

Re: Net::Telnet

2008-08-04 Thread aditya
Hi, If I am getting you right means you want to display on Console. for that use this. ---CODE--- my $telnet = Net::Telnet->new(HOST); $telnet->login(USER,PASS) my @display = $telnet ->cmd('ls -l'); print @display; --Code-- On Aug 4, 7:47 am, [EMAIL PROTECTED] (Hashmat Khan

Re: Net::Telnet

2008-08-04 Thread aditya
Hi Hashmat, If I am getting you correclty then use this: CODE- $telnet = Net::Telnet->new(HOST); $telnet->login(USER,PASS) @display = $telnet ->cmd('ls -l'); print @display; CODE On Aug 4, 11:33 am, [EMAIL PROTECTED] (Jm) wrote: > IO::Tee allows STDOUT as o

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Rob Dixon wrote: rafailowski wrote: I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 level => $cmd_args_ref->{"log_level"} is always u

Re: Substitution within an html page

2008-08-04 Thread Amit Saxena
On Sat, Aug 2, 2008 at 3:12 AM, David Allender <[EMAIL PROTECTED]> wrote: > Hello all, > > I've been trying multiple different ways, but I am still unable to > have the output that i am looking for. > > What I'm trying to do is change certain text in an html file. How > would i go about doing tha

DBI equivalent of Oraperl ora_titles function !

2008-08-04 Thread Amit Saxena
Hi all, What's the DBI equivalent of Oraperl ora_titles function ? I need it because I want to get the titles (column names) of a select query into an array without fetching the row values from the database. Thanks & Regards, Amit Saxena

Re: matching ipaddress/netmask lines

2008-08-04 Thread John W. Krahn
Noah wrote: Okay, Hello, I need a bit of help here. OK, I'll try. there are thousands of lines in some files. True. I am trying to match the lines that have "address\s/" and save the IP to $loopback except if "lines" implies that the pattern can be found in more than one line? th

Re: Net::Telnet

2008-08-04 Thread Rob Dixon
John W. Krahn wrote: > Rob Dixon wrote: >> Hashmat Khan wrote: >>> Has anybody used Telnet ? >>> >>> I want to know, how can we redirect the output to STDOUT instead of >>> log file ? (Dump_Log => "dump.txt") >> It's important to tell us exactly what module you're using. > > See the Subject line

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
On Mon, 2008-08-04 at 20:47 -0400, Mr. Shawn H. Corey wrote: > On Tue, 2008-08-05 at 01:33 +0200, rafailowski wrote: > > Yes, without argument, the error is normal : > > > > $ perl test.pl > > Use of uninitialized value in hash element at > > /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57. >

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Rob Dixon
rafailowski wrote: > > I have a problem with Getopt::Long and Log::StdLog. > > An example script, i always have the following error : > Use of uninitialized value in hash element at > /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 > > level => $cmd_args_ref->{"log_level"} is always undef(??

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
On Tue, 2008-08-05 at 01:33 +0200, rafailowski wrote: > Yes, without argument, the error is normal : > > $ perl test.pl > Use of uninitialized value in hash element at > /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57. > Use of uninitialized value in string at test.pl line 25. > > But with an

Re: Net::Telnet

2008-08-04 Thread John W. Krahn
Rob Dixon wrote: Hashmat Khan wrote: Has anybody used Telnet ? I want to know, how can we redirect the output to STDOUT instead of log file ? (Dump_Log => "dump.txt") It's important to tell us exactly what module you're using. See the Subject line. :-) John -- Perl isn't a toolbox, but

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Mr. Shawn H. Corey wrote: On Tue, 2008-08-05 at 01:05 +0200, rafailowski wrote: Hi all, I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line 5

Re: Net::Telnet

2008-08-04 Thread Rob Dixon
Hashmat Khan wrote: > > Has anybody used Telnet ? > > I want to know, how can we redirect the output to STDOUT instead of > log file ? (Dump_Log => "dump.txt") It's important to tell us exactly what module you're using. Telnet is a comms protocol but I don't think you mean that. There is no P

Re: Getopt::Long and Log::StdLog problem

2008-08-04 Thread Mr. Shawn H. Corey
On Tue, 2008-08-05 at 01:05 +0200, rafailowski wrote: > Hi all, > > I have a problem with Getopt::Long and Log::StdLog. > > An example script, i always have the following error : > Use of uninitialized value in hash element at > /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 > > level => $c

Re: reformatting excel files

2008-08-04 Thread Rob Dixon
minky arora wrote: > Hi Gurus, > I need some sugegstions as to how to go about doing the following. > > I have a huge excel file and a file map associated with it, which says how > the excel sheet is to be formatted. For instance, a set of 96 cells which > are named "A" , need to be entered below

Re: Struggling with a regex

2008-08-04 Thread John W. Krahn
Tom Yarrish wrote: Hey all, Hello, I'm trying to pull some machine names out of a CSV file, and I'm using the Pattern Test Program from Learning Perl 4th ed, but I don't think I have the logic right. Here's a sample line from the CSV file: TAP0SMITHJ | smithj (192.168.1.1),DOMAIN | Profe

Re: Struggling with a regex

2008-08-04 Thread Mr. Shawn H. Corey
On Mon, 2008-08-04 at 16:28 -0500, Tom Yarrish wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hey all, > I'm trying to pull some machine names out of a CSV file, and I'm using > the Pattern Test Program from Learning Perl 4th ed, but I don't think > I have the logic right. Here'

Struggling with a regex

2008-08-04 Thread Tom Yarrish
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey all, I'm trying to pull some machine names out of a CSV file, and I'm using the Pattern Test Program from Learning Perl 4th ed, but I don't think I have the logic right. Here's a sample line from the CSV file: TAP0SMITHJ | smithj (192.168.1

Getopt::Long and Log::StdLog problem

2008-08-04 Thread rafailowski
Hi all, I have a problem with Getopt::Long and Log::StdLog. An example script, i always have the following error : Use of uninitialized value in hash element at /usr/local/share/perl/5.10.0/Log/StdLog.pm line 57 level => $cmd_args_ref->{"log_level"} is always undef(???) but print $cmd_args_re

Re: slightly OT -- launching script in iTerm.app or Terminal.app

2008-08-04 Thread David Newman
On 8/4/08 4:09 AM, Rodrick Brown wrote: On Mon, Aug 4, 2008 at 12:33 AM, David Newman <[EMAIL PROTECTED] > wrote: How to launch a perl script when starting iTerm.app or Terminal.app in OS X? Thanks in advance and apologies for the slightly OT post.

Re: Net::Telnet

2008-08-04 Thread jm
IO::Tee allows STDOUT as one of your output options On Mon, Aug 4, 2008 at 9:47 AM, Hashmat Khan <[EMAIL PROTECTED]> wrote: > Hi, > > Has anybody used Telnet ? > > I want to know, how can we redirect the output to STDOUT instead of > log file ? (Dump_Log => "dump.txt") > > thanks, > Hashmat > >

Dynamic perl 5.10.0 fails on make test

2008-08-04 Thread Randall Perry
Trying to install perl 5.10.0 on Mac OS 10 Server 10.4.11. Config command used is: ./configure -Duseshrplib -Dprefix=/opt/local2 Make test can't seem to locate symbols in the libs, though I've confirmed the lib files are in the place it's looking for them, and that the symbols are present. Her

Net::Telnet

2008-08-04 Thread Hashmat Khan
Hi, Has anybody used Telnet ? I want to know, how can we redirect the output to STDOUT instead of log file ? (Dump_Log => "dump.txt") thanks, Hashmat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Question on regexp grouping/capturing

2008-08-04 Thread op
shawnhcorey wrote: [...] > Note that because of its level of precedence, the >alteration applies to the whole pattern so $2 and $3 are undef when >'lang' is matched. [...] Ok, so my problem was actually getting the precedence of the '|'- operator wrong. So /(lang)|(id)="(\S+)"/g translates to :

matching ipaddress/netmask lines

2008-08-04 Thread Noah
Okay, I need a bit of help here. there are thousands of lines in some files. I am trying to match the lines that have "address\s/" and save the IP to $loopback except if the IP address/netmask is "127.0.0.1/32". --- code snipet my $ipaddressNetmask = qr/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,

reformatting excel files

2008-08-04 Thread minky arora
Hi Gurus, I need some sugegstions as to how to go about doing the following. I have a huge excel file and a file map associated with it, which says how the excel sheet is to be formatted. For instance, a set of 96 cells which are named "A" , need to be entered below a set of 96 cells named "B" ("B

Re: Question on regexp grouping/capturing

2008-08-04 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > > Perl captures on a strict left-to-right policy. Start at the left of > the regular expression and every opening parenthesis will be captured in > the next numbered variable. For your first example: > > /(lang)|(id)="(\S+)"/g >^ ^ ^ >$1 $2

Re: Question on regexp grouping/capturing

2008-08-04 Thread John W. Krahn
op wrote: Hello, Hello, I thought I had understood regular expression grouping relatively well, untill I ran into the following behavior: perl -e ' my $string = ""; while ($string =~ /(lang)|(id)="(\S+)"/g) { print "\$1->|$1|, \$2->|$2|, \$3->|$3|\n"; } ' outputs: $1->||, $2->|id|, $3->|do

Re: Array always compares equal

2008-08-04 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Sat, 2008-08-02 at 06:31 -0700, hsfrey wrote: I'm trying to set up a list of words to ignore in a text. I tried it like this: my @ignore = ("U.S.C", "Corp", "Miss", "Conf", "Cong"); and later in a loop if ( $exists $ignore [$lastWord] ) { next;} But that tested p

Re: Question on regexp grouping/capturing

2008-08-04 Thread Mr. Shawn H. Corey
On Mon, 2008-08-04 at 03:28 -0700, op wrote: > Hello, > I thought I had understood regular expression grouping relatively > well, untill I ran into the following behavior: > > perl -e ' > my $string = " lang=\"hindi\">"; > while ($string =~ /(lang)|(id)="(\S+)"/g) { > print "\$1->|$1|, \$2->|$2|

Question on regexp grouping/capturing

2008-08-04 Thread op
Hello, I thought I had understood regular expression grouping relatively well, untill I ran into the following behavior: perl -e ' my $string = ""; while ($string =~ /(lang)|(id)="(\S+)"/g) { print "\$1->|$1|, \$2->|$2|, \$3->|$3|\n"; } ' outputs: $1->||, $2->|id|, $3->|dontcare| $1->|lang|, $2-

Re: slightly OT -- launching script in iTerm.app or Terminal.app

2008-08-04 Thread Rodrick Brown
On Mon, Aug 4, 2008 at 12:33 AM, David Newman <[EMAIL PROTECTED]>wrote: > How to launch a perl script when starting iTerm.app or Terminal.app in OS > X? > > Thanks in advance and apologies for the slightly OT post. > > dn > Under preferences->startup tab in Terminal.app you can have it launch a s