[28306] in Perl-Users-Digest
Perl-Users Digest, Issue: 9670 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 31 14:06:59 2006
Date: Thu, 31 Aug 2006 11:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 31 Aug 2006 Volume: 10 Number: 9670
Today's topics:
(Off topic) Cyberwar question <skybuck2000@hotmail.com>
Re: (Off topic) Cyberwar question <uri@stemsystems.com>
Re: 1 string from 3, making replacements more perlish <bik.mido@tiscalinet.it>
Re: Can overloaded '+' return an array? If so, how? <shenkin@gmail.com>
Re: Can overloaded '+' return an array? If so, how? xhoster@gmail.com
diff file in Perl? <zhushenli@gmail.com>
Re: diff file in Perl? <mritty@gmail.com>
Re: diff file in Perl? <bik.mido@tiscalinet.it>
Re: FAQ 6.22 How can I match strings with multibyte cha <brian.d.foy@gmail.com>
Re: Hi Guys ! <bik.mido@tiscalinet.it>
Re: Hi Guys ! <bik.mido@tiscalinet.it>
Re: Hi Guys ! <sbryce@scottbryce.com>
Re: Hi Guys ! <cwilbur@mithril.chromatico.net>
Re: Net-SNMP, community !~ public, JBOSS-4.0.4.GA <m.REMOVEbetti@REMOVElibero.it>
Re: New Group Cgi:Perl <bik.mido@tiscalinet.it>
Re: New Group Cgi:Perl <rajeshmvj@gmail.com>
Re: New Group Cgi:Perl <David.Squire@no.spam.from.here.au>
Re: New Group Cgi:Perl <jurgenex@hotmail.com>
SNMP module to query net-snmp <m.REMOVEbetti@REMOVElibero.it>
Re: SNMP module to query net-snmp <rvtol+news@isolution.nl>
Re: SNMP module to query net-snmp <m.REMOVEbetti@REMOVElibero.it>
Re: SNMP module to query net-snmp <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 Aug 2006 08:06:52 -0700
From: "Skybuck" <skybuck2000@hotmail.com>
Subject: (Off topic) Cyberwar question
Message-Id: <1157036811.886916.133000@i3g2000cwc.googlegroups.com>
Hello,
One of my internet providers has blocked my broadband adsl internet
connection for over a 2 months now. They still steal money from my bank
account and they still hold the adsl line hostage, so I can switch over
to another ADSL internet provider. I could switch over to a (tv) cable
internet provider, however these are more expensive and only few
providers available because of mergers.
I am not happy about all this:
1. Blocked internet access.
2. Vastly reduced internet provider choice.
3. They stealing money and providing no service for it in return.
4. They received false complaints, they were too lazy to do proper
research, and now they accuse me of things I did not do, and even if I
did do it, it's not serious enough to disconnect anybody for 2 months.
What are they, internet police ? I don't think so ?!
The question is what to do about it ? I can see 4 options:
1. Switch to a more expensive (tv) cable internet provider.
2. Sue the ADSL internet provider.
3. Start a cyberwar against the ADSL internet provider. It's the
Italian Internet Provider (Tiscali). However I live in the Netherlands
where they are also present !
4. Stick with the current dial-up internet provider.
Here is what I have to say about the options:
1. I don't really want to switch to a more expensive (tv) cable
internet provider, since it's more expensive, and they also have the
same kind of contracts, so they may also disconnect me for no reason at
all ! Most internet providers have some lines in their contracts which
say: "We have the right to disconnect you at any time !". Ridicilous I
say ! That's dangerous ! People might have internet telephone, and then
they can't call the help services in case of fire or injury or other
dangerous situations ! Furthermore internet is becoming more and more
important, just disconnecting people for no reason or bullshit reasons
should not be allowed anymore ! Internet has become to important to
just let some internet provider mess it all up !
2. The law in the Netherlands even states that disconnecting equipment
from open communication networks without valid reason is a crime.
However the goverment does little against it. It's a new law.
Furthermore, most lawyers and judges know little about internet and
it's technology, the same can be said for the police, they know little
about it all, they are mostly busy catching street criminals and such.
Going to the police at least in my neighbourhood is useless. Same can
be said for the lawyers. However I am still waiting for the lawyers
response... they still have to make up their minds. Gje. It's only been
2 months... Gje.
3. So that brings me to option three. Cyberwar ! We could start a
cyberwar against such ISP's like Tiscali and block their networks from
our webservers, websites and homepages. They don't provide me, and us,
with services then we don't provide anymore of our services to them !
So their networks will become less valuable ! At some point if enough
people take part in the cyberwar, their users will switch, because they
can no longer access any websites. It's mean, it's not nice, but the
ISP is doing it already ! Should we do they same back at them ?
That's my question really:
Who is willing to start or support a Cyberwar against these kinds of
Evil ISP's ? and maybe you have some ideas about such a war yourself ?
we can discuss those.
You can also reply via e-mail at: Skybuck2000@hotmail.com
If we do start a cyberwar maybe we will become anonymous to protect
ourselves somewhat.
I can be short about option four, it's working, but it ain't great. Me
not too happy about it. I was lucky I still have an old computer, with
an old 33k6 modem which is still supported by Windows 98. I can forget
about windows xp, it doesn't support it, as well as other older
phone/fax/data modems <- no driver support. I might buy a new 56k6
modem, but then I would have to replace one my graphics cards in my new
computer, and that kinda sucks as well... and the improvement won't be
that much and dial-up is kinda expensive... need to pay per minute...
but it's not too expensive for now. The problem is... downloading
larger stuff becomes a
problem... so that's not good. I am not happy about that.
Bye,
Skybuck !
------------------------------
Date: Thu, 31 Aug 2006 11:58:31 -0400
From: Uri Guttman <uri@stemsystems.com>
To: "Skybuck" <skybuck2000@hotmail.com>
Subject: Re: (Off topic) Cyberwar question
Message-Id: <x7u03skic8.fsf@mail.sysarch.com>
why does saying it is off topic make it ok to post off topic stuff here?
do you have a perl question?
<snip of way off topic stuff>
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 31 Aug 2006 10:32:23 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <tj7df21a9c1137lc01h6dp13m20v3ih2sj@4ax.com>
On Wed, 30 Aug 2006 21:02:51 -0500, StuPedaso <StillAwake@2am> wrote:
>Thanks for all the help. I hope to get a better grasp on perl someday.
>It's also fun to see all the different ways people think, and the
>various ways to do the same thing.
TMTOWTDI
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 31 Aug 2006 08:43:00 -0700
From: "PeterSShenkin" <shenkin@gmail.com>
Subject: Re: Can overloaded '+' return an array? If so, how?
Message-Id: <1157038980.214665.211450@i42g2000cwa.googlegroups.com>
jl_post@hotmail.com wrote:
> I fiddled around with your test code, and I found that, while the
> code:
>
> my @ar = $ca1 + ca2;
>
> is not called in list context, the following three functionally
> equivalent lines:
>
> my @ar = $ca1->combine($ca2);
> my @ar = combine $ca1 $ca2;
> my @ar = ClassAct::combine($ca1, $ca2);
>
> do return an array as you want -- without the need to change the
> combine() method.
I do find that both interesting and useful.
Thanks,
-P.
------------------------------
Date: 31 Aug 2006 16:04:11 GMT
From: xhoster@gmail.com
Subject: Re: Can overloaded '+' return an array? If so, how?
Message-Id: <20060831120436.497$Iz@newsreader.com>
"PeterSShenkin" <shenkin@gmail.com> wrote:
> xhoster@gmail.com wrote:
>
> > Yep. And, in fact, I would usually expect an overloaded addition
> > operator to turn something of the same class as (at least one of) it's
> > operands, so I suggest that not only should it return a ref, but a ref
> > that is blessed into ClassAct.
>
> That expectation is not fulfilled either in mathematics or in Perl
> native types.
>
> In Perl, an int divided by an int is not necessarily an int.
division is not addition.
>
> In mathematics, the dot product of two vectors is a scalar. The outer
> product is a matrix.
multiplication is not addition.
>
> Thus, if the inability of an overloaded '+' to always return a scalar
> was a conscious decision, I believe it was the wrong one. What if you
> want to add two arrays?
Then you take two arrayrefs (or object) and return an arrayref (or object).
Or are you going to say it is also a mistake that overloaded + always takes
its *arguments* in a scalar context, too?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 31 Aug 2006 07:03:10 -0700
From: "Davy" <zhushenli@gmail.com>
Subject: diff file in Perl?
Message-Id: <1157032990.584413.193140@i42g2000cwa.googlegroups.com>
Hi all,
Is there something in Perl like diff in Unix? That I can used to diff
the file. Thanks!
Thanks!
Davy
------------------------------
Date: 31 Aug 2006 07:04:45 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: diff file in Perl?
Message-Id: <1157033085.594114.188600@b28g2000cwb.googlegroups.com>
Davy wrote:
> Is there something in Perl like diff in Unix? That I can used to diff
> the file. Thanks!
What did you find when you went to http://search.cpan.org and searched
for "diff"?
Paul Lalli
------------------------------
Date: 31 Aug 2006 19:15:14 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: diff file in Perl?
Message-Id: <286ef2ligrki9u0rdj16hnb9v7fdf5nbu2@4ax.com>
On 31 Aug 2006 07:03:10 -0700, "Davy" <zhushenli@gmail.com> wrote:
>Hi all,
>
>Is there something in Perl like diff in Unix? That I can used to diff
>the file. Thanks!
Of your possible interest:
http://ppt.perl.org/
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 31 Aug 2006 11:19:11 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.22 How can I match strings with multibyte characters?
Message-Id: <310820061119115270%brian.d.foy@gmail.com>
In article <slrnefbvau.bkv.hjp-usenet2@yoyo.hjp.at>, Peter J. Holzer
<hjp-usenet2@hjp.at> wrote:
> On 2006-08-30 15:19, brian d foy <brian.d.foy@gmail.com> wrote:
> > In article <slrnef9bi8.db6.hjp-usenet2@yoyo.hjp.at>, Peter J. Holzer
> ><hjp-usenet2@hjp.at> wrote:
> >> On 2006-08-29 19:03, PerlFAQ Server <brian@stonehenge.com> wrote:
> >> > 6.22: How can I match strings with multibyte characters?
> >> > Starting from Perl 5.6 Perl has had some level of multibyte character
> >> > support. Perl 5.8 or later is recommended. Supported multibyte
> >> > character
> >> > repertoires include Unicode, and legacy encodings through the Encode
> >> > module. See perluniintro, perlunicode, and Encode.
> >> > If you are stuck with older Perls, ...
> >> I get the impression from this article that these problems are present
> >> in perl's unicode support.
> > The problems with multi-character support are in the older versions of
> > Perl.
> Yes. I know that. But when I ignore what I know and just read the
> article that isn't clear at all.
Perhaps you missed that last line that I quoted. The paragraph starts
with "If you are stuck with older Perls".
What change would you make? How would you like the answer to read?
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 31 Aug 2006 12:06:10 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Hi Guys !
Message-Id: <dvcdf2dv3e5ps0mmlfsjt5ap8i4tgktoff@4ax.com>
On 30 Aug 2006 21:03:40 -0700, "rock" <rajeshmvj@gmail.com> wrote:
>Yes
>i will explain i want to know abt the latest recuitment in perl for 1
>year experienced programmars
No
i will explain i want to read question i can make sense of. So most of
us do.
I can vaguely understand that you have a question having to do with
recruitment for a job having to do with perl. This is largely OT here,
since this is a ng for actually discussing *perl*.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 31 Aug 2006 12:09:05 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Hi Guys !
Message-Id: <j4ddf2t6fdtv3i914ktugbq6hhl1jrdfjr@4ax.com>
On 30 Aug 2006 21:05:49 -0700, "rock" <rajeshmvj@gmail.com> wrote:
>Exactly every one is totally out of track...
>i hope you can understand my question ..
Exactly every one who asks OT questions is totally out of track. Even
more so if they're asked badly. Even more so if they're asked *so*
badly one can hardly make sense of them.
I hope you can understand it's very hard to understand your question.
>Scott Bryce wrote:
>> rock wrote:
>>
>> >
>> >>What this percentage means ? can u explain
>> >>
>> >>42.3%
>>
>> It means that nobody here is able to make sense out of your original
>> question.
DO-NOT-TOP-POST... *please*
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 31 Aug 2006 08:33:49 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Hi Guys !
Message-Id: <hcqdnW5cM5HRbmvZnZ2dnUVZ_sydnZ2d@comcast.com>
rock wrote:
> i will explain i want to know abt the latest recuitment in perl for 1
> year experienced programmars
I understand that English is probably not your first language. Even so,
it would help if you use your best English, and not text message short-hand.
If I understand your question, you want to know how much demand there is
in the market place for Perl programers with one year of experience. I
don't know if anyone here can answer your question.
------------------------------
Date: 31 Aug 2006 11:54:15 -0400
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Hi Guys !
Message-Id: <87bqq0j3yw.fsf@mithril.chromatico.net>
Scott Bryce <sbryce@scottbryce.com> writes:
> If I understand your question, you want to know how much demand there
> is in the market place for Perl programers with one year of
> experience. I don't know if anyone here can answer your question.
Much like a lot of things, it depends. Someone with good domain
knowledge who's gotten a year of meaningful experience and has good
communication skills will *always* be in high demand. Someone whose
only main credential is that he's been paid at a job that uses Perl
for a year will have a lot of competition.
Charlton
------------------------------
Date: Thu, 31 Aug 2006 09:36:59 +0200
From: milaus <m.REMOVEbetti@REMOVElibero.it>
Subject: Re: Net-SNMP, community !~ public, JBOSS-4.0.4.GA
Message-Id: <pan.2006.08.31.07.36.57.535159@REMOVElibero.it>
Il Wed, 30 Aug 2006 16:35:23 +0000, Hans Jørgen Jakobsen ha scritto:
> On Wed, 30 Aug 2006 15:35:35 +0200, milaus wrote:
>> Hi all,
>> sorry for mistakes I did in previous posting. I hope to do better now,
>> starting from the subject :-)
>> Since the last JBOSS version (4.0.4.GA), a SNMP-agent has been added to
>> the application server.
>> I'm writing a perl-script to monitor JBOSS via snmp, by using Net::SNMP
>> 5.20 perl module.
>> The problem is that if I set a community different from 'public',
>> snmp-queries done via NET::SNMP module on JBOSS snmp-agent don't work.
>> While snmp-queries done via 'snmpget' command (from command line) on JBOSS
>> snmp-agent work perfecty with any community.
>> I worte a little script to isolate the problem:
>>
>>
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>> use Net::SNMP;
>> my ($session,$error) = Net::SNMP->session(Hostname => $ARGV[0],
>> Community => $ARGV[1]);
>> die "session error: $error" unless ($session);
>> printf("Hostname: %s Community: %s OID: %s\n", $ARGV[0], $ARGV[1], $ARGV[2]);
>> my $result = $session->get_request("$ARGV[2]");
>> die "request error: ".$session->error unless (defined $result);
>> $session->close;
>> print "OID requested: ".$result->{"$ARGV[2]"}."\n";
>> ### myscript.pl end ###
>>
>> I tested the problem in this scenario:
>> - host wi064111 running CentOS 4.3
>> -- JBOSS running snmp-adaptor.sar with community 'public' on port 11112
>> -- JBOSS running snmp-adaptor.sar with community 'q3lrcdjb' on port 11212
>> -- snmpd daemon running on port 161 (tested with both previous communities)
>>
>> The result of my tests is:
>>
>> 1) 'snmpget' command works perfectly quering both snmpd daemon and JBOSS
>> snmp-agent, with any community:
>>
>> [root@wi064111 ~]# snmpget -c public -v 1 10.102.64.111:161 .1.3.6.1.2.1.4.1.0
>> IP-MIB::ipForwarding.0 = INTEGER: notForwarding(2)
>>
>> [root@wi064111 ~]# snmpget -c q3lrcdjb -v 1 10.102.64.111:161
>> .1.3.6.1.2.1.4.1.0
>> IP-MIB::ipForwarding.0 = INTEGER: notForwarding(2)
>>
>> [root@wi064111 ~]# snmpget -c public -v 1 10.102.64.111:11112 1.2.3.4.1.2
>> iso.2.3.4.1.2 = Gauge32: 92686392
>>
>> [root@wi064111 ~]# snmpget -c q3lrcdjb -v 1 10.102.64.111:11212
>> 1.2.3.4.1.2
>> iso.2.3.4.1.2 = Gauge32: 94004080
>>
>> 2) myscript.pl works perfectly quering snmpd daemon, with any community:
>>
>> [root@wi064111 ~]# ./myscript.pl wi064111:161 public 1.3.6.1.2.1.4.1.0
>> Hostname: wi064111:161 Community: public OID: 1.3.6.1.2.1.4.1.0
>> OID requested: 2
>>
>> [root@wi064111 ~]# ./myscript.pl wi064111:161 q3lrcdjb 1.3.6.1.2.1.4.1.0
>> Hostname: wi064111:161 Community: q3lrcdjb OID: 1.3.6.1.2.1.4.1.0
>> OID requested: 2
>>
>> 3) myscript.pl queries on JBOSS snmp-agent work only with community
>> 'public':
>>
>> [root@wi064111 ~]# ./myscript.pl wi064111:11112 public 1.2.3.4.1.2
>> Hostname: wi064111:11112 Community: public OID: 1.2.3.4.1.2
>> OID requested: 91884232
>>
>> [root@wi064111 ~]# ./myscript.pl wi064111:11212 q3lrcdjb 1.2.3.4.1.2
>> Hostname: wi064111:11212 Community: q3lrcdjb OID: 1.2.3.4.1.2
>> request error: Bad incoming community [public] at ./myscript.pl line 10.
>> ************************************************************************
>> THIS IS THE ERROR I GET.
>>
>> Now, NET::SNMP module seems to be ok because works perfectly with snmpd
>> daemon. On the other side, JBOSS snmp-agent seems to be ok because answers
>> perfectly to snmpget queries.
>> But NET::SNMP module with JBOSS snmp-agent doesn'work correctly. Moreover
>> the error is caused by $session line, and not by
>> Net::SNMP->session line. It seems like JBOSS snmp-agent would expect a new
>> authentication every request.
>>
>> Could the error be in NET::SNMP module implementation?
>>
>> Thanks to everyone who just read the whole post,
>> Marco
>>
> Do you get the community transfered from the command line to the Net::SNMP
> module?
> Try: ./myscript.pl wi064111:11112 anythingButPublic 1.2.3.4.1.2
>
> The examples I found at CPAN has a somewhat other syntax than you uses.
>
> Have you considered use the perlmodule from net-snmp. Net-snmp might be
> what you are using through you command line utilities.
> (http://net-snmp.sourceforge.net/)
> Net::SNMP is not at all the same as net-snmp!!
> /hjj
Off course Net::SNMP is not the same as net-snmp, I thought it was
obvious and I didn't specify it, sorry :-)
But perhaps there is a little misunderstanding, maybe due to the fact
that I'm a linux sysadmin, not a perl programmer :-)
myscript.pl cannot work on port 11112 with a !'public' community.
myscript.pl should work on port 11112 with community 'public' and it does.
myscript.pl should work on port 11212 with community 'q3lrdjb' and it
doesn't.
But if your purpose was only debugging, here is the output for your test:
[root@wi064111 ~]# ./myscript.pl wi064111:11112 anythingButPublic
1.2.3.4.1.2 Hostname: wi064111:11112 Community: anythingButPublic OID:
1.2.3.4.1.2 request error: No response from remote host 'wi064111' at
./myscript.pl line 10.
It still stop at the get_request line and not at the Net::SNMP->session
line...
Finally, I've considered using the perlmodule from net-snmp, but I tried
NET::SNMP because it's better documented and I'm not so good with perl.
Moreover in NET:SNMP synopsis you can read:
"The Net::SNMP module implements an object oriented interface to the
Simple Network Management Protocol. Perl applications can use the module
to retrieve or update information on a remote host using the SNMP
protocol. The module supports SNMP version-1, SNMP version-2c
(Community-Based SNMPv2), and SNMP version-3."
So, in my opinion, it should work to query any snmp agent... and this is
the reason of my doubt: the problem is NET::SNMP perlmodule or JBOSS snmp
agent?
As for the example syntax, it's only a simplified one, my bigger script
has exactly CPAN-example syntax, but the result is the same...
I'll try to understand how to use perlmodule from net-snmp, but I'll
remain with my starting doubt...
Thanks,
Marco
------------------------------
Date: 31 Aug 2006 12:03:22 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: New Group Cgi:Perl
Message-Id: <4rcdf2lj1v5ef3jpt79at05qi8feb7ng7q@4ax.com>
On 30 Aug 2006 21:15:41 -0700, "rock" <rajeshmvj@gmail.com> wrote:
>Introducing a new group Cgi:Perl for everyone ..
That does not seem like a USENET group.
>join this Group ..
Why?
>comments are welcomed.
I can hardly make sense of your posts, thus far, from both the
orthografic, syntactic and semantic points of vies. CGI & C. can be
well discussed here, provided that it's pointed out so and that it is
actually on topic wrt perl.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 31 Aug 2006 05:25:56 -0700
From: "rock" <rajeshmvj@gmail.com>
Subject: Re: New Group Cgi:Perl
Message-Id: <1157027156.094288.258020@p79g2000cwp.googlegroups.com>
I am Sorry ! Ok I will try to put it in a proper way !
Keith Keller wrote:
> On 2006-08-31, rock <rajeshmvj@gmail.com> wrote:
> > Introducing a new group Cgi:Perl for everyone ..
> > join this Group ..
> > comments are welcomed.
>
> Here's my comment: none of your posts have made a lick of sense.
> If you want people to pay attention to you, pay more attention to
> your writing.
>
> --keith
>
> --
> kkeller-usenet@wombat.san-francisco.ca.us
> (try just my userid to email me)
> AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
> see X- headers for PGP signature information
------------------------------
Date: Thu, 31 Aug 2006 13:52:59 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: New Group Cgi:Perl
Message-Id: <ed6m3b$1cq$1@gemini.csx.cam.ac.uk>
rock wrote:
[top-posting fixed]
> Keith Keller wrote:
>> On 2006-08-31, rock <rajeshmvj@gmail.com> wrote:
>>> Introducing a new group Cgi:Perl for everyone ..
>>> join this Group ..
>>> comments are welcomed.
>> Here's my comment: none of your posts have made a lick of sense.
>> If you want people to pay attention to you, pay more attention to
>> your writing.
> I am Sorry ! Ok I will try to put it in a proper way !
Please stop top-posting! You have already been asked to do this, but
continue to do so. Learn how to post on usenet. Reading the posting
guidelines for this group (posted here twice weekly) would be a good start.
DS
------------------------------
Date: Thu, 31 Aug 2006 14:05:35 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: New Group Cgi:Perl
Message-Id: <P0CJg.9162$4O4.1906@trnddc02>
rock wrote:
> Introducing a new group Cgi:Perl for everyone ..
Really? How did you manage to create a new top-level hierarchie cgi? Or is
this somewhere underneath comp? I thought there are still strict rules with
voting and everything before new groups are created. At least my NNTP host
seems to have ignored your create-group request and doesn't carry your
group. Good.
> join this Group ..
Why?
> comments are welcomed.
Keep your advertising nonsense to yourself.
jue
------------------------------
Date: Thu, 31 Aug 2006 13:08:16 +0200
From: milaus <m.REMOVEbetti@REMOVElibero.it>
Subject: SNMP module to query net-snmp
Message-Id: <pan.2006.08.31.11.08.14.139405@REMOVElibero.it>
Hi all,
I'm writing a perl script to query linux snmpd daemon (net-snmp) and I'm
using SNMP module "The Perl5 'SNMP' Extension Module for the Net-SNMP
SNMP package".
I tried to start with very simple script, using the examples as
starting-point
(http://search.cpan.org/src/HARDAKER/SNMP-5.0301001/examples/)
But I can't figure out why my script doesn't work...
This are the script and its output:
#!/usr/bin/perl
use strict;
use warnings;
use SNMP;
my $host = '10.102.64.111';
my $community = 'public';
{
my $sess = new SNMP::Session (DestHost => $host,
Community => $community,
Retries => 1) || die "session doesn't work...\n";
my $oid = ".1.3.6.1.2.1.4.1.0";
my $cb = "3";
my ($result) = $sess->get(["$oid", "$cb"]) || 'get doesn\'t
work...';
print "result: $result\n";
}
### end of example-snmp.pl ###
[root@wi064111 ~]# ./example-snmp.pl
result: get doesn't work...
Instead, if I invoke 'snmpget' from the command line everything works
correctly ('snmpget' is the client side command of net-snmp package).
[root@wi064111 ~]# snmpget -c public -v 1 10.102.64.111
.1.3.6.1.2.1.4.1.0 IP-MIB::ipForwarding.0 = INTEGER: notForwarding(2)
Any ideas?
Thanks,
Marco
------------------------------
Date: Thu, 31 Aug 2006 14:47:39 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: SNMP module to query net-snmp
Message-Id: <ed6t0r.n4.1@news.isolution.nl>
milaus schreef:
> my ($result) = $sess->get(["$oid", "$cb"]) || 'get doesn\'t
> work...';
I checked the SNMP-documentation, and I don't think that ["$oid", "$cb"]
is one of the "Acceptable variable fomats".
Maybe you need to use SNMP::VarList. Read also `perldoc -q always`.
The "|| 'get doesn\'t work...'" looks strange, I would change that to
or die "get doesn't work: ". $sess->ErrorStr ;
While testing, I would also do an $SNMP::verbose = 1 or $SNMP::debugging
= 1 at the start.
In the trouble shooting section of `perldoc SNMP` it says:
"If you cannot resolve the problem you can post to
news:comp.lang.perl.modules or net-snmp-users(AT)lists.sourceforge.net
please give sufficient information to analyze the problem (OS type,
versions for OS/Perl/UCD/compiler, complete error output, etc.)"
So there is a mailing list net-snmp-users@lists.sourceforge.net
with an archive at
http://sourceforge.net/mailarchive/forum.php?forum_id=4959
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Thu, 31 Aug 2006 16:50:19 +0200
From: milaus <m.REMOVEbetti@REMOVElibero.it>
Subject: Re: SNMP module to query net-snmp
Message-Id: <pan.2006.08.31.14.50.17.748608@REMOVElibero.it>
Il Thu, 31 Aug 2006 14:47:39 +0200, Dr.Ruud ha scritto:
> milaus schreef:
>
>> my ($result) = $sess->get(["$oid", "$cb"]) || 'get doesn\'t
>> work...';
>
> I checked the SNMP-documentation, and I don't think that ["$oid", "$cb"]
> is one of the "Acceptable variable fomats".
> Maybe you need to use SNMP::VarList. Read also `perldoc -q always`.
>
>
> The "|| 'get doesn\'t work...'" looks strange, I would change that to
>
> or die "get doesn't work: ". $sess->ErrorStr ;
>
>
> While testing, I would also do an $SNMP::verbose = 1 or $SNMP::debugging
> = 1 at the start.
>
>
> In the trouble shooting section of `perldoc SNMP` it says:
> "If you cannot resolve the problem you can post to
> news:comp.lang.perl.modules or net-snmp-users(AT)lists.sourceforge.net
> please give sufficient information to analyze the problem (OS type,
> versions for OS/Perl/UCD/compiler, complete error output, etc.)"
>
>
> So there is a mailing list net-snmp-users@lists.sourceforge.net
> with an archive at
> http://sourceforge.net/mailarchive/forum.php?forum_id=4959
Thank You for your answer and advices,
I'm new with perl and I don't know a lot of thing and off course I should
spend more time reading documentation... but, as you can imagine, when
everything you read is new you can't catch any detail as if you were
already used with the topic.
Anyway, I solved the problem, the main point was that "Version" field has
to be specified when calling "new SNMP::Session(DestHost... ". But in
official CPAN snmp module example, Version field was not used!! This is
the example on CPAN:
...
$sess = new SNMP::Session(DestHost => localhost, Community => public);
...
Only to be complete, my working little example is:
[root@wi064111 ~]# cat example-snmp.pl
#!/usr/bin/perl
use strict;
use warnings;
use SNMP;
my $host = $ARGV[0];
my $community = $ARGV[1];
my $OID = $ARGV[2];
my $porta = $ARGV[3];
my $versione = '2c';
my $sess = new SNMP::Session (DestHost => $host, Community => $community, Version => '2c', RemotePort => $porta );
my $val = $sess->get($OID);
print $val . "\n";
And this is the output, looking for ipForwarding parameter:
[root@wi064111 ~]# ./example-snmp.pl wi064111 public 1.3.6.1.2.1.4.1
2
Or, quering JBOSS-4.0.4.GA snmp agent looking for VM freeMemory:
[root@wi064111 ~]# ./example-snmp.pl wi064111 q3lrcdjb 1.2.3.4.1.2 11212
90081120
Bye,
Marco
------------------------------
Date: Thu, 31 Aug 2006 17:31:14 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: SNMP module to query net-snmp
Message-Id: <ed76ee.1kk.1@news.isolution.nl>
milaus schreef:
> my $host = $ARGV[0];
> my $community = $ARGV[1];
> my $OID = $ARGV[2];
> my $porta = $ARGV[3];
Lined-up code is clearer:
my $host = $ARGV[0] ;
my $community = $ARGV[1] ;
my $OID = $ARGV[2] ;
my $porta = $ARGV[3] ;
Alternative:
my ($host, $community, $OID, $porta) = @ARGV ;
> my $versione = '2c';
You don't seem to be using that one.
> print $val . "\n";
Alternative:
print "$val\n" ;
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9670
***************************************