[19642] in Perl-Users-Digest
Perl-Users Digest, Issue: 1837 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 28 11:10:31 2001
Date: Fri, 28 Sep 2001 08:10:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1001689811-v10-i1837@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Sep 2001 Volume: 10 Number: 1837
Today's topics:
Re: maths <mjcarman@home.com>
Re: maths (David Wall)
Re: Not sure what type of cgi script I need! Jon's not impressed
Re: Not sure what type of cgi script I need! <jurgenex@hotmail.com>
Re: Push into an array <mjcarman@home.com>
Re: Push into an array <Thomas@Baetzler.de>
Sending SNMP traps with Perl <josef.moellers@fujitsu-siemens.com>
Re: Sending SNMP traps with Perl <josef.moellers@fujitsu-siemens.com>
sizeof.ph <nobody@example.com>
Re: sizeof.ph <ilya@martynov.org>
Re: Sourcing Things in Perl ? (Anno Siegel)
Thanks guys <nobody@nowhere.com>
Trying to send SMS in perl <scott.bell1@ntlworld.com>
Re: Trying to send SMS in perl <ron@indra.com>
Re: Trying to send SMS in perl <Thomas@Baetzler.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Sep 2001 07:50:40 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: maths
Message-Id: <3BB47220.C29CBF7E@home.com>
Uri Guttman wrote:
>
> >>>>> "MC" == Michael Carman <mjcarman@home.com> writes:
>
> MC> That's okay, Uri doesn't seem to know where his shift key
> MC> is either.
>
> I DO KNOW WHERE IT IS. i just don't like to use it much for email
> and usenet. my web pages and docs are properly capitalized.
I stand corrected. ;)
-mjc
------------------------------
Date: Fri, 28 Sep 2001 14:40:24 -0000
From: darkon@one.net (David Wall)
Subject: Re: maths
Message-Id: <Xns912A6C77587F2darkononenet@207.126.101.97>
Michael Carman <mjcarman@home.com> wrote on 28 Sep 2001:
> Uri Guttman wrote:
>>
>> >>>>> "MC" == Michael Carman <mjcarman@home.com> writes:
>>
>> MC> That's okay, Uri doesn't seem to know where his shift key
>> MC> is either.
>>
>> I DO KNOW WHERE IT IS. i just don't like to use it much for email
>> and usenet. my web pages and docs are properly capitalized.
>
> I stand corrected. ;)
Ah. I suspected it was one of those quirks people have, like me preferring
"David" to the amputation "Dave" that so many people want to use (grrr), or
brian d foy not using caps or a . in his name, or like the difference
between Perl and perl, and the nonexistence of PERL.
--
David Wall
darkon@one.net
------------------------------
Date: Fri, 28 Sep 2001 12:14:55 GMT
From: Jon's not impressed
Subject: Re: Not sure what type of cgi script I need!
Message-Id: <3bb46978.1367927385@212.35.34.214>
On 27 Sep 2001 15:07:17 -0700, pilotsnipes@yahoo.com (Snipes) wrote:
>> \\ I would like to be able to have a "mailing list" or something similar,
>> \\ that the users can subscribe to which allows them to select which of
>> \\ the 6 files they want to receive to their own e-mail. When the e-mail
>> \\ arrives on Friday to my account, I would like the server to run a
>> \\ script/program that takes each attachment and "forwards" or
>> \\ "auto-responds" it to the people who are looking for it.
>>
>> Two things.
>> 1) I fail to see why you need a CGI program to do this stuff. It's
>> not impossible, but it sounds as useful as using the Queen Elizabeth II
>> to travel from Pittsburg to Chicago.
>
>Well seeing as you like to give the impression you are a perl coding
>God, it would be slighty more constructive to give an alternative
>rather than a poor attempted put down.
>
>> 2) What's got this to do with Perl? So far, you've done zero coding,
>> and apparently, you need handholding all the way. Perhaps you want
>> comp.programs.gimme.gimme.gimme.
>
>
>I fail to see any reason for your hostility to my question. Next time,
>try banging your keyboard with some thought, instead of banging your
>mum without.
In response to you both,
I fail to see what any of this has to do with Sendmail!
JG
------------------------------
Date: Fri, 28 Sep 2001 07:58:07 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Not sure what type of cgi script I need!
Message-Id: <3bb49002@news.microsoft.com>
<Jon's not impressed> wrote in message
news:3bb46978.1367927385@212.35.34.214...
> On 27 Sep 2001 15:07:17 -0700, pilotsnipes@yahoo.com (Snipes) wrote:
> In response to you both,
> I fail to see what any of this has to do with Sendmail!
Or as Abigail already stated: with Perl or even Perl modules for what it's
worth
jue
------------------------------
Date: Fri, 28 Sep 2001 07:48:56 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Push into an array
Message-Id: <3BB471B8.4A3E76A7@home.com>
Abigail wrote:
>
> Michael Carman (mjcarman@home.com) wrote on MMCMXLIX September MCMXCIII
> in <URL:news:3BB34DE4.42DC88CD@home.com>:
> &&
> && That's a very unperlish way of doing things.
> &&
> && @items = (0 .. 9);
>
> Useless use of parenthesis.
To the interpreter, perhaps. :)
> Parenthesis don't create a list, context does.
>
> @items = 0 .. 9;
A perfectly valid point, but I wasn't playing golf. I habitually use the
parens as a matter of personal style -- I like my lists to look like
lists.
[tangent]
I use parens in other places where they aren't necessary, too, if I feel
that it enhances the clarity or readability of the code. This is
especially true for code that somebody else might read.
-mjc
------------------------------
Date: Fri, 28 Sep 2001 16:18:06 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Push into an array
Message-Id: <l119rt4f4bc9m4t6ce0bsrqqdrc0526thd@4ax.com>
On Fri, 28 Sep 2001, Michael Carman <mjcarman@home.com> wrote:
>I use parens in other places where they aren't necessary, too, if I feel
>that it enhances the clarity or readability of the code. This is
>especially true for code that somebody else might read.
God beware that somebody might not only read but also understand our
code. I bet you're also advocating the use of comments for other
purposes than as a bookmark.
PS: :-)
PPS: http://baetzler.de/humor/real_programmers.html
SCNR,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Fri, 28 Sep 2001 13:27:02 +0200
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Sending SNMP traps with Perl
Message-Id: <3BB45E86.A46EDD46@fujitsu-siemens.com>
I'm desparately trying to send an SNMP trap with variables from a Perl
script.
The command
snmptrap -M/usr/share/snmp/mibs/:. -m<MIBname> \
<hostname> "public" 1.3.6.1.4.1.231 "" 6 1400 "" \
<var1name> 0 "astring" \
<var2name> 1 1234 \
<var3name> 1 5678
works and snmptrapd -P shows that the trap has been received and it also
shows the variables.
I'm trying to achieve the same using a Perl (5.6.0 on a 2.4.3 linux
kernel) script:
#! /usr/bin/perl -w
=
use SNMP; # Version '3.1.0'
use Sys::Hostname;
=
$oid =3D q/.1.3.6.1.4.1.231/;
$now =3D time();
$host =3D 0;
$chan =3D 0;
$id =3D 3;
$lun =3D 0;
=
my $sess =3D new SNMP::TrapSession(DestHost =3D>
'bounty.pdb.fsc.net',Community =3D> 'public');
=
$id1 =3D $oid . '.2.10.2.2.9.10.1';
$id2 =3D $oid . '.2.10.2.2.9.10.2';
$id3 =3D $oid . '.2.10.2.2.9.10.3';
$id4 =3D $oid . '.2.10.2.2.9.10.4';
$id5 =3D $oid . '.2.10.2.2.9.10.5';
$id6 =3D $oid . '.2.10.2.2.9.10.6';
our @vars =3D [[$id1, 0, "BOUNTY"],
[$id2, 1, $now],
[$id3, 1, $host],
[$id4, 1, $chan],
[$id5, 1, $id],
[$id6, 1, $lun]];
$vars =3D new SNMP::VarList(
["fscDdmTrapServerName", $id1, 0, "BOUNTY"],
["fscDdmTrapTime", $id2, 1, $now],
["fscDdmTrapPort", $id3, 1, $host],
["fscDdmTrapPath", $id4, 1, $chan],
["fscDdmTrapTarget", $id5, 1, $id],
["fscDdmTrapLun", $id6, 1, $lun]
);
@result =3D $sess->trap(
enterprise =3D> $oid,
generic =3D> "specific",
specific =3D> 1405
,\@vars # VARIABLES
);
No matter what I put in the line marked VARIABLES, as soon as I try
sending variables, I do not receive the trap. When I don't send
variables, I get the trap, but I need the variables!
Josef
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Fri, 28 Sep 2001 16:06:00 +0200
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Sending SNMP traps with Perl
Message-Id: <3BB483C8.54460889@fujitsu-siemens.com>
Josef M=F6llers wrote:
> =
> I'm desparately trying to send an SNMP trap with variables from a Perl
> script.
Apparently I was missing a line
$ENV{"MIBS"} =3D "SERVERVIEW-DUPLEXDATAMANAGER-MIB";
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Fri, 28 Sep 2001 12:37:50 +0100
From: "Dan Moinescu" <nobody@example.com>
Subject: sizeof.ph
Message-Id: <9p1nar$c5d$1@kermit.esat.net>
Hello everybody,
I need to "require sizeof.ph" in order to to use the setitimer syscall, but
the file is missing. I've run h2ph, but I still can't find it anywhere. Can
anyone tell me how I can generate it, please?
I'm using Perl 5.005_03 on RedHat Linux 6.2.
Thanks,
Dan.
------------------------------
Date: 28 Sep 2001 18:31:50 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: sizeof.ph
Message-Id: <87n13fjsix.fsf@abra.ru>
>>>>> On Fri, 28 Sep 2001 12:37:50 +0100, "Dan Moinescu" <nobody@example.com> said:
DM> Hello everybody,
DM> I need to "require sizeof.ph" in order to to use the setitimer syscall, but
DM> the file is missing. I've run h2ph, but I still can't find it anywhere. Can
DM> anyone tell me how I can generate it, please?
Does your system have sizeof.h installed? h2ph can generate .ph files
only from installed header files.
DM> I'm using Perl 5.005_03 on RedHat Linux 6.2.
BTW Are you sure that you are looking for correct file? I could not
find any RPM packages which contain sizeof.h (I searched with RPM find
on www.redhat.com).
And mine Debian system which has most standart header files installed
also doesn't have this file.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: 28 Sep 2001 14:24:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Sourcing Things in Perl ?
Message-Id: <9p2162$848$1@mamenchi.zrz.TU-Berlin.DE>
According to Martien Verbruggen <mgjv@tradingpost.com.au>:
> On Thu, 27 Sep 2001 09:51:24 +0100,
> slightlysprintingdog@ntlworld.com <slightlysprintingdog@ntlworld.com> wrote:
[...]
> > system ( "source $sourceme" );
>
> Some shells have that as a builtin command, but I haven't seen it as an
> external command on any system I've worked on.
It can't be an external program (under Unix). Its purpose is to
interpret commands in the current (shell-) process. An external
command would always be run in a process of its own.
Just a side note.
Anno
------------------------------
Date: Fri, 28 Sep 2001 23:27:36 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Thanks guys
Message-Id: <dT_s7.2841$812.1942@newsfeeds.bigpond.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:eho8rto3cdu4c1i56tnqmijuulttv65q35@4ax.com...
> Thomas Bätzler wrote:
>
> >>However adding 'use strict' gives the error: Global symbol "%in"
requires
> >>explicit package name at ./stock.cgi line 10.
> >[...]
> >>I've tried adding 'my %in' but no values are returned.
>
> Of course not, 'my' limits the scope of %in to your script file, so
> cgi-lib.pl can't reach it.
>
> >Try "our %in;" and put the declaration above your require statement.
>
> or:
>
> use vars '%in';
>
> if running 5.005 or earlier (or later, too...)
>
use vars '%in' worked. I'm obviously confused about scoping.
gtoomey
------------------------------
Date: Fri, 28 Sep 2001 14:34:42 +0100
From: "Scott Bell" <scott.bell1@ntlworld.com>
Subject: Trying to send SMS in perl
Message-Id: <pM_s7.7666$3Q5.1372095@news2-win.server.ntlworld.com>
I got some code from
http://search.cpan.org/doc/AWRIGLEY/Net-SMS-Web-0.002/lib/Net/SMS/Genie.pm
that lets me send SMS using Genie via Perl. This is what I have:
my $sms = Net::SMS::Genie->new(
autotruncate => 1,
username => 'mylogin',
password => 'mypassword',
recipient => 'mymobile',
subject => 'a test',
message => 'a test message',
);
$sms->verbose( 1 );
$sms->message( 'a different message' );
print "sending message to mobile number ", $sms->recipient();
$sms->send_sms();
----------------------------------------------------------------------------
-----------------------
When I run it I get this error:
Can't locate object method "new" via package "Net::SMS::Genie" (perhaps you
forg
ot to load "Net::SMS::Genie"?) at sms.pl line 2.
What do I need to do? I guess I need a module in my perl directory, but I
don't know where I have to get it from.
------------------------------
Date: Fri, 28 Sep 2001 07:45:20 -0600
From: Ron Reidy <ron@indra.com>
Subject: Re: Trying to send SMS in perl
Message-Id: <3BB47EF0.AD169052@indra.com>
Scott Bell wrote:
>
> I got some code from
> http://search.cpan.org/doc/AWRIGLEY/Net-SMS-Web-0.002/lib/Net/SMS/Genie.pm
> that lets me send SMS using Genie via Perl. This is what I have:
>
> my $sms = Net::SMS::Genie->new(
> autotruncate => 1,
> username => 'mylogin',
> password => 'mypassword',
> recipient => 'mymobile',
> subject => 'a test',
> message => 'a test message',
> );
>
> $sms->verbose( 1 );
> $sms->message( 'a different message' );
> print "sending message to mobile number ", $sms->recipient();
>
> $sms->send_sms();
>
> ----------------------------------------------------------------------------
> -----------------------
>
> When I run it I get this error:
>
> Can't locate object method "new" via package "Net::SMS::Genie" (perhaps you
> forg
> ot to load "Net::SMS::Genie"?) at sms.pl line 2.
>
> What do I need to do? I guess I need a module in my perl directory, but I
> don't know where I have to get it from.
Look at CPAN (www.perl.com).
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Fri, 28 Sep 2001 16:06:57 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Trying to send SMS in perl
Message-Id: <kb09rtkh424d3f6uoi8tk1sprd5ja182ae@4ax.com>
On Fri, 28 Sep 2001, "Scott Bell" <scott.bell1@ntlworld.com> wrote:
>I got some code from
>http://search.cpan.org/doc/AWRIGLEY/Net-SMS-Web-0.002/lib/Net/SMS/Genie.pm
>that lets me send SMS using Genie via Perl. This is what I have:
[...]
>When I run it I get this error:
>Can't locate object method "new" via package "Net::SMS::Genie" (perhaps you
>forgot to load "Net::SMS::Genie"?) at sms.pl line 2.
You need to "use Net::SMS::Genie;" if you have the module already
installed. So if this doesn't help you, you need to install the module
on your machine. Your Perl should include a man page on module
installation - try perldoc perlmodinstall.
This is mostly geared towars Unix users, though - if you're on a
Windows system and use ActiveState's Perl port, you should also check
their web pages - if memory serves me right, they do give some
pointers about where to find an unbundled nmake and how to install
Perl only modules manually.
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
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.
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 1837
***************************************