[17555] in Perl-Users-Digest
Perl-Users Digest, Issue: 4975 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 27 21:06:02 2000
Date: Mon, 27 Nov 2000 18:05:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975377118-v9-i4975@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 27 Nov 2000 Volume: 9 Number: 4975
Today's topics:
ANNOUNCE: tagged-0.25 released <thg@users.sourceforge.net>
Re: Apache, Win and Perl <peter.sundstrom@eds.com>
Counting Asian characters in text <ayambema@adelphia.net>
Crypt::PGP5 Problems (OTR Comm)
Re: Delete array slices? <jeff@yoak.com>
Emailing from PERL with attachments <denverlynx@hotmail.com>
Re: Emailing from PERL with attachments (Chris Fedde)
ETRADE logon script <douglas@home.com>
FAQ 4.13: How can I take a string and turn it into ep <faq@denver.pm.org>
Re: Help Needed: SORT function [OT] <joe+usenet@sunstarsys.com>
Re: Help Needed: SORT function (Tad McClellan)
Re: If/else problem. (Tom Hoffmann)
Re: If/else problem. (Tad McClellan)
Re: If/else problem. <johngros@Spam.bigpond.net.au>
Re: Launching Excel2000 or Internet Explorer from Perl (Mark W. Schumann)
Re: NEWBEE: How to Encrypt Data ?? (OTR Comm)
Re: NEWBEE: How to Encrypt Data ?? (John J. Trammell)
Re: newbie pipe question satkinson@skydesk.com
Perl for ISAPI (PerlIS) twolfmaier@acm.org
Re: Perl not executing from Cron job <paul@NOSPAM.multibase.com.au>
Pie Chart Font Size <r_hao@hotmail.com>
Re: Pie Chart Font Size (Martien Verbruggen)
Re: Posting Guidelines? (Chris Fedde)
Re: Posting Guidelines? (Tad McClellan)
Re: Reading a csv file (David Wall)
Re: Reading a csv file (Tad McClellan)
Re: Reading a csv file (Tad McClellan)
Re: SNMP agent written in perl? <mikeegg@prodigy.net>
Spell Checker?? <RichParker@fssi-ca.com>
Re: Spell Checker?? <brondsem@my-deja.com>
Re: Taint mode question <vrdoljak@uclink.berkeley.edu>
Re: What if $SIG{__DIE__} is occupied by other module? <nospam@david-steuber.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Nov 2000 23:59:10 +0100
From: Thomas Geffert <thg@users.sourceforge.net>
Subject: ANNOUNCE: tagged-0.25 released
Message-Id: <t25raucg6lsj63@corp.supernews.com>
tagged-0.25 contains bugfixes for MP3::Tag, MP3::Tag::ID3v1
and tk-tag.pl .
MP3::Tag is a perl module for reading/changing/writing tags of
MP3 files. Currently ID3v1/ID3v1.1 and ID3v2.3 tags are supported.
tk-tag is a Perl/Tk graphical interface for MP3::Tag.
CHANGES from tagged-0.21 to tagged-0.25
=======================================
* Bug-fix for MP3::Tag
If you created several mp3-objects for different files, the filehandles
for each file were not used correctly. Thanks to hakimian for reporting
this bug.
* Bug-fix for ID3v2::remove_tag()
It was tried twice to rename one temp-file after removing the tag.
Thanks to Brent Sarten <bsarten@bigfoot.com> for reporting this.
* Bug-fix for ID3v2::add_tag()
When adding a second (or third, ...) frame of a kind, a wrong header
could be written for this frame
* Bug-fix for tk-tag
When opening a new file, the contents of the ID3v2 tag of the last file
would be copied to the ID3v2 tag of the new file for all frames which
existed in the last file, but not in the new one.
You can find tagged-0.25 at
http://tagged.sourceforge.net or
http://search.cpan.org/search?dist=tagged
Thomas
<thg@users.sourceforge.net>
------------------------------
Date: Tue, 28 Nov 2000 11:30:06 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Apache, Win and Perl
Message-Id: <8vun9f$3fo$1@hermes.nz.eds.com>
John Boy Walton <johngros@Spam.bigpond.net.au> wrote in message
news:BuAU5.8234$GW5.48481@news-server.bigpond.net.au...
> Well even configuring apache correctly you need the #! line always.
John. Could you please make sure you quote what you are replying to. Not
everyone reads a thread from beginning to end, so if you have an answer with
no question, it makes it very difficult to follow what is going on.
------------------------------
Date: Tue, 28 Nov 2000 00:46:09 GMT
From: "hokiebear" <ayambema@adelphia.net>
Subject: Counting Asian characters in text
Message-Id: <lfDU5.3551$tR2.89266@news1.news.adelphia.net>
Does anyone know of a code snippet that would count the number of characters
in a wholly Chinese, Korean, or Japanese text? The following works for
counting letters in an English text but doesn't work for any of the
aforelisted:
$chars =$input{'text'} =~ tr/a-zA-Z/a-zA-Z/;
Thanks.
amba
------------------------------
Date: Mon, 27 Nov 2000 23:28:30 GMT
From: otrcomm***NO-SPAM***@wildapache**NO-SPAM***.net (OTR Comm)
Subject: Crypt::PGP5 Problems
Message-Id: <3a22ece4.3207533980@news.wildapache.net>
Hello,
Has anyone gotten the PGP5 CPAN module to work?
If so, could I have a copy of some code to show me how to get it to work?
I have some code:
#!/usr/bin/perl -w
use Crypt::PGP5;
$pgp = new Crypt::PGP5;
$keyid = "conor_dimond\@verdenet.com";
$passphrase = "ConorDimond";
$key = $pgp->secretkey ($keyid);
$pass = $pgp->passphrase ($passphrase);
@plaintext = ("So maybe","\n","this", " is"," a"," test.\n");
$ciphertext = $pgp->encrypt(@plaintext);
print "key = $key\n";
print "pass = $pass\n";
print "ciphertext = $ciphertext\n";
When I execute this code I get:
Can't use string ("So maybe") as an ARRAY ref while "strict refs" in use at
/usr/lib/perl5/site_perl/5.005/Crypt/PGP5.pm line 289.
Any ideas?
Thanks,
Murrah Boswell
------------------------------
Date: Mon, 27 Nov 2000 14:42:50 +0800
From: "Jeff Yoak" <jeff@yoak.com>
Subject: Re: Delete array slices?
Message-Id: <8vuo070ph6@news1.newsguy.com>
[ posted and emailed ]
In article <3A226C45.AFB6FE80@schlund.de>, "Carsten Gaebler"
<cg@schlund.de> wrote:
> I'd like to remove some consecutive elements from an array @a, say $a[2]
> thru $a[5]. Normally I'm using Python where this would be simply a[2:6]
> = []. Is there an equivalent in Perl ("delete" only works for hashes),
> or would I have to set up a loop manually?
People have already pointed you to splice, but your parenthesized
statement isn't true for modern perls. delete() can be used on an array.
Doing so, however, doesn't actually remove collapse the array in the
fashion you want though, so splice() is the correct choice.
Cheers,
Jeff
------------------------------
Date: Tue, 28 Nov 2000 00:30:10 -0000
From: S E <denverlynx@hotmail.com>
Subject: Emailing from PERL with attachments
Message-Id: <t25v4i6arbkm8b@corp.supernews.com>
I've been trying to get a script together so I can send a email
while attaching 3 files to the email via a PERL script.
I've been able to get 1 file into the email but am stumped on how to add
the 2 additional attachments. This is what I have so far:
#!/usr/local/bin/perl5.6
use lib "lib";
use MIME::Lite;
MIME::Lite->send('smtp', "gp-dragon", Timeout=>60);
$msg = new MIME::Lite
From => 'abcd@gwl.com',
To => 'efgh@gwl.com',
Cc => 'ijkl@gwl.com',
Subject => 'attach test',
Type => 'TEXT',
Data => "see attachment",
Encoding => 'quoted-printable';
attach $msg
Type => 'TEXT',
Path =>"/home/d_inst/lukm/src/pl/mail.pl",
Filename =>"mail.pl";
$msg->send;
Any suggestions would be greatly appreciated.
TIA,
Shawn
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Tue, 28 Nov 2000 01:12:04 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Emailing from PERL with attachments
Message-Id: <EDDU5.121$QX6.173921792@news.frii.net>
In article <t25v4i6arbkm8b@corp.supernews.com>,
S E <denverlynx@hotmail.com> wrote:
>I've been trying to get a script together so I can send a email
>while attaching 3 files to the email via a PERL script.
>
Hum... the examples in the manual work fine for me.
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 28 Nov 2000 00:55:22 GMT
From: Douglas Galbraith <douglas@home.com>
Subject: ETRADE logon script
Message-Id: <3A230279.B738D99F@home.com>
Does anyone have a perl script that will open a browser and logon to
ETRADE?
thanks,
DGalbra862@aol.com
------------------------------
Date: Tue, 28 Nov 2000 00:24:07 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ 4.13: How can I take a string and turn it into epoch seconds?
Message-Id: <HWCU5.120$QX6.186755072@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
How can I take a string and turn it into epoch seconds?
If it's a regular enough string that it always has the same format, you
can split it up and pass the parts to `timelocal' in the standard
Time::Local module. Otherwise, you should look into the Date::Calc and
Date::Manip modules from CPAN.
-
Historically documents such as this are called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition and generally serve to reduce the
volume of redundant traffic on a particular news group. If you
are some how irritated by seeing these postings you are free to
ignore them or add the sender to your killfile.
If you are not able to find this or other Perl documentation from
your installation you can access it via the web from
http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search
http://www.perldoc.com
http://www.cpan.org
or
http://www.perl.com
Answers to questions about LOTS of other stuff not related to
Perl can be found at
news:news.answers
and in the many thousands of other useful Usenet news groups.
The perlfaq manual pages contain the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
When included as an integrated part of the Standard
Distribution of Perl or of its documentation (printed or
otherwise), this work is covered under Perl's Artistic
License. For separate distributions of all or part of
this FAQ outside of that, see the perlfaq manpage.
Irrespective of its distribution, all code examples here
are public domain. You are permitted and encouraged to
use this code and any derivatives thereof in your own
programs for fun or for profit as you see fit. A simple
comment in the code giving credit to the FAQ would be
courteous but is not required.
--
This space intentionally left blank
------------------------------
Date: 27 Nov 2000 18:20:09 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Help Needed: SORT function [OT]
Message-Id: <m3ofz180k6.fsf_-_@mumonkan.sunstarsys.com>
tadmc@metronet.com (Tad McClellan) writes:
> Genesis Montano <genesis@magictraders.com> wrote:
>
> >Please email me back at genesis.montano@intel.com
>
>
> Why?
>
> If we did that then only one person has access to the answer.
>
> If we post here then thousands of people get to see it.
>
> Hoarding answers is selfish.
>
> Let the answers be public.
>
> Ask it here, get the answer here (maybe).
>
>
Just wondering - has this ng, or any other perl-related
entity, formulated an appropriate position on how to
address persons requesting public assistance from the
intel.com domain?
Personally I have decided not to assist any OP requesting
help from this domain, because I will not support entities
that seek to remove valuable resources from the public.
--
Joe Schaefer
------------------------------
Date: Mon, 27 Nov 2000 18:29:52 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help Needed: SORT function
Message-Id: <slrn925rjg.gsn.tadmc@magna.metronet.com>
David Steuber <nospam@david-steuber.com> wrote:
>tadmc@metronet.com (Tad McClellan) writes:
>
>' Hoarding answers is selfish.
>
>Ok, so now we know that you aren't the one with all the answers! ;-P
>
>Now if we can just find the bastard who does...
There has been a bunch of them here (people with lots of answers,
not bastards. Used to see Larry Wall answering Perl questions hereish).
But they tend to leave.
:-(
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 27 Nov 2000 23:34:16 GMT
From: tom.hoffmann@worldnet.att.net (Tom Hoffmann)
Subject: Re: If/else problem.
Message-Id: <slrn925rli.li.tom.hoffmann@localhost.localdomain>
On Mon, 27 Nov 2000 22:20:37 GMT, John Boy Walton wrote:
>open BOGUS,"+>>$file" or
>die "Cannot open file: $!";
>
> if ($pass eq <BOGUS>){
> goto success;
> }else{
>
>That was my original code after Joe's pointer I changed it to:
>if (open BOGUS,"$file")
>{
> $bogus =<BOGUS>;
> chomp ($bogus);
> if ($pass eq $bogus)
>It still is not comparing $pass and $bogus correctly.
Can you print and share with us the values of $pass/$bogus at the time of
comparison? Is it possible that the file BOGUS is empty? What happens
if you rewrite your code as:
open BOGUS, $file or die "Error message";
while ($bogus = <BOGUS>) {
chomp ($bogus);
if ($pass eq $bogus) {
do something
} else {
so something else
}
}
???
------------------------------
Date: Mon, 27 Nov 2000 17:10:50 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: If/else problem.
Message-Id: <slrn925mva.gbn.tadmc@magna.metronet.com>
John Boy Walton <johngros@Spam.bigpond.net.au> wrote:
> if ($pass eq $bogus)
>It still is not comparing $pass and $bogus correctly.
So find out why!
print "pass '$pass'\n";
print "bogus '$bogus'\n";
before the if()
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 28 Nov 2000 01:13:38 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: If/else problem.
Message-Id: <6FDU5.8403$GW5.49729@news-server.bigpond.net.au>
$bogus= '975361614'
$pass= '0'
I removed the chomp from $pass and got $pass = ''
I will have to check the html that calls my script because $pass =
$form_data{'pass'};
works in the script that writes the password initially.
Yep it was pwd instead of pass.
Thanks for the debugging tip.
I used to use that in basic years ago. More than a bit rusty it seems.
"Tom Hoffmann" <tom.hoffmann@worldnet.att.net> wrote in message
news:slrn925rli.li.tom.hoffmann@localhost.localdomain...
> On Mon, 27 Nov 2000 22:20:37 GMT, John Boy Walton wrote:
> >open BOGUS,"+>>$file" or
> >die "Cannot open file: $!";
> >
> > if ($pass eq <BOGUS>){
> > goto success;
> > }else{
> >
> >That was my original code after Joe's pointer I changed it to:
> >if (open BOGUS,"$file")
> >{
> > $bogus =<BOGUS>;
> > chomp ($bogus);
> > if ($pass eq $bogus)
> >It still is not comparing $pass and $bogus correctly.
>
> Can you print and share with us the values of $pass/$bogus at the time of
> comparison? Is it possible that the file BOGUS is empty? What happens
> if you rewrite your code as:
>
> open BOGUS, $file or die "Error message";
> while ($bogus = <BOGUS>) {
> chomp ($bogus);
> if ($pass eq $bogus) {
> do something
> } else {
> so something else
> }
> }
>
> ???
------------------------------
Date: 27 Nov 2000 20:03:22 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Launching Excel2000 or Internet Explorer from Perl
Message-Id: <8vv08q$k3u@junior.apk.net>
In article <oOGS5.1817$Gw3.308235@paloalto-snr1.gtei.net>,
Lauren Smith <lauren_smith13@hotmail.com> wrote:
>"Stuart Vigne" <vigne@nhamp.net> wrote in message
>news:D65FF87A6AE54DAC.6BB1E2BE7FC711A2.37C0B82FFC012455@lp.airnews.net..
>.
>> well after much work my Perl Tool is done, but I have one last feature
>> I want to include:
>>
>> My final report is launching via Notepad, but I would like to change
>> that to Excel, and sometimes Internet Explorer. I run in Windows
>> 2000, and this is the only platform my Perl script will ever run on.
>
>Find the line that says
>
>exec ("notepad.exe $finalreport") or die "$!";
>
>and change it to
>
>exec ("\"C:\Program Files\Internet Explorer\IEXPLORE.EXE\"
>$finalreport") or die "$!";
Don't you want double backslashes there?
------------------------------
Date: Mon, 27 Nov 2000 23:45:59 GMT
From: otrcomm***NO-SPAM***@wildapache**NO-SPAM***.net (OTR Comm)
Subject: Re: NEWBEE: How to Encrypt Data ??
Message-Id: <3a22eff8.3208321663@news.wildapache.net>
On 27 Nov 2000 21:04:00 GMT, trammell@nitz.hep.umn.edu (John J. Trammell) wrote:
>On Mon, 27 Nov 2000 20:34:33 GMT, OTR Comm
><otrcomm***NO-SPAM***@wildapache**NO-SPAM***.net> wrote:
>[snip]
>>What is the best module to use for some strong encryption?
>
>This really depends on the kind of encryption you need to do.
>What exactly are you trying to store?
I will be storing safe combinations and pin numbers for keyed entry systems.
I have tried to use the PGP5 module from CPAN, but I get errors; i.e.,
#!/usr/bin/perl -w
use Crypt::PGP5;
$pgp = new Crypt::PGP5;
$keyid = "conor_dimond\@verdenet.com";
$passphrase = "ConorDimond";
$key = $pgp->secretkey ($keyid);
$pass = $pgp->passphrase ($passphrase);
$pin_number1 = "6357243";
$pin_number2 = "3427536";
push(@plaintext,$pin_number1,$pin_number2);
$ciphertext = $pgp->encrypt(@plaintext);
print "key = $key\n";
print "pass = $pass\n";
print "ciphertext = $ciphertext\n";
When I execute this, I get:
Can't use string ("6357243") as an ARRAY ref while "strict refs" in use at
/usr/lib/perl5/site_perl/5.005/Crypt/PGP5.pm line 289.
Any ideas?
Murrah Boswell
>
>--
>John J. Trammell
>johntrammell@yahoo.com
------------------------------
Date: 27 Nov 2000 23:57:37 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: NEWBEE: How to Encrypt Data ??
Message-Id: <slrn9252tr.dqn.trammell@nitz.hep.umn.edu>
On Mon, 27 Nov 2000 23:45:59 GMT, OTR Comm
<otrcomm***NO-SPAM***@wildapache**NO-SPAM***.net> wrote:
[snip]
>$pin_number1 = "6357243";
>$pin_number2 = "3427536";
>
>push(@plaintext,$pin_number1,$pin_number2);
>
>$ciphertext = $pgp->encrypt(@plaintext);
[snip]
>Can't use string ("6357243") as an ARRAY ref while "strict refs" in
>use at /usr/lib/perl5/site_perl/5.005/Crypt/PGP5.pm line 289.
A quick 'perldoc Crypt::PGP5' yields:
$ciphertext = $pgp->encrypt([@recipients], @plaintext);
So, what's the plan? Are you going to store the encrypted data
in the database, but leave the password in plaintext in the
script? Not much of an improvement IMHO. Maybe you should
hang out in sci.crypt for a while and read some Bruce Schneier.
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Mon, 27 Nov 2000 23:50:24 GMT
From: satkinson@skydesk.com
Subject: Re: newbie pipe question
Message-Id: <8vurvu$ij9$1@nnrp1.deja.com>
Sorry, I was translating a larger problem into a smaller one. The
larger problem is that I have 2 large files (300,000 lines +), one with
a list of files in Dos style and one in Unix style. There are some
files that match except for the path separators. So I want to combine
the files, translate so they are the same path separators and case,
sort to pick out matches, and then read the list to look for other
criteria to filter on.
I actually did have my Unix command wrong: it should be `cat myfile |
tr '/' '\\'` which means in Perl I should have tried escaping the '\'
char twice. I did not do this, and thus my problem.
My corrected working script does something like this:
Open(FILES,"cat file1 file1 | tr '[/][a-z]' '[\\\\][A-Z]' | sort|") ||
die "$msg:$!\n";
$save_line = ""; # save previous line for match filtering
while (<FILES>) {
# do my thing
}
If there is a more canonical "Perl" way of doing this, I'm all ears!!
Thanks,
StevenA
>
> > I have a UNIX perl script where I want to convert UNIX style paths
to
> > DOS style path in a pipe. From the shell I'd do something like this:
> >
> > cat myfile | tr '/' '\'
>
> Would you really? Gives me an error must be you have a different
> shell. Does it actually work though?
>
> And would you really go for the "useless use of cat award"?
>
> > However, I can't get the following to work in perl:
> >
> > open(FILE,"cat myfile | tr '/' '\' |");
>
> If it doesn't work at the shell prompt then I would not expect it to
> work when called from Perl.
>
> > If get not translations when I read from the pipe. What am I doing
> > wrong?
>
> You mean appart from using the external tr program when there's a
> perfectly good Perl builtin function to do the same thing and which
> even has the same name?
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 28 Nov 2000 01:03:00 GMT
From: twolfmaier@acm.org
Subject: Perl for ISAPI (PerlIS)
Message-Id: <8vv081$ltf$1@nnrp1.deja.com>
I have been looking into Perl for ISAPI (PerlIS). I could not find a lot
of information on it. The main reason for using it would be speed. I
have two questions:
1. Are there any serious concerns about using Perl for ISAPI?
2. What are the differences between a Perl CGI script and a Perl for
ISAPI script?
ActiveState's Perl for ISAPI FAQ states 'Writing Perl scripts that run
under PerlIS is not much different than writing scripts for the Common
Gateway Interface (CGI).' However, it fails to mention what the
differences are. Basically, if I have a CGI Perl script, what do I need
to change to use it as a Perl for ISAPI script.
Thanks,
Thomas
-----------------------------------------------------
Thomas Wolfmaier
Human-Computer Interaction Resource Network (HCIRN)
25 Bucks Green Road, Thornhill, ON, Canada, L3T 4G1
Tel: +1-905-881-7095
Email: twolfmaier@acm.org
Web: www.hcirn.com
-----------------------------------------------------
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 28 Nov 2000 09:05:52 +1000
From: "Paul Mulloni" <paul@NOSPAM.multibase.com.au>
Subject: Re: Perl not executing from Cron job
Message-Id: <3a22e8cb@grissom>
Thanks for the info.
I am trying the latest Linux, Red Hat version 7.0 an see if this behaviour
continues.
Thanks again.
Paul.
Chris Fedde <cfedde@fedde.littleton.co.us> wrote in message
news:KVvU5.107$QX6.135467008@news.frii.net...
> In article <3a220f90@grissom>,
> Paul Mulloni <paul@NOSPAM.multibase.com.au> wrote:
> >This is the cron job entry.
> >
> >SHELL="/usr/bin/perl"
> >* * * * * /usr/local/ereport/burst.pl
> >
> >The crontab enrty is created under the user ereport. If the SHELL
variable
> >is missing the cron job produces an error.
> >
>
> Well I'm not a Redhat expert so I can't answer authoritatively.
> But that behavior seems wrong. Cron should fork burst.pl and load
> the program listed at the #! line. Obvious things to check are
> permissions and ownership of the burst.pl file. Read the documentation
> for the cron command. Maybe there is something odd there that
> explains this behavior.
>
> Another thing to try is to remove the SHELL variable and use a line that
> invokes perl directly as follows.
>
> * * * * * /usr/bin/perl /usr/local/ereport/burst.pl
>
> Since this is not realy a perl problem you might want to try posting your
> question to a news group that has linux, redhat, or cron somewhere in the
> title.
>
> good luck!
> chris
> --
> This space intentionally left blank
------------------------------
Date: Mon, 27 Nov 2000 20:34:25 -0500
From: "Randy" <r_hao@hotmail.com>
Subject: Pie Chart Font Size
Message-Id: <8vv25a$3kp$1@slb1.atl.mindspring.net>
We have create a Pie Chart according to GD::Graph::Pie module. However, we
can't make font size on the pie chart bigger by using
$graph->set_value_font('arial', 20). Anyone has idea?
Thanks in Advance
Randy
------------------------------
Date: Tue, 28 Nov 2000 01:56:59 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Pie Chart Font Size
Message-Id: <slrn92643q.br5.mgjv@verbruggen.comdyn.com.au>
On Mon, 27 Nov 2000 20:34:25 -0500,
Randy <r_hao@hotmail.com> wrote:
> We have create a Pie Chart according to GD::Graph::Pie module. However, we
> can't make font size on the pie chart bigger by using
> $graph->set_value_font('arial', 20). Anyone has idea?
Is the font displayed at all? Can 'arial.ttf' be found by the program?
The tiny bit of code you submit is demonstrated in sample92.pl in the
source distribution, and it works fine there.
What exactly is the problem you're seeing? Nothing at all? Too small a
font, but the correct one? The wrong font?
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Tue, 28 Nov 2000 00:09:32 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Posting Guidelines?
Message-Id: <0JCU5.118$QX6.189355520@news.frii.net>
In article <slrn925drq.ff1.tadmc@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>>In article <8vfq93$1v4$1@nnrp1.deja.com>, <jbuff1856@my-deja.com> wrote:
>
>[ snip "we should have posting guidelines for clpmisc" ]
>
>The problem with a free-for-all newsgroup like clp.misc is
>who would create or maintain it.
>
I don't think any one is suggesting moderators. Clp.moderated exists and
serves the need for a moderated group quite well. I'm talking about
a few periodic postings that say things like "post in plain text",
"edit quoted text", and "write below what you are responding to."
The other thing that this brought to mind was the newsgroup FAQ posting.
No one is doing it in this group anymore and so I thought that I'd take it
on myself. Expect to see postings much as Tom Christiansen did appearing
soon.
chris
--
This space intentionally left blank
------------------------------
Date: Mon, 27 Nov 2000 19:26:39 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Posting Guidelines?
Message-Id: <slrn925utv.gsn.tadmc@magna.metronet.com>
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>In article <slrn925drq.ff1.tadmc@magna.metronet.com>,
>Tad McClellan <tadmc@metronet.com> wrote:
>>Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>>>In article <8vfq93$1v4$1@nnrp1.deja.com>, <jbuff1856@my-deja.com> wrote:
>>
>>[ snip "we should have posting guidelines for clpmisc" ]
>>
>>The problem with a free-for-all newsgroup like clp.misc is
>>who would create or maintain it.
>>
>
>I don't think any one is suggesting moderators.
Me either.
My point was there is nobody with a mandate from the masses
(so we'll just go with a farcical aquatic ceremony :-)
>Clp.moderated exists and
>serves the need for a moderated group quite well.
I am familiar with that newsgroup, heh heh.
>I'm talking about
>a few periodic postings that say things like "post in plain text",
>"edit quoted text", and "write below what you are responding to."
My point was who decides what is "bad"? What if "lots" of folks
do not agree with what it puts forward?
I'll just do it and we'll see.
>Expect to see postings much as Tom Christiansen did appearing
>soon.
I'm going to take the Nike approach too.
I'll take a stab at some posting guidelines.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 27 Nov 2000 18:03:37 -0500
From: darkon@one.net (David Wall)
Subject: Re: Reading a csv file
Message-Id: <8FF9B8B04darkononenet@206.112.192.118>
[Jeopardectomy performed]
flint@flintslacker.com (Flint Slacker) wrote in
<3a29c2b7.239347084@news.tcn.net>:
>On Mon, 27 Nov 2000 20:19:48 -0000, "Chris Darlington"
><c.darlington@virgin.net> wrote:
>
>>I have a .csv file which takes the following format:
>>
>>Date,Match,Name1,Name2,Name3
>>
[snip]
>>
>>The object of the code is to take the date from the csv file and create
>>a table in .html to display the results.
>
[code to print HTML, etc]
>open(IN, "< somecsv.txt");
>while(<IN>) {
> chomp;
> @tmp = split(/\,/, $_);
This will break the first time you see a line like
7-Nov-2000,Yes,"Smith, John","Doe, John","Doe, Jane"
He'd probably be better off using Text:CSV_XS to parse the CSV file, unless
he knows ahead of time that this code will work. (Text:CSV appears to have
been deprecated/superseded.)
(The following is largely copied from the Text::CSV_XS docs, but I did test
it on simple data, such as the line above.)
#!/usr/bin/perl -w
use strict;
use Text::CSV_XS;
use CGI qw/header Td Tr start_html start_table/;
print header,
start_html(-title=>"Doc title"),
start_table({width=>"100%", border=>"0"});
print Tr(Td( [qw/Date Match Name1 Name2 Name3/] ));
while (<DATA>) {
chomp;
my $csv = Text::CSV_XS->new;
if ( $csv->parse($_) ) {
my @field = $csv->fields;
print Tr(Td(\@field));
}
else {
# I didn't bother with HTML for this part -dkw
my $err = $csv->error_input;
print "parse() failed on argument: ", $err, "\n";
}
}
print end_table, end_html;
--
David K. Wall
darkon@one.net
------------------------------
Date: Mon, 27 Nov 2000 18:21:33 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Reading a csv file
Message-Id: <slrn925r3t.gbn.tadmc@magna.metronet.com>
Chris Darlington <c.darlington@virgin.net> wrote:
>I have a .csv file which takes the following format:
Do you mean "csv" or "CSV"?
Where:
csv: values separated with commas, commas in data fields prohibited
CSV: like office tools dump out, with quoted fields containing
commas/newlines, ...
You might also have a look at Perl FAQ, part 4:
"How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)"
>Date,Match,Name1,Name2,Name3
>
>I want to load each line into an array and then seperate each line using the
>split function and the commas to split the line.
For csv files, you use the split function:
while ( <> ) {
my @fields = split /,/;
# ...
}
For CSV files, you use a CSV module from CPAN :-)
>How do I read each date into an array along with the other fields?
I'm not following you there.
The date will be in $fields[0]. You can copy or push() it into
another array as normal.
>Can anyone please help?
CPAN can help.
Get the Text::CSV_XS (or Text::CSV) module there.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 27 Nov 2000 19:32:46 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Reading a csv file
Message-Id: <slrn925v9e.gsn.tadmc@magna.metronet.com>
David Wall <darkon@one.net> wrote:
>
>[Jeopardectomy performed]
I don't quote David below, but I won't see the other's posts
and can't let an unchecked open() go by without saying something.
Excuse the piggybacking.
>flint@flintslacker.com (Flint Slacker) wrote in
><3a29c2b7.239347084@news.tcn.net>:
>>open(IN, "< somecsv.txt");
You should always, yes *always*, check the return value from open.
open(IN, '< somecsv.txt') || die "could not open 'somecsv.txt' $!";
>> @tmp = split(/\,/, $_);
^
^
Useless use of backslash.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 27 Nov 2000 17:51:46 -0600
From: Mike Eggleston <mikeegg@prodigy.net>
Subject: Re: SNMP agent written in perl?
Message-Id: <3A22F392.5B7ECE26@prodigy.net>
Looking at the net-snmp source this weekend it looks like if #ifdef's were used in
main() to initialize libperl.a and in receive() that perl could be embedded inside
net-snmp without much effort and with *much* gain. Registering perl functions with the
alarm function so that modules can receive timed callbacks then the monitoring functions
can be merged with recovery functions.
Mike
Wes Hardaker wrote:
> >>>>> On Tue, 21 Nov 2000 21:17:17 -0600, Mike Eggleston <mikeegg@prodigy.net> said:
>
> Mike> I am looking into a new monitoring agent on my unix boxes. I
> Mike> prefer that the agent be written in perl so that separate
> Mike> modules can be written for each monitored area (cpu, disk,
> Mike> filesystem, swap, oracle, notes, etc..... like bmc's patrol). I
> Mike> know that I can write the management portion in perl to talk
> Mike> with an agent, but is there any similiar system that allows the
> Mike> agent to be written in perl?
>
> Not that I'm aware of. The perl SNMP related modules are all designed
> from the management side of things. I've always meant to write a
> wrapper around the net-snmp agent interface for perl, but haven't
> gotten to it quite yet (it should actually be fairly easy). Since the
> net-snmp agent is already modular like you want it to be, it should
> easily suit your needs if this was done.
>
> (It can also call external perl scripts already from its C-core).
>
> --
> Wes Hardaker
> NAI Labs
> Network Associates
------------------------------
Date: Mon, 27 Nov 2000 23:41:01 GMT
From: Rich Parker <RichParker@fssi-ca.com>
Subject: Spell Checker??
Message-Id: <3A22F1EB.6A16653@fssi-ca.com>
Hello,
I have a request from one of my users for a SPELL CHECKER for info from
a TEXTAREA from a FORM. I am using Perl on a WinNT 4.0 server and I was
wondering if anyone has pulled this off before? If so, please include a
link so I can 'Take a look' to see how it works.
Thanks, I maybe dreaming on this one...
--
Rich Parker
Web Sites:
Business: http://www.fssi-ca.com
Personal: http://southcoastdivers.com
E-mail:
Business: mailto:RichParker@fssi-ca.com
Personal: mailto:Rich@southcoastdivers.com
------------------------------
Date: Tue, 28 Nov 2000 00:10:02 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: Spell Checker??
Message-Id: <8vut4k$jg4$1@nnrp1.deja.com>
In article <3A22F1EB.6A16653@fssi-ca.com>,
Rich Parker <RichParker@fssi-ca.com> wrote:
> Hello,
> I have a request from one of my users for a SPELL CHECKER for info
from
> a TEXTAREA from a FORM. I am using Perl on a WinNT 4.0 server and I
was
> wondering if anyone has pulled this off before? If so, please include
a
> link so I can 'Take a look' to see how it works.
Never done it, but I've had the same request. I'd suggest an add-on to
the browser that will do the spell checking (I'm sure some exist).
Otherwise, just go through every word in the text that was submitted
and check to see if its in a dictionary file. Lots of optimizations
possible here, I imagine it'd be pretty slow otherwise.
>
> Thanks, I maybe dreaming on this one...
> --
> Rich Parker
> Web Sites:
> Business: http://www.fssi-ca.com
> Personal: http://southcoastdivers.com
> E-mail:
> Business: mailto:RichParker@fssi-ca.com
> Personal: mailto:Rich@southcoastdivers.com
>
>
--
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 27 Nov 2000 16:29:58 -0800
From: Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
To: Mark-Jason Dominus <mjd@plover.com>
Subject: Re: Taint mode question
Message-Id: <3A22FC86.4CAB9AF2@uclink.berkeley.edu>
Hello Mark-Jason,
Thank you very much for the advice. I got around globbing as you suggested by
the following:
73 opendir(DIR, '/home/httpd/cgi-bin');
74 @schedfiles = grep { /SCHED/ } readdir(DIR);
75 closedir(DIR);
However, I now have the following error:
Insecure dependency in open while running with -T switch at
/home/httpd/cgi-bin/sched1.cgi line 389,
<SCHEDULE> chunk 63.
line 389 looks like (it is the output of the schedule after the client books a
time on the microscope):
389 open(SCHEDOUT, ">$file") || die "Could not create open schedule.";
390
Mark-Jason Dominus wrote:
>
> [mailed and posted]
>
> In article <3A22AD65.F5ED8EE8@uclink.berkeley.edu>,
> Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu> wrote:
> >I have been told to run it in taint mode (-T option), but perl complains with
> >the following error:
> >
> >Insecure dependency in glob while running with -T switch at
> >/home/httpd/cgi-bin/sched1.cgi line 71.
>
> In Perl prior to 5.6.0, the glob operation was very complicated. It
> would execute /bin/csh and ask csh to execute 'echo'. Because of this
> complication, the glob operation is deemed to be unsafe in taint mode
> no matter how it is used.
>
> You have two choices: Get rid of the glob, or upgrade to Perl 5.6.0.
> In perl 5.6.0, 'glob' is considered safe in taint mode, because Perl
> 5.6.0 carries its own built-in globber that does not use csh.
>
> To get rid of the glob, use this instead:
>
> sub get_file_list {
> my $prefix = shift;
> my @files;
> local *DIR;
> opendir DIR, '.' or return;
> while (defined(my $f = readdir DIR)) {
> push @files, $f if index($f, $prefix) == 0;
> }
> return @files;
> }
>
> --
> @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
> @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
> ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
> close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Gordon Ante Vrdoljak Electron Microscope Lab
ICQ 23243541 http://nature.berkeley.edu/~gvrdolja 26 Giannini Hall
vrdoljak@uclink.berkeley.edu UC Berkeley
phone (510) 642-2085 Berkeley CA 94720-3330
fax (510) 643-6207 cell (510) 290-6793
------------------------------
Date: Mon, 27 Nov 2000 23:08:27 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: What if $SIG{__DIE__} is occupied by other module?
Message-Id: <m3wvdpovx1.fsf@solo.david-steuber.com>
Ilmari Karonen <iltzu@sci.invalid> writes:
' In article <u9wvdppat2.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:
' >
' >So do not set $SIG{__DIE__}, use eval {} and all will be well.
'
' And if you're running under mod_perl? HTML::Mason?
Beyond this point in your post, you get out of my depth. However, I
use mod_perl and Apache::ASP along with DBI. The evals work just fine
there to catch dies from the DBI module.
I rather like the eval method for catching exceptions. It reminds me
of good old C++, only it is a lot easier to use.
What are some potential very useful uses for signal handlers in Perl
running under mod_perl? I haven't used signal handlers at all yet and
the impression I have is that they are more useful for stand alone
processes.
--
David Steuber | Perl apprentice. The axe did not stop the
NRA Member | mops and buckets from flooding my home.
ICQ# 91465842
*** http://www.david-steuber.com/ ***
------------------------------
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 4975
**************************************