[28301] in Perl-Users-Digest
Perl-Users Digest, Issue: 9665 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 30 11:05:52 2006
Date: Wed, 30 Aug 2006 08:05:12 -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 Wed, 30 Aug 2006 Volume: 10 Number: 9665
Today's topics:
Re: 1 string from 3, making replacements more perlish anno4000@radom.zrz.tu-berlin.de
Re: 1 string from 3, making replacements more perlish <bik.mido@tiscalinet.it>
Re: Allowing threading with CGI xhoster@gmail.com
Re: Beginner: read $array with line breaks line by line <bik.mido@tiscalinet.it>
Re: FormMail Error Bad/No Recipient, Browser Issue <noreply@gunnar.cc>
Re: FormMail Error Bad/No Recipient, Browser Issue <coolboarder2224@gmail.com>
Re: FormMail Error Bad/No Recipient, Browser Issue <noreply@gunnar.cc>
Get a list of all pragmas <tuser3@gmail.com>
Re: Get a list of all pragmas anno4000@radom.zrz.tu-berlin.de
Re: Get a list of all pragmas himanshu.garg@gmail.com
Re: Get a list of all pragmas <tuser3@gmail.com>
Re: Get a list of all pragmas <tuser3@gmail.com>
Re: Hi Guys ! <bik.mido@tiscalinet.it>
Re: Hi Guys ! <tadmc@augustmail.com>
Re: Hi Guys ! <rajeshmvj@gmail.com>
Re: Hi Guys ! <bik.mido@tiscalinet.it>
Re: integrate() <rvtol+news@isolution.nl>
Net-SNMP, community !~ public, JBOSS-4.0.4.GA <m.REMOVEbetti@REMOVElibero.it>
Re: Perl's GUI <zentara@highstream.net>
Re: Problem handling a Unicode file <rvtol+news@isolution.nl>
Re: Returning raw xml in SOAP::Lite himanshu.garg@gmail.com
set in Perl? <zhushenli@gmail.com>
Re: set in Perl? <mritty@gmail.com>
Re: Stupid Q: How to preserve numeric characters himanshu.garg@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Aug 2006 08:05:54 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <4lkv72F2bqjkU1@news.dfncis.de>
DJ Stunks <DJStunks@gmail.com> wrote in comp.lang.perl.misc:
> StuPedaso wrote:
> > I have 1 string made up of ones and zeros,
> > a 2nd and 3rd of letters and number,
> > and need to create a 4th where the 1's are successively pulled from 2,
> > and the 1's from the 3rd.
> >
> > I can this do this in a QB/VB type way with
> > $string1="001010110";
> > $string2="a1bd3";
> > $string3="0XY0";
> >
> > $l=0;$m=0;$p=0;
> > $string4="";
> >
> > for $i (0..(length $string1)){
> > $x=substr($string1,$l,1);$l++;
> > if ($x==1){$string4.=substr($string3,$p,1);$p++;}
> > else {$string4.=substr($string2,$m,1);$m++;}
> > }
> > print $string4;
> > #a10bXdY03
> >
> > Not very perlish
> > Also I don't want to modify srting1, as I will be using it again after
> > I modify 2 and 3.
>
> what do y'all think of this:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $key_string = '001010110';
> my $string_0 = 'a1bd3';
> my $string_1 = '0XY0';
>
> my %hash = (
> 0 => [ split //, $string_0 ],
> 1 => [ split //, $string_1 ],
> );
An array of two elements would do instead of the hash.
my @pair = map [ split //], $string_0, $string_1;
> my $result;
> for my $i (split //, $key_string) {
> $result .= shift @{ $hash{$i} };
> }
join() and map() can replace he loop:
my $result = join '', map shift( @{ $pair[ $_] }), split //, $key_string;
(Untested code)
Anno
------------------------------
Date: 30 Aug 2006 10:22:12 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: 1 string from 3, making replacements more perlish
Message-Id: <rhiaf2t6tki7vkpvkmvv8tfla1kp5kdqb6@4ax.com>
On Tue, 29 Aug 2006 16:55:14 -0500, StuPedaso <StillAwake@2am> wrote:
>I have 1 string made up of ones and zeros,
>a 2nd and 3rd of letters and number,
>and need to create a 4th where the 1's are successively pulled from 2,
>and the 1's from the 3rd.
To add to the chorus:
#!/usr/bin/perl
use strict;
use warnings;
my $key_string = '001010110';
my $string_0 = 'a1bd3';
my $string_1 = '0XY0';
my @subst=map [ /./g ], $string_0, $string_1;
(my $result=$key_string) =~ s/(.)/shift @{ $subst[$1] }/eg;
print "Result: $result\n";
__END__
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: 30 Aug 2006 14:58:31 GMT
From: xhoster@gmail.com
Subject: Re: Allowing threading with CGI
Message-Id: <20060830105852.100$tV@newsreader.com>
"alpha_beta_release" <youknows@gmail.com> wrote:
> That's weird. Is it just my system?
> I don't think there's any informative thing about the message. Anyway,
> here's the message
> "Perl Command Line Interpreter has encountered a problem and needs to
> close. We are sorry for the inconvenience."
>
> I run it on Windows, using Apache as HTTP server
It worked for me on Linux with Apache. Sorry, I can't test it on
Windows/Apache. Now that we have working code, maybe someone else can.
Maybe it is an Apache for Windows configuration issue.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 30 Aug 2006 15:18:18 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beginner: read $array with line breaks line by line
Message-Id: <8u2bf2h6367tdsebm94hh3uen6f1kv6ib6@4ax.com>
On Tue, 29 Aug 2006 22:19:12 +0200, Marek Stepanek <mstep@t-online.de>
wrote:
>my (@competitions);
>
>while (<>)
> {
> push @competitions, m"<dd>(.+?)</dd>"g;
> }
I see you've been following some of the advices you've been given,
albeit not all of them...
>my ($competition, $email, $first_name, $last_name, $gender, $phone,
>$comment);
>foreach my $addr (@competitions)
> {
> foreach (split(/\n/, $addr))
> {
> ($competition) = $1 if m/^Competition:\s+(.+)/;
> if ($comment and m/^\s?((?:International|National)
>Competition)\s*$/i)
[snip]
All in all clumsy clumsy stuff. How 'bout an $addr example along with
a description of how you want it to be parsed?
> if ($competition)
> {
> print OUT2 "\\addrentry\n";
> if ($last_name)
> {
> print OUT2 "\t{$last_name}\n";
> }
> else
> {
> print OUT2 "\t{last_name}\n";
> }
[snip]
AWFUL! We recommend not to use the ternary operator ?: instead of
branching if not using its return value, but there's no reason not to
use it if its return value *would* be useful.
print OUT2 "\\addrentry\n", $last_name ?
"\t{$last_name}\n" : "\t{$last_name}\n";
But all in all still lots of stuff to be facorized away in a neat
manner. I would use a hash, say %property, indexed by 'last_name',
'first_name' and so on. And somewhere in the code something like
$property{$key} || $key
HTH,
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: Wed, 30 Aug 2006 09:13:59 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail Error Bad/No Recipient, Browser Issue
Message-Id: <4lks6cF2cuftU1@individual.net>
coolboarder2224 wrote:
> I have been making a form for people so submit picks to my email
> account, I'm using formmail.cgi. The form works perfect and couldnt be
>
> happier, but found out it seems to only work in safari though. I have
> no idea what to do,
Have you asked the script author?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 30 Aug 2006 00:37:28 -0700
From: "coolboarder2224" <coolboarder2224@gmail.com>
Subject: Re: FormMail Error Bad/No Recipient, Browser Issue
Message-Id: <1156923448.212328.283560@74g2000cwt.googlegroups.com>
Gunnar Hjalmarsson wrote:
> coolboarder2224 wrote:
> > I have been making a form for people so submit picks to my email
> > account, I'm using formmail.cgi. The form works perfect and couldnt be
> >
> > happier, but found out it seems to only work in safari though. I have
> > no idea what to do,
>
> Have you asked the script author?
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
its one of the matts formmail scripts and so i read the ReadMe and
tried everything it said, didnt see anything about it not working in
some browsers though
------------------------------
Date: Wed, 30 Aug 2006 09:53:40 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail Error Bad/No Recipient, Browser Issue
Message-Id: <4lkugoF2b39dU1@individual.net>
coolboarder2224 wrote:
> Gunnar Hjalmarsson wrote:
>>coolboarder2224 wrote:
>>>I have been making a form for people so submit picks to my email
>>>account, I'm using formmail.cgi. The form works perfect and couldnt be
>>>happier, but found out it seems to only work in safari though. I have
>>>no idea what to do,
>>
>>Have you asked the script author?
>
> its one of the matts formmail scripts and so i read the ReadMe and
> tried everything it said, didnt see anything about it not working in
> some browsers though
This Usenet group is not about providing support for free scripts, it's
about discussing Perl and helping people write Perl code. In addition to
that, people here are disinclined to deal with Matt's scripts. Take a
look here for better alternatives:
http://nms-cgi.sourceforge.net/scripts.shtml
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 30 Aug 2006 06:05:00 -0700
From: "tuser" <tuser3@gmail.com>
Subject: Get a list of all pragmas
Message-Id: <1156943100.415955.37310@i42g2000cwa.googlegroups.com>
I am running perl 5.8.7 under Ubuntu Linux 6.06 LTS.
Looking at "perldoc perltoc", I can see the list of pragmas in my
version of perl.
Then I tried to get the list of all pragmas from a perl program:
=================
use ExtUtils::Installed;
$, = "\n";
print ExtUtils::Installed->new()->modules(), "";
=================
but that did only give me the manually installed modules from CPAN, not
even the pre-installed standard modules, let alone the pragmas !
How can I get this list of pragmas programmatically from within a perl
program (other than scanning the "perldoc perltoc" output) ?
------------------------------
Date: 30 Aug 2006 13:26:45 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Get a list of all pragmas
Message-Id: <4lli0lF2brvhU1@news.dfncis.de>
tuser <tuser3@gmail.com> wrote in comp.lang.perl.misc:
> I am running perl 5.8.7 under Ubuntu Linux 6.06 LTS.
>
> Looking at "perldoc perltoc", I can see the list of pragmas in my
> version of perl.
>
> Then I tried to get the list of all pragmas from a perl program:
> =================
> use ExtUtils::Installed;
> $, = "\n";
> print ExtUtils::Installed->new()->modules(), "";
> =================
>
> but that did only give me the manually installed modules from CPAN, not
> even the pre-installed standard modules, let alone the pragmas !
>
> How can I get this list of pragmas programmatically from within a perl
> program (other than scanning the "perldoc perltoc" output) ?
This may get you started. It finds all all-lower-case module names
in @INC. Some are probably not meant for public consumption.
use File::Find;
my @prag;
find sub { /^([[:lower:]]+).pl$/ and push @prag, $1 }, @INC;
print join "\n", @prag, '';
Anno
------------------------------
Date: 30 Aug 2006 06:42:49 -0700
From: himanshu.garg@gmail.com
Subject: Re: Get a list of all pragmas
Message-Id: <1156945369.376956.298220@74g2000cwt.googlegroups.com>
tuser wrote:
> I am running perl 5.8.7 under Ubuntu Linux 6.06 LTS.
>
> Looking at "perldoc perltoc", I can see the list of pragmas in my
> version of perl.
>
> Then I tried to get the list of all pragmas from a perl program:
> =================
> use ExtUtils::Installed;
> $, = "\n";
> print ExtUtils::Installed->new()->modules(), "";
> =================
>
> but that did only give me the manually installed modules from CPAN, not
> even the pre-installed standard modules, let alone the pragmas !
>
> How can I get this list of pragmas programmatically from within a perl
> program (other than scanning the "perldoc perltoc" output) ?
You could try Module::CoreList module available from CPAN for this.
See Also:-
perldoc -q installed
Thank You,
++imanshu.
------------------------------
Date: 30 Aug 2006 07:40:20 -0700
From: "tuser" <tuser3@gmail.com>
Subject: Re: Get a list of all pragmas
Message-Id: <1156948820.849197.220820@p79g2000cwp.googlegroups.com>
anno4000@radom.zrz.tu-berlin.de wrote:
> tuser <tuser3@gmail.com> wrote in comp.lang.perl.misc:
> > I am running perl 5.8.7 under Ubuntu Linux 6.06 LTS.
> >
> > Looking at "perldoc perltoc", I can see the list of pragmas in my
> > version of perl.
> >
> > Then I tried to get the list of all pragmas from a perl program:
> > =================
> > use ExtUtils::Installed;
> > $, = "\n";
> > print ExtUtils::Installed->new()->modules(), "";
> > =================
> >
> > but that did only give me the manually installed modules from CPAN, not
> > even the pre-installed standard modules, let alone the pragmas !
> >
> > How can I get this list of pragmas programmatically from within a perl
> > program (other than scanning the "perldoc perltoc" output) ?
>
> This may get you started. It finds all all-lower-case module names
> in @INC. Some are probably not meant for public consumption.
>
> use File::Find;
> my @prag;
> find sub { /^([[:lower:]]+).pl$/ and push @prag, $1 }, @INC;
> print join "\n", @prag, '';
>
> Anno
Cool ! - that works brilliantly.
I did not think of pragmas being all-lowercase modules, but yes, they
are ! -- perl has been (and probably will be) surprising me again and
again.
Thanks.
------------------------------
Date: 30 Aug 2006 07:43:18 -0700
From: "tuser" <tuser3@gmail.com>
Subject: Re: Get a list of all pragmas
Message-Id: <1156948998.778955.4290@74g2000cwt.googlegroups.com>
himanshu.garg@gmail.com wrote:
> tuser wrote:
>
> > I am running perl 5.8.7 under Ubuntu Linux 6.06 LTS.
> >
> > Looking at "perldoc perltoc", I can see the list of pragmas in my
> > version of perl.
> >
> > Then I tried to get the list of all pragmas from a perl program:
> > =================
> > use ExtUtils::Installed;
> > $, = "\n";
> > print ExtUtils::Installed->new()->modules(), "";
> > =================
> >
> > but that did only give me the manually installed modules from CPAN, not
> > even the pre-installed standard modules, let alone the pragmas !
> >
> > How can I get this list of pragmas programmatically from within a perl
> > program (other than scanning the "perldoc perltoc" output) ?
>
> You could try Module::CoreList module available from CPAN for this.
>
> See Also:-
> perldoc -q installed
Thanks, Module::CoreList will serve me as a test to see whether all
modules that should be available are installed on my system.
------------------------------
Date: 30 Aug 2006 10:24:13 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Hi Guys !
Message-Id: <1oiaf2pbid2a3cmbq3idapmh9e7672ptqi@4ax.com>
On 29 Aug 2006 22:56:18 -0700, "rajesh" <rajeshmvj@gmail.com> wrote:
>i want to know about the recruitment in perl for 1 year !
And after 1 year you will not want to know about it any more?
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: Wed, 30 Aug 2006 08:56:20 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Hi Guys !
Message-Id: <slrnefb684.ibm.tadmc@magna.augustmail.com>
rajesh <rajeshmvj@gmail.com> wrote:
> i want to know about the recruitment in perl for 1 year !
42.3%
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Aug 2006 02:10:22 -0700
From: "rock" <rajeshmvj@gmail.com>
Subject: Re: Hi Guys !
Message-Id: <1156929022.191077.65940@b28g2000cwb.googlegroups.com>
Michele Dondi wrote:
> On 29 Aug 2006 22:56:18 -0700, "rajesh" <rajeshmvj@gmail.com> wrote:
>
> >i want to know about the recruitment in perl for 1 year !
>
> And after 1 year you will not want to know about it any more?
>
>
> 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: 30 Aug 2006 12:05:19 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Hi Guys !
Message-Id: <6koaf21piruvedas21vvl0drf4mk47nr3e@4ax.com>
On 30 Aug 2006 02:10:22 -0700, "rock" <rajeshmvj@gmail.com> wrote:
>Michele Dondi wrote:
>> On 29 Aug 2006 22:56:18 -0700, "rajesh" <rajeshmvj@gmail.com> wrote:
[snip complete quote of my post]
Yes, I wrote all that!
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: Wed, 30 Aug 2006 16:08:51 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: integrate()
Message-Id: <ed4dgf.19o.1@news.isolution.nl>
Ilya Zakharevich schreef:
> Dr.Ruud:
>> I searched again (like on "integration" and on "integral")
>> and found only
>> Math::Integral::Romberg - scalar numerical integration
>> but that is a different area. <g>
>
> perl -MMath::Pari=:all -wle "
> $x = PARIvar q(x);
> print $p = ($x**7 - 1)/($x - 1);
> print intformal $p
> "
> x^6+x^5+x^4+x^3+x^2+x+1
> 1/7*x^7+1/6*x^6+1/5*x^5+1/4*x^4+1/3*x^3+1/2*x^2+x
>
> P.S. This is with PARI 2.3.0; older version might have this function
> named differently; check the docs.
Yes, very nice example indeed.
I should have searched for "integrals". :(
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 30 Aug 2006 15:35:35 +0200
From: milaus <m.REMOVEbetti@REMOVElibero.it>
Subject: Net-SNMP, community !~ public, JBOSS-4.0.4.GA
Message-Id: <pan.2006.08.30.13.35.35.122207@REMOVElibero.it>
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->get_request 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
------------------------------
Date: Wed, 30 Aug 2006 12:04:57 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Perl's GUI
Message-Id: <5jvaf2d7fi29rmvr0rioekqpi6kd6kbqfd@4ax.com>
On Tue, 29 Aug 2006 08:40:56 -0700, Joe Smith <joe@inwap.com> wrote:
>zentara wrote:
>
>> Why does making a textbox with a black background, (which is easier on
>> the eyes), make things hard for the user?
>
>There are "high contrast" themes to make things easier on the
>eyes of those who need it. Selecting such a theme makes all
>textboxes "easier on the eyes", not just one or two.
> -Joe
Yes, that is true; but what if you have a situation where you want to
introduce a multiude of special colors.... for instance to show the
results of complex regexes on the text? The high-contrast themes
will often mask the desired colors. My point being, Tk has much more
flexibility in this area than Gtk2, and it seems to me that the
inability to easily adjust colors and fonts in individual widgets, gives
the appearance of an incomplete toolbox.
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Wed, 30 Aug 2006 14:07:20 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Problem handling a Unicode file
Message-Id: <ed46m9.1eg.1@news.isolution.nl>
Peter J. Holzer schreef:
> Dr.Ruud:
>> Sidenote:
>>
>> #!/usr/bin/perl
>> # Script-ID: utf16.pl
>> use warnings ;
>> use strict ;
>>
>> my ($fno, $eo) = ('utf16.txt', ':encoding(UTF16)') ;
>> open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
>> print $fho "\n" ;
>> __END__
>>
>> results in a 5 byte file (Windows, Perl 5.8.8):
>> FE FF 00 0D 0A
>>
>> Anyone knows a good reason for why that doesn't result in:
>> FE FF 00 0D 00 0A
>> ?
>> (I understand how it happens, but the "why" escapes me.)
>
> I think the "why" is a simple bug.
Yes, I'll report it. (ticket #40255)
> I guess
>
> my ($fno, $eo) = ('utf16.txt', ':raw:encoding(UTF-16):crlf') ;
> open my $fho, ">$eo", $fno or die "open '$fno': $!" ;
> print $fho "\n" ;
>
> should work on Windows (don't have a Windows machine at hand to test
> it).
Yes, that writes the "platform-proper" 6 bytes.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 30 Aug 2006 02:50:33 -0700
From: himanshu.garg@gmail.com
Subject: Re: Returning raw xml in SOAP::Lite
Message-Id: <1156931433.134585.3780@i3g2000cwc.googlegroups.com>
Mark wrote:
> Dear Perl folks,
>
> Using Perl 5.8.7 and SOAP::Lite 0.69, consider please this small example
> from perl.com:
>
> -----------------
> #!perl -w
>
> use SOAP::Transport::HTTP;
>
> SOAP::Transport::HTTP::CGI
> -> dispatch_to('Demo')
> -> handle;
>
> package Demo;
>
> sub hi {
> return "hello, world";
> }
>
> sub bye {
> return "goodbye, cruel world";
> }
> -----------------
>
> Now, I got SOAP service set up like that. But what I want, instead of,
> say, return ("goodbye, cruel world");, is to return a RAW xml stream,
> complete with xml envelope and all (the xml is generated in another
> place), and parse that straight back to the client.
>
> Now, I tried several things; like setting outputxml => 1. Or this:
>
> $xml = SOAP::Data->type('xml' => $raw);
> return ($xml);
>
> (and yes, $raw is defined within the "Demo" package). But the result is
> always the same: SOAP::Lite returns an empty SOAP envelope. For the life
> of me I just cannot get SOAP::Lite to just output my raw data to the
> client.
>
> I am kinda new to SOAP, and quite obviously missing something. If someone
> has any ideas, I'll be glad to hear them.
>
Without having tried it myself looks like you want to override the
serializer method to be able to create your own envelopes. Consider
taking a look at this:-
http://cookbook.soaplite.com/#changing%20method%20name%20in%20response
> Thanks,
>
> - Mark
Thank You,
++imanshu.
------------------------------
Date: 30 Aug 2006 06:41:02 -0700
From: "Davy" <zhushenli@gmail.com>
Subject: set in Perl?
Message-Id: <1156945262.057367.244450@b28g2000cwb.googlegroups.com>
Hi all,
I used to use set (only contain one identical thing in one set) in
C++'s STL. I found set very useful that you can do something like
intersection. Is there something similar in Perl? Thanks!
Best regards,
Dav
------------------------------
Date: 30 Aug 2006 06:56:16 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: set in Perl?
Message-Id: <1156946176.221805.91400@e3g2000cwe.googlegroups.com>
Davy wrote:
> I used to use set (only contain one identical thing in one set) in
> C++'s STL. I found set very useful that you can do something like
> intersection. Is there something similar in Perl? Thanks!
You generally want to use a hash. The keys of a hash are distinct by
definition. If you tell us what your actual goal or problem is, we can
give you more specific assistance...
You may also be interested in:
perldoc -q intersection
my %unique;
for (qw/foo bar baz bar foo baz baz) {
$unique{$_} ++;
}
my @set = keys %unique;
# @set will contain three elements - foo, bar, and baz (in some random
order)
Paul Lalli
------------------------------
Date: 30 Aug 2006 02:40:31 -0700
From: himanshu.garg@gmail.com
Subject: Re: Stupid Q: How to preserve numeric characters
Message-Id: <1156930831.279060.292380@74g2000cwt.googlegroups.com>
> > goodarm@gmail.com wrote:
> >
> > > Gurus,
> > >
> > > I am relatively new to Perl so please bear with me. I am trying to
> > > write a simple scrapper for a non-English Web pages. For that purpose I
> > > am using HTML::TokeParser. Now, I am looking to extract some content I
> > > need and generate another HTML page (whch potentially will have notes
> > > in multiple languages). The pages I am scrapping are written using
> > > numeric characters, e.g. оду, when I am extracting
> > > them, then injecting into my HTML page they get converted into
> > > charaecters. All I want - is to preserve the original numeric
> > > characters, as it seems to be the easiest way to build my result page.
> > > How do I do that?
> > >
> > > A sample code:
> > >
> > > sub parseResponce($$) {
> > > my $data = shift;
> > > my $stream = new HTML::TokeParser($data);
> > >
> > > while (my $tag = $stream->get_tag("p")) {
> > > if (...) {
> > > $buff = $stream->get_trimmed_text("/p");
> > > }
> > > }
> >
> > You could try the method from its parent class
> >
> > $stream->attr_encoded( 1 );
> >
> > before calling get_tag.
> >
> > See Also:-
> >
> > http://search.cpan.org/~gaas/HTML-Parser-3.55/Parser.pm
> >
goodarm@gmail.com wrote:
> Thanks a lot for your reply,
>
> ...unfortunately, doesn't seem to work. From the documentation you
> refered to "By default, the attr and @attr argspecs will have general
> entities for attribute values decoded. Enabling this attribute leaves
> entities alone." - so I guess this applies to the attribute value,
> while I am trying to scrap the text of the node.
>
> In any case, I did as you suggested and got the same results.
>
> It's drving me crazy, there has to be a very simple way to do that...
Sorry about the wrong update.
HTML::PullParser doesn't "seem to" have a method for this. However
HTML::Parser has ways of doing it and apparently if you asked it to
send 'text' and not 'dtext' it will not decode the entities for you.
Thank You,
Himanshu.
------------------------------
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 9665
***************************************