Re: Retrieving Bit-Field/Hex-String with Perl/Net-SNMP

2009-01-05 Thread Peter Daum
Again: this is _not_ referring to the "Net::SNMP" module (http://search.cpan.org/~dtown/Net-SNMP-5.2.0/lib/Net/SNMP.pm) but to Net-SNMP (the corresponding Perl module is just "SNMP") (http://net-snmp.sourceforge.net/docs/perl-SNMP-README.html) (The similar names certainly cause lots of confusion

Re: RegExp Searching within

2009-01-05 Thread Randal L. Schwartz
> "Paul" == Paul M writes: Paul> Note: It is seriously Paul> MALFORMED XML That's a nonsense phrase, like "somewhat pregnant". It's either XML, or it isn't. And if it isn't, get after the vendor for spewing angle-bracketish stuff at you. -- Randal L. Schwartz - Stonehenge Consulting Serv

Re: Send email using smtp

2009-01-05 Thread Rob Dixon
Fúlvio wrote: > > I am trying to send an email using the following code: > > use Net::SMTP; > > $smtp = Net::SMTP->new("smtp.yahoo.com"); > $smtp->mail('fulviocg'); > > but the error below is happening: > > Can't call method "mail" on an undefined value at > > Can someone help me? The d

Re: Send email using smtp

2009-01-05 Thread Jenda Krynicky
From: Fúlvio > Hi all, > > I am trying to send an email using the following code: > > use Net::SMTP; > > $smtp = Net::SMTP->new("smtp.yahoo.com"); > $smtp->mail('fulviocg'); > > but the error below is happening: > > Can't call method "mail" on an undefined value at Apparently the Net::SMTP->

Re: Send email using smtp

2009-01-05 Thread Octavian Rasnita
From: "Fúlvio" Hi all, I am trying to send an email using the following code: use Net::SMTP; $smtp = Net::SMTP->new("smtp.yahoo.com"); $smtp->mail('fulviocg'); but the error below is happening: Can't call method "mail" on an undefined value at Can someone help me? Hi, Can you use Yah

Send email using smtp

2009-01-05 Thread Fúlvio
Hi all, I am trying to send an email using the following code: use Net::SMTP; $smtp = Net::SMTP->new("smtp.yahoo.com"); $smtp->mail('fulviocg'); but the error below is happening: Can't call method "mail" on an undefined value at Can someone help me? Thanks Fúlvio -- To unsubscribe, e

Re: RegExp Searching within

2009-01-05 Thread Jenda Krynicky
From: Paul M > Hi: > > Given the following list: > > > > > > > > I  want to know all the "elements" within elem1. (Note: It is > seriously MALFORMED XML, that is why I am attempting to use regexp). It's hard to say, but it might be easier to fix the XML and then use normal XML tools. Beside

Re: RegExp Searching within

2009-01-05 Thread Paul M
Indeed. #!/usr/bin/perl use strict; use warnings; my $line = "a < bade1 < bad b1 > badcb2e2"; my @insides = $line =~ m{ \ (.*?) \<\/elem1\> }gmsx; for my $inside ( @insides ){      while( $inside =~ m{ \G \<([^>^\s]*)\>[^<]* }gmsx ){      my $element = $1;     #  unless( $element

Re: RegExp Searching within

2009-01-05 Thread Mr. Shawn H. Corey
On Mon, 2009-01-05 at 08:17 -0800, Paul M wrote: > If it were true XML, I would say all children's Node Names. > so: > > You mean all the descendants. The children of elem1 are elema and elemb. The descendants of elem1 are elema, elemb, and elemc. #!/usr/bin/perl use strict; use warnings

Re: Retrieving Bit-Field/Hex-String with Perl/Net-SNMP

2009-01-05 Thread Rob Dixon
Peter Daum wrote: > > I am trying to retrieve a bit vector containing the error status of > a printer with the Net-SNMP module. > > With the command line snmpget program, this works: > > # snmpget -v1 -cpublic printer .1.3.6.1.2.1.25.3.5.1.2.1 > HOST-RESOURCES-MIB::hrPrinterDetectedErrorState.1

Re: RegExp Searching within

2009-01-05 Thread Paul M
If it were true XML,  I would say all children's Node Names. so: --- On Mon, 1/5/09, Mr. Shawn H. Corey wrote: From: Mr. Shawn H. Corey Subject: Re: RegExp Searching within To: pjm...@yahoo.com Cc: beginners@perl.org Date: Monday, January 5, 2009, 8:10 AM On Mon, 2009-01-05 at 08:02 -0800,

Re: RegExp Searching within

2009-01-05 Thread Mr. Shawn H. Corey
On Mon, 2009-01-05 at 08:02 -0800, Paul M wrote: > I want to know all the "elements" within elem1. (Note: It is > seriously MALFORMED XML, that is why I am attempting to use regexp). Do you want to know all the children or all the descendants? -- Just my 0.0002 million dollars worth, Sha

RegExp Searching within

2009-01-05 Thread Paul M
Hi: Given the following list: I  want to know all the "elements" within elem1. (Note: It is seriously MALFORMED XML, that is why I am attempting to use regexp). Any ideas. I can get $1 equal to contents of elem1. But after that, somewhat lost.  perl -e '$line = ""; $line =~/(.*)<\/elem

Retrieving Bit-Field/Hex-String with Perl/Net-SNMP

2009-01-05 Thread Peter Daum
Hi, I am trying to retrieve a bit vector containing the error status of a printer with the Net-SNMP module. With the command line snmpget program, this works: # snmpget -v1 -cpublic printer .1.3.6.1.2.1.25.3.5.1.2.1 HOST-RESOURCES-MIB::hrPrinterDetectedErrorState.1 = Hex-STRING: 00 With the Ne