[15695] in Perl-Users-Digest
Perl-Users Digest, Issue: 3108 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 20 18:05:36 2000
Date: Sat, 20 May 2000 15: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)
Message-Id: <958860311-v9-i3108@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 20 May 2000 Volume: 9 Number: 3108
Today's topics:
Charts & CGI <richard@avocation.demon.co.uk>
Re: Charts & CGI <jeff@vpservices.com>
comparing dates <cure@texas.net>
Re: comparing dates <asound40NOasSPAM@hotmail.com.invalid>
Re: comparing dates <anmcguire@ce.mediaone.net>
Re: deleting from a hash by reference... (Ilya Zakharevich)
Re: Exec <tony_curtis32@yahoo.com>
file locking <cure@texas.net>
Re: file locking <godzilla@la.znet.com>
Re: file locking <anmcguire@ce.mediaone.net>
Re: file locking <flavell@mail.cern.ch>
Re: file locking (Tad McClellan)
HTML in Perl Script ? <lancelotboyle@hotmail.com>
Re: HTML in Perl Script ? <lancelotboyle@hotmail.com>
Perl and Win32 Common Dialogs - Is it possible? <evilbeaver.picksoft@NOSPAMzext.net>
Re: Perl and Win32 Common Dialogs - Is it possible? <bwalton@rochester.rr.com>
Re: Perl and Win32 Common Dialogs - Is it possible? <evilbeaver.picksoft@NOSPAMzext.net>
Re: Perl and Win32 Common Dialogs - Is it possible? <asound40NOasSPAM@hotmail.com.invalid>
Re: Perl for Win32 <srmalloy@home.com>
Re: perl for windows 95 <jeff@vpservices.com>
perl to lunch "Save As" browser window ??? (teety)
Re: perl to lunch "Save As" browser window ??? <tony_curtis32@yahoo.com>
Re: printing all variables! <bwalton@rochester.rr.com>
Reintegrating win into CPAN (Was Re: What is the CPAN m <jeff@vpservices.com>
Re: Reintegrating win into CPAN (Was Re: What is the CP <elaine@chaos.wustl.edu>
Re: SNMP via Perl mcnuttj@missouri.edu
Re: SNMP via Perl mcnuttj@missouri.edu
Re: Sorry... <jeff@vpservices.com>
STDOUT (Rob Zwartjes)
Re: the use of $_ <elaine@chaos.wustl.edu>
timeout a perl script? <qbasicguy@unitedstates.com>
ugly mysql call <john@princenaseem.com>
Re: ugly mysql call <jeff@vpservices.com>
Re: ugly mysql call <john@princenaseem.com>
Re: What is the CPAN module repository (url) name that <elaine@chaos.wustl.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 20 May 2000 16:46:31 +0100
From: "Richard" <richard@avocation.demon.co.uk>
Subject: Charts & CGI
Message-Id: <958837789.15930.0.nnrp-09.d4e489f6@news.demon.co.uk>
I'd like to use a Perl script to manipulate some numeric variables and then
output in a chart that I can display on a web page. I don't know how (or
even if) Perl can do this....
Can someone please point me in the right direction?
Thanks,
Richard.
------------------------------
Date: Sat, 20 May 2000 08:53:02 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Charts & CGI
Message-Id: <3926B4DE.FE726234@vpservices.com>
Richard wrote:
>
> I'd like to use a Perl script to manipulate some numeric variables and then
> output in a chart that I can display on a web page. I don't know how (or
> even if) Perl can do this....
Use the GD module and its associates e.g. GD::Chart.
--
Jeff
------------------------------
Date: Sat, 20 May 2000 15:00:50 -0700
From: Cure <cure@texas.net>
Subject: comparing dates
Message-Id: <39270B11.F98A3D5@texas.net>
how can i compare the dates
example
31-12-99 is less than 1-1-2000
99 == 2000
------------------------------
Date: Sat, 20 May 2000 13:56:04 -0700
From: asound <asound40NOasSPAM@hotmail.com.invalid>
Subject: Re: comparing dates
Message-Id: <098b881c.c24128da@usw-ex0104-033.remarq.com>
In article <39270B11.F98A3D5@texas.net>, Cure <cure@texas.net>
wrote:
>how can i compare the dates
>example
> 31-12-99 is less than 1-1-2000
this works if you don't have dates like 1-1-00
#!/usr/bin/perl -w
my $date1="31-12-99";
my $date2="1-1-2000";
$_=join "",
reverse map {sprintf "%04i",$_ } split /-/ for ($date1, $date2);
print "$date1\n" if ($date1<$date2);
HTH
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Sat, 20 May 2000 16:04:41 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: comparing dates
Message-Id: <Pine.LNX.4.20.0005201559490.9382-100000@hawk.ce.mediaone.net>
On Sat, 20 May 2000, Cure wrote:
+how can i compare the dates
+example
+ 31-12-99 is less than 1-1-2000
+99 == 2000
perldoc -q date
=head2 How can I compare two dates and find the difference?
Although your example is simple enough where you could
also just "roll your own". By turning both of those
strings into DTS's ( date / time stamp ), you can just
compare interger sizes.
YYYYMMDDhhmmss
20001001120011 > 19991001120011
If you get my drift.
Regards,
anm
--
/*-------------------------------------------------------.
| Andrew N. McGuire |
| anmcguire@ce.mediaone.net |
`-------------------------------------------------------*/
------------------------------
Date: 20 May 2000 18:52:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: deleting from a hash by reference...
Message-Id: <8g6mu2$9af$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<stdenton@my-deja.com>],
who wrote in article <8fuiil$gd2$1@nnrp1.deja.com>:
> IMHO, he is prematurely optimizing for space, but OTOH he knows the
> data better than I. Anyway, one of my suggestions is to take the 32-
> bit CRC of the message text and use that as the hash key, tossing the
> message. The number of potential messages is well less that 4G, so
> collisions shouldn't be much of a problem.
By birthdays paradox, 32-bit collisions will become more typical than
not on circa 100K samples.
And:
why one cannot delete() things by reference?
Because the same value can be a value in many different hashes, and/or of
many keys of the same hash.
Ilya
------------------------------
Date: 20 May 2000 10:42:41 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Exec
Message-Id: <87hfbtw7m6.fsf@limey.hpcc.uh.edu>
>> On Sat, 20 May 2000 12:46:47 +0200,
>> "Michiel Lankamp" <lankamp@casema.net> said:
> Which command must I use to execute a shell command,
> while continuing the perl-script? Why? I want to
perldoc -f system
perldoc perlipc (much more interesting scenarios)
> execute a shell command using my browser, I don't want
> to see the result of the executed command!!
Your (web ?) browser is very unlikely to be able to run
perl programs. I suspect you want to run something on the
server with SSI or CGI, in which case
comp.infosystems.www.authoring.cgi might be a better venue
for this thread.
hth
t
------------------------------
Date: Sat, 20 May 2000 13:52:20 -0700
From: Cure <cure@texas.net>
Subject: file locking
Message-Id: <3926FB04.A92D4C95@texas.net>
when I use the flock function can i use the params instead of the
numbers whats the difference
example flock(FH,2);
flock(FH,LOCK_EX); whats the difference between the two
and does perl automatically unlock the filehandle for you
bye the way flock(FH,2) this locks the filehandle right?
------------------------------
Date: Sat, 20 May 2000 12:34:39 -0700
From: "Godzilla!" <godzilla@la.znet.com>
Subject: Re: file locking
Message-Id: <3926E8CF.D71D59E3@la.znet.com>
Cure wrote:
> when I use the flock function can i use the params instead of the
> numbers whats the difference
> example flock(FH,2);
> flock(FH,LOCK_EX); whats the difference between the two
> and does perl automatically unlock the filehandle for you
> bye the way flock(FH,2) this locks the filehandle right?
flock (FILE_HANDLE, 2)
flock (FILE_HANDLE, 8)
Both are old fashion strict methods of
locking and unlocking a file, respectfully.
Today, there are different formats for this
but accomplish the same. I will defer to
others to comment upon this.
I will comment I have extensively tested
lock / unlock to discover if I can cause
deliberate corruption of a file. I have
yet to successfully accomplish this. My
test conditions are a cgi-program with
multiple users, six to twelve users,
hitting my program as close as possible
to the same moment and accessing a file
which ranges in size from five-hundred
kilobytes to one megabyte. Under these
tests, I locked, unlocked, then continued
processing the file with several routines
including a re-write of the entire file
based on user input. No corruption took
place, after extensive testing.
It appears UNIX style servers, more recent
versions, have a built-in safety function
to prevent corruption by buffer conflicts
during a write. Note, this is an assumption
based on testing and on comments by others
about this safety feature. I do not know
anything about the actual mechanics of
what UNIX does, but it does appear, to
corrupt a file under lock / unlock conditions
is very difficult, even when deliberately
planned via testing.
Might be with today's newer systems, at
least with UNIX, lock and unlock problems
are over-played. I would be interested to
read comments of others whom have tried
to deliberately corrupt a file while
using lock and unlock with a delayed
closure of a file handle.
Godzilla!
------------------------------
Date: Sat, 20 May 2000 15:09:28 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: file locking
Message-Id: <Pine.LNX.4.20.0005201504200.8437-100000@hawk.ce.mediaone.net>
On Sat, 20 May 2000, Cure wrote:
+when I use the flock function can i use the params instead of the
+numbers whats the difference
+example flock(FH,2);
+ flock(FH,LOCK_EX); whats the difference between the two
Good goo man, don't you ever do any research for yourself?
perldoc Fcntl
+and does perl automatically unlock the filehandle for you
Yep. When the FH is closed.
+bye the way flock(FH,2) this locks the filehandle right?
perldoc -f flock
Regards,
anm
--
/*-------------------------------------------------------.
| Andrew N. McGuire |
| anmcguire@ce.mediaone.net |
`-------------------------------------------------------*/
------------------------------
Date: Sat, 20 May 2000 22:11:27 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: file locking
Message-Id: <Pine.GHP.4.21.0005202204080.3170-100000@hpplus01.cern.ch>
On Sat, 20 May 2000, Cure wrote:
> when I use the flock function can i use the params instead of the
> numbers whats the difference
> example flock(FH,2);
> flock(FH,LOCK_EX); whats the difference between the two
perldoc -f flock
OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, possibly combined
with LOCK_NB. These constants are traditionally valued 1, 2, 8 and
4, but you can use the symbolic names if import them from the Fcntl
module,
> and does perl automatically unlock the filehandle for you
When you close the file, it will automatically be unlocked.
Don't unlock a file explicitly (unless you know exactly what you are
doing).
> bye the way flock(FH,2) this locks the filehandle right?
There's a perfectly fine tutorial on all this,
perldoc perlopentut
By asking FAQs here you are risking being ignored by those who know
the FAQs, while getting fed all kinds of nonsense by those who don't
(if you can work out who I mean, hint hint).
You might also benefit by reading some of the solutions in Randal's
WebTechniques articles.
--
Partake of distilled wisdom of Usenet - read the FAQs.
Before you ask.
------------------------------
Date: Sat, 20 May 2000 16:47:42 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: file locking
Message-Id: <slrn8idufe.rj.tadmc@magna.metronet.com>
On Sat, 20 May 2000 12:34:39 -0700, Godzilla! <godzilla@la.znet.com> wrote:
>Cure wrote:
>
>flock (FILE_HANDLE, 2)
>flock (FILE_HANDLE, 8)
>
>Both are old fashion strict methods of
>locking and unlocking a file, respectfully.
^^^^^^^^^^^^
If you don't talk nice to your filehandles they won't do what you ask?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 20 May 2000 05:54:58 +0100
From: "Lance Boyle" <lancelotboyle@hotmail.com>
Subject: HTML in Perl Script ?
Message-Id: <8g5717$pib$1@plutonium.btinternet.com>
Newbie Question - Beware of the Idiot (Me) !!
I use SSI to display the current month of a perl calender script within a
web page but when I move to the next month it no longer becomes a SSI and
just displays the perl script calender. All my lovely colours and text boxes
disappear and I get quite depressed.
However, is it possible to instead of using SSI, take all the HTML from the
web page and put it in the perl script so the calendar appears in the same
place as before but this time when I change month, the page stays cool and
mellow ?
I have tried this theory without success but may need to change a few
things. Any ideas ?
------------------------------
Date: Sat, 20 May 2000 08:59:29 +0100
From: "Lance Boyle" <lancelotboyle@hotmail.com>
Subject: Re: HTML in Perl Script ?
Message-Id: <8g5gqe$e9h$1@plutonium.btinternet.com>
Forget my post.
I have found a webcal forum to post my question.
Cheers
------------------------------
Date: Sat, 20 May 2000 18:01:45 GMT
From: "The Evil Beaver" <evilbeaver.picksoft@NOSPAMzext.net>
Subject: Perl and Win32 Common Dialogs - Is it possible?
Message-Id: <dqAV4.217212$Kv2.306975@quark.idirect.com>
Is there a way that I could use the Open and Save common dialogs from
Windows in my Perl programs?
-----
The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
-- Remove NOSPAM to e-mail me.
This message ROT-13 encrypted twice for extra security.
------------------------------
Date: Sat, 20 May 2000 18:14:04 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Perl and Win32 Common Dialogs - Is it possible?
Message-Id: <3926D4F7.FD6D62B@rochester.rr.com>
The Evil Beaver wrote:
>
> Is there a way that I could use the Open and Save common dialogs from
> Windows in my Perl programs?
>
> -----
> The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
...
One way:
use Tk;
$mw=new MainWindow;
$file=$mw->getOpenFile;
#do stuff with $file
...
MainLoop;
--
Bob Walton
------------------------------
Date: Sat, 20 May 2000 19:39:20 GMT
From: "The Evil Beaver" <evilbeaver.picksoft@NOSPAMzext.net>
Subject: Re: Perl and Win32 Common Dialogs - Is it possible?
Message-Id: <IRBV4.217273$Kv2.307727@quark.idirect.com>
Thanks. I guess then that $file is the name of the file, or name and
directory, or what?
--
The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
-- Remove NOSPAM to e-mail me.
This message ROT-13 encrypted twice for extra security.
Bob Walton <bwalton@rochester.rr.com> wrote...
> The Evil Beaver wrote:
> >
> > Is there a way that I could use the Open and Save common dialogs from
> > Windows in my Perl programs?
> >
> > -----
> > The Evil Beaver <evilbeaver.picksoft@NOSPAMzext.net>
> ...
> One way:
>
> use Tk;
> $mw=new MainWindow;
> $file=$mw->getOpenFile;
> #do stuff with $file
> ...
> MainLoop;
> --
> Bob Walton
>
------------------------------
Date: Sat, 20 May 2000 14:07:33 -0700
From: asound <asound40NOasSPAM@hotmail.com.invalid>
Subject: Re: Perl and Win32 Common Dialogs - Is it possible?
Message-Id: <13364df0.c540f668@usw-ex0104-033.remarq.com>
In article <IRBV4.217273$Kv2.307727@quark.idirect.com>, "The Evil
Beaver" <evilbeaver.picksoft@NOSPAMzext.net> wrote:
>Thanks. I guess then that $file is the name of the file, or name
and
>directory, or what?
Here is a little modified program which answers your question
use Tk;
$mw=new MainWindow;
$file=$mw->getOpenFile;
#do stuff with $file
print $file;
MainLoop;
HTH
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Sat, 20 May 2000 19:49:18 GMT
From: Sean Malloy <srmalloy@home.com>
Subject: Re: Perl for Win32
Message-Id: <y+smOXZisWlHDTUjc20K7pjUg6ei@4ax.com>
amerar@unsu.com (Arthur Merar) wrote:
>I am having trouble locating Perl for Windows 98. Where can I get a
>copy?
Go to http://www.perl.com/ and click on the 'Where can I find the
latest version?' link. Follow the appropriate links to download
locations (depending on whether you want source or binary).
If you just want binary, go to http://www.activestate.com/ActivePerl/
and download it directly.
--
Sean R. Malloy | American Non Sequitur
Naval Medical Center | Society
San Diego, CA 92134-5000 |
srmalloy@home.net | "We may not make sense,
srmalloy@nmcsd.med.navy.mil | but we do like pizza"
FORMAL NOTICE: unsolicited commercial email will be read
at a charge of $500 per item. Receipt of such email shall
be considered to constitute acceptance of contract, and
will be billed immediately.
------------------------------
Date: Sat, 20 May 2000 08:34:44 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: perl for windows 95
Message-Id: <3926B094.B79897C6@vpservices.com>
Call Expedient wrote:
>
> Can someone give me an overall view of the process I should follow to test my
> simple program? What program do I use to actually write my program? Once I
> have written my program, how do I go about running it to see if it works?
Most of your questions are answered somewhere in the ActivePerl
documentation that comes with Perl.
(start-menu/programs/activeperl/online-documentation). But it does kind
of jump in in the middle without describing those very basic questions
up front.
You write the Perl program in any text editor or word processor that can
save text as a plain ascii file. I use emacs but notepad will work
too. Once you have written the program, open a DOS command shell and
type in "perl filename" where filename is the name of the text file you
saved your program in. If you aren't in the same directory where you
saved the file, either cd there first or include the path to it in the
filename. If you are interested in writing CGI scripts in addition to
other kinds of Perl scripts and you'd like to see how they actually
operate in a browser environment, you'll need to get webserver software
which is free and easily installable. There is more information on that
and everything else I've mentioned in the documentation.
Good luck!
--
Jeff
------------------------------
Date: 20 May 2000 17:39:12 GMT
From: teety99@hotmail.com (teety)
Subject: perl to lunch "Save As" browser window ???
Message-Id: <8F3B74D8teety99hotmailcom@202.44.204.37>
I have links in My HTML Page.This link is a perl script link.when click
on this link.The perl will do something by following the script (don't care
this).
And after at I want perl script to lunch a "Save As" browser window.For
save some file.
How I lunch this "Save As" window ???
Thanks In Advance
Tee Santipong
------------------------------
Date: 20 May 2000 14:31:02 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: perl to lunch "Save As" browser window ???
Message-Id: <87r9axyq6h.fsf@limey.hpcc.uh.edu>
>> On 20 May 2000 17:39:12 GMT,
>> teety99@hotmail.com (teety) said:
> I have links in My HTML Page.This link is a perl
> script link.when click on this link.The perl will do
> something by following the script (don't care this).
^^
Not sure what this means...
> And after at I want perl script to lunch a "Save As"
> browser window.For save some file. How I lunch this
> "Save As" window ???
I'm afraid you can't.
You can't force a browser to engage a specific behaviour
determined by you from the server-side.
For more information you should consult the newsgroups
comp.infosystems.www.authoring.cgi and for whichever http
server you are using (this is not perl-specific).
hth
t
------------------------------
Date: Sat, 20 May 2000 18:48:00 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: printing all variables!
Message-Id: <3926DCEB.DDC471D4@rochester.rr.com>
Baris wrote:
>
> Hello,
> Can I print out all the global variables (or all variables) inside my perl
> program at some point? Or can I get that info somehow?
> Baris.
...
One way is: Run perl with the -d switch to run the debugger. Step or
otherwise get to the appropriate point in the program, and issue the V
command to the debugger.
--
Bob Walton
------------------------------
Date: Sat, 20 May 2000 12:40:59 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <3926EA4B.8371ED6B@vpservices.com>
Elaine Ashton wrote:
>
> in article 392569e9.6500036@news2.newscene.com, Eric Liao at
> ekliao@mediaone.net quoth:
>
> > Does it exist? THanks.
>
> http://www.activestate.com/ActivePerl/docs/faq/ActivePerl-faq2.html
>
> e.
From earlier posts it's evident Eric already knows this. He was asking
about unicode.pm and where to find it since he couldn't nmake it from
CPAN and knew it wasn't on AS.
So it is acutally an interesting question. There is no equivalent of
CPAN for windoze .ppd files, or for that matter for linux .rpm files.
AS lists only their own .ppd files. Others have begun to make
repositories, for example, Simon Oliver has developed an excellent
repository specializing in database ppds at
http://www.bi.umist.ac.uk/packages. Simon's repository is listed on
www.perl.com, but not on CPAN, AFAIK. And if one uses cpan.search.org,
the .ppd files are, of course, not listed. So should CPAN itself
consider including .ppd files, allowing authors to upload them along
with the .gz files? Or even more radical -- should makeMaker or h2xs
or something be modified in such a way that one could create a
Makefile.PL that would accept a switch telling it whether it should run
in makefile mode or ppd mode and if the later to essentially run ppm
rather than creating a makefile.
Sorry for the rambles, just some questions I have had in the back of my
mind about how to make the CPAN and installation process more similar
for all users. There are still a zillion readme files out there that
make no mention of ppm and therefore many newbies who go to CPAN and
then come here asking what the heck make is, or why it doesn't work for
them.
--
Jeff
------------------------------
Date: Sat, 20 May 2000 21:02:27 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Reintegrating win into CPAN (Was Re: What is the CPAN module repository (url) name that can beused for PPM/VPM?)
Message-Id: <B54C75A2.466C%elaine@chaos.wustl.edu>
in article 3926EA4B.8371ED6B@vpservices.com, Jeff Zucker at
jeff@vpservices.com quoth:
> From earlier posts it's evident Eric already knows this. He was asking
> about unicode.pm and where to find it since he couldn't nmake it from
> CPAN and knew it wasn't on AS.
Ah...his question wasn't clear. The perlmodinstall.pod should detail this
reasonably well iirc.
> So it is acutally an interesting question. There is no equivalent of
> CPAN for windoze .ppd files, or for that matter for linux .rpm files.
> AS lists only their own .ppd files. Others have begun to make
> repositories, for example, Simon Oliver has developed an excellent
> repository specializing in database ppds at
> http://www.bi.umist.ac.uk/packages. Simon's repository is listed on
> www.perl.com, but not on CPAN, AFAIK. And if one uses cpan.search.org,
> the .ppd files are, of course, not listed. So should CPAN itself
> consider including .ppd files, allowing authors to upload them along
> with the .gz files? Or even more radical -- should makeMaker or h2xs
> or something be modified in such a way that one could create a
> Makefile.PL that would accept a switch telling it whether it should run
> in makefile mode or ppd mode and if the later to essentially run ppm
> rather than creating a makefile.
:) An author, to my knowledge, can upload anything they wish. However, it
may cross a line between source and package. CPAN doesn't carry most of the
ports of Perl due to size and freshness concerns which could also be applied
to PPDs and RPMs. However, it would be nice to centralise them and make them
more easily available. A compromise for the nonce might be to make mention
of them and where they are found. Perhaps search could have a PPD section
too.
As far as h2xs etc, the idea of having PPD-esque behaviour for modules has
been tossed around with possibly even one person actually doing something
about it. I'm not sure that having a 'switch' of sorts would be doable
though it might be worth a look.
> Sorry for the rambles, just some questions I have had in the back of my
> mind about how to make the CPAN and installation process more similar
> for all users. There are still a zillion readme files out there that
> make no mention of ppm and therefore many newbies who go to CPAN and
> then come here asking what the heck make is, or why it doesn't work for
> them.
It is an interesting problem since it would seem that the PPM/RPM are
causing some confusion for module users and having a single method for
installing modules regardless of platform is, perhaps, a very attractive
feature.
e.
------------------------------
Date: 20 May 2000 17:28:52 GMT
From: mcnuttj@missouri.edu
Subject: Re: SNMP via Perl
Message-Id: <8g6i0k$gfb$1@dipsy.missouri.edu>
Not quite.
If I understand get_bulk_request properly, it cat get many single instances of many variables, and n instances
of m variables in one request.
I only need to make one request, because I already know the MIB and the instance ID. The problem is, I know
of know way to query a specific instance ID (at least, not a way that works). As I understand it, I would
have to know the previous IID and do a "getnext" on that one to be able to do it properly.
Either that, or pick an instance that is previous to the one I want, whether it exists or not, so long as the
"pseudo-previous" instance is before the one I want lexico-speaking.
Problem is, I haven't been able to do that in real life.
--J
Paul Eckert <peckert@epicrealm.com> wrote:
: Dear McNuttJ:
: What you want is implemented in SNMP v2 and is called get_bulk_request.
: Rather
: than doing a getnext which fails under the circumstances you report, use the
: SNMP::get_bulk_request call. Salient part of the manpage shown below:
: get_bulk_request() - send a SNMPv2 get-bulk-request to the remote agent
: Blocking
: $response = $session->get_bulk_request(
: [-nonrepeaters => $nonrepeaters,]
: [-maxrepetitions => $maxrepetitions,]
: -varbindlist => \@oids
: );
: Non-blocking
: $ok = $session->get_bulk_request(
: [-callback => sub {},]
: [-delay => $seconds,]
: [-nonrepeaters => $nonrepeaters,]
: [-maxrepetitions => $maxrepetitions,]
: -varbindlist => \@oids
: );
: Give it a try!
: Paul
: mcnuttj@missouri.edu wrote:
:>
:> Okay, guys, I think I've got a real winner here.
:>
:> I'm trying to query a *specific* instance of a *specific* MIB using the
:> UCD SNMP perl module (UCD SNMP 4.1.1).
:>
:> If I do this:
:>
:> ######## BEGIN CODE
:> # Create a socket.
:> $sess = new SNMP::Session(DestHost => $ip, Community => $comm);
:>
:> # This is the MIB to query the layer 2 forwarding table of a switch.
:> $mib = 'dot1dTpFdbPort';
:>
:> # This is the object used for multi-instance queries.
:> $vb = new SNMP::Varbind([$mib]);
:>
:> # Set the instance to the decimal equivalent of the MAC address I'm
:> # looking for (that's how they're stored in the forwarding table, in
:> # numeric order).
:> $vb->[$SNMP::Varbind::iid_f] = '8.0.32.47.24.108';
:>
:> # Get the next instance of the MIB.
:> $var = $sess->getnext($vb);
:> ######## END CODE
:>
:> If I do all that, what I get is the instance of the MIB that's immediately
:> *after* the one I'm looking for.
:>
:> Now, the intelligent person would say, "Okay, just subtract one and you'll
:> get the one you're looking for." Nay, not so, my friends. I *still* get
:> the one *after*. Not until I reduced the *third* octet to less than *10*
:> was I able to get the one I was looking for.
:>
:> The problem is, I can't make any sense of that. Therefore, the only
:> reliable algorithm I have for searching the forwarding table for an
:> arbitrary MAC address is to begin at the beginning and just go until I hit
:> the one I want. This is pretty slow when the table is large. The idea
:> was to speed up this process (sometimes it will have to run over a modem
:> link).
:>
:> Any ideas?
:>
:> For reference, the instances in the table immediately surrounding the one
:> I want (in *this* case) are as follows:
:>
:> 8.0.9.151.248.74
:> 8.0.9.186.64.8
:> 8.0.17.12.111.225
:> 8.0.32.27.47.108 (This is the one I want)
:> 8.0.105.2.216.245
:> 8.0.105.2.252.38
:> 8.0.105.2.252.237
:>
:> (Apparently, the "8.0.105" OUI is a popular vendor. I haven't bothered to
:> look it up.)
:>
:> Anyway, any ideas, folks?
:>
:> Thanks!
:>
:> --J
: --
: Paul Eckert
: Sr. Software Engineer
: Epicrealm Inc.
: 1651 N. Glenville Dr., Suite 212
: Richardson, TX 75081
: (972) 479-0135 x300
: peckert@epicrealm.com
------------------------------
Date: 20 May 2000 17:31:39 GMT
From: mcnuttj@missouri.edu
Subject: Re: SNMP via Perl
Message-Id: <8g6i5r$gfb$2@dipsy.missouri.edu>
brian moore <bem@news.cmc.net> wrote:
: Well, you did ask for the -next- one.
<grin>
:> Now, the intelligent person would say, "Okay, just subtract one and you'll
:> get the one you're looking for." Nay, not so, my friends. I *still* get
:> the one *after*. Not until I reduced the *third* octet to less than *10*
:> was I able to get the one I was looking for.
: Sounds like a sparse table.
?? More info please.
: Use '$var = $sess->get($vb);'
Yeah, that would seem the obvious thing to try - and I'm going to try it again to make sure I'm not nuts - but
the last time I tried it it returned NULL. <grrr...>
--J
------------------------------
Date: Sat, 20 May 2000 08:04:47 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Sorry...
Message-Id: <3926A98F.10A8DBF6@vpservices.com>
Lobo wrote:
>
> I don't konw why, but my newsreader didn't show me your answers for my
> "Perl for Windows Question".
>
> Sorry for the spam.
No problem, it was probably your news *server* rather than your news
*reader* and that happens to just about everyone. That's one of the
reasons it's important to know about the archives at www.deja-news.com.
--
Jeff
------------------------------
Date: 20 May 2000 21:17:20 GMT
From: rzwartje@robz.HOSTNAME (Rob Zwartjes)
Subject: STDOUT
Message-Id: <slrn8ie11l.hla.rzwartje@rob.home.nl>
Hello perlers,
I have a problem mixing printing to screen and printer. The following program
is a example of what I want.
#! /usr/bin/perl -w
sub print1 {
open (STDOUT,"| lpr") or die "Can't teeing: $!";
for ($Counter=0; $Counter < 9 ; $Counter++) {
print "hello\n";
}
close STDOUT;
}
sub print2 {
open (STDOUT,"| lpr") or die "Can't teeing: $!";
for ($Counter=0; $Counter < 9 ; $Counter++) {
print "hello\n";
}
close STDOUT;
}
print "First print\n";
&print1;
sleep(20); # delaying the next print doesn't work
print "Second print\n";
&print2;
The error I get is :
print on closed filehandle main::STDOUT at ./printing 22
I think that everything is going to fast, so I put a sleep in it. But that
doesn't work. How can I overcome this problem on printing to a closed
filehandle
Thanks in advance,
Rob
------------------------------
Date: Sat, 20 May 2000 18:49:30 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: the use of $_
Message-Id: <B54C5679.465D%elaine@chaos.wustl.edu>
in article 3925CFBC.DC4E4D97@la.znet.com, Kiralynne Schilitubi at
callgirl@la.znet.com quoth:
> As you know I recently filed criminal concerns
> with law enforcement regarding another actively
> participating within this group. I will be even
> more aggressive regarding you, especially in
As I've said before, I do believe there are more appropriate venues for
this. Good legal counsel, I'm sure, would ward you away from this sort of
public indictment. Please refrain.
e.
------------------------------
Date: Sat, 20 May 2000 21:32:14 GMT
From: "Dave Brondsema" <qbasicguy@unitedstates.com>
Subject: timeout a perl script?
Message-Id: <yvDV4.81960$h01.586435@news1.rdc1.mi.home.com>
How could I make a perl script timeout after a while (like an infinite
loop)?
I've tried the alarm function, but that was unsupported. Is this something
that I perl can do, or do I need to do it on the server? The server is
running NT with Active Perl 5.
Thanks,
Dave Brondsema
------------------------------
Date: Sat, 20 May 2000 16:41:25 GMT
From: "JohnShep" <john@princenaseem.com>
Subject: ugly mysql call
Message-Id: <3926cf1d.0@news2.cluster1.telinco.net>
I need to xfer between databases/tables and the code below works. However I
want to be able to use variable
table names and I am constrained by having to code the nos of '?' as nos
columns in the table. Is there something like a @? I can use.
Thanks, JohnShep
############################################################################
sub insert_row {
local $query="INSERT INTO table2 VALUES
?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
local $sth=$dbh->prepare($query);
$sth->execute(@_) or die
print "Failed in insert row".$query".
$sth->DBI::errstr."\n";
$sth->finish;
}
############################################################################
# main code
$query="select * from table1";
$sth=$dbh->prepare($query);
$sth->execute or die "failed in get_bout $sth->DBI::errstr\n";
while (my $ref = $sth->fetchrow_arrayref)
{
insert_row(@$ref);
}
$sth->finish;
$dbh->disconnect;
------------------------------
Date: Sat, 20 May 2000 10:00:51 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: ugly mysql call
Message-Id: <3926C4C3.EA506B85@vpservices.com>
JohnShep wrote:
>
> I need to xfer between databases/tables and the code below works. However I
> want to be able to use variable
> table names and I am constrained by having to code the nos of '?' as nos
> columns in the table. Is there something like a @? I can use.
sub insert_row {
my $param_str = (join ",", ("?") x @_);
my $query = "INSERT INTO table2 VALUES ($param_str)";
my $sth=$dbh->prepare($query);
$sth->execute(@_) ...
Please note that I also changed your use of "local" to "my".
--
Jeff
------------------------------
Date: Sat, 20 May 2000 17:08:42 GMT
From: "JohnShep" <john@princenaseem.com>
Subject: Re: ugly mysql call
Message-Id: <3926d573.0@news2.cluster1.telinco.net>
Jeff Zucker <jeff@vpservices.com> wrote in message
news:3926C4C3.EA506B85@vpservices.com...
>
> JohnShep wrote:
> >
> > I need to xfer between databases/tables and the code below works.
However I
> > want to be able to use variable
> > table names and I am constrained by having to code the nos of '?' as nos
> > columns in the table. Is there something like a @? I can use.
>
> sub insert_row {
> my $param_str = (join ",", ("?") x @_);
> my $query = "INSERT INTO table2 VALUES ($param_str)";
> my $sth=$dbh->prepare($query);
> $sth->execute(@_) ...
>
> Please note that I also changed your use of "local" to "my".
Thanks Jeff, that works fine. I did get an error 1st time, it seems that
I've picked up an extra colum value (empty) from somewhere (both tables are
identical) pop @array sorts it out but I'm curious as to where it came
from..
JohnShep
------------------------------
Date: Sat, 20 May 2000 18:38:34 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: What is the CPAN module repository (url) name that can be used for PPM/VPM?
Message-Id: <B54C53E9.4659%elaine@chaos.wustl.edu>
in article 392569e9.6500036@news2.newscene.com, Eric Liao at
ekliao@mediaone.net quoth:
> Does it exist? THanks.
http://www.activestate.com/ActivePerl/docs/faq/ActivePerl-faq2.html
e.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3108
**************************************