[15733] in Perl-Users-Digest
Perl-Users Digest, Issue: 3146 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 24 11:10:39 2000
Date: Wed, 24 May 2000 08:10:17 -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: <959181016-v9-i3146@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 24 May 2000 Volume: 9 Number: 3146
Today's topics:
libudbc and DBD-ODBC on solaris <schut@rugth1.phys.rug.nl>
Re: LWP Module and error 500 <f.lalane@no-spam.pra.org.uk>
Matching Question amerar@my-deja.com
Re: my algorythms suck (David Wall)
Re: Need help with su <bert@scanlaser.nl>
Net::FTP error <akil1@mindspring.com>
Re: Net::FTP error nobull@mail.com
newbie question - dbi:mysql (deletetosend)
newbie question <gi59@dial.pipex.com>
Re: newbie question <jeff@vpservices.com>
Re: Newbie-- Sendmail <vlad@soft-tronik.ru>
Re: odd behavior printing after randomizing an array fr (Gwyn Judd)
Perl, system and Cron <e8825393@stud2.tuwien.ac.at>
Re: Perl, system and Cron <jboesNOjbSPAM@qtm.net.invalid>
Re: pl2exe missing from ActivePerl (Monte)
Q: exec output into string <thomas2@dalnet.se>
Re: Search&Match-script problem <bert@scanlaser.nl>
send mail <dlocci@tiscali.it>
Re: send mail <dave@dave.org.uk>
Re: Tanspose rows to columns <iltzu@sci.invalid>
what should i read next?? <todd.carlson@bigfoot.com>
Re: what should i read next?? <jboesNOjbSPAM@qtm.net.invalid>
where to find lanman.pm? (Young H Lee)
Writing a concurrent server in perl hritzman@my-deja.com
Re: Writing a concurrent server in perl <aqumsieh@hyperchip.com>
Re: writing Form content to a File-CGI (Neil Kandalgaonkar)
Re: writing Form content to a File-CGI <red_orc@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 May 2000 12:24:47 GMT
From: Koos Schut <schut@rugth1.phys.rug.nl>
Subject: libudbc and DBD-ODBC on solaris
Message-Id: <8gghmf$1oe$1@info.service.rug.nl>
Keywords: DBD-ODBC libudbc
Hi all,
I am trying to get Perl-Informix functionality
on a Solaris-5.5.1 machine. I have:
perl-5.005_03
DBD-ODBC-0.28
gcc-2.95.2
Informix SE-7.?
I can configure the ODBC-package. With make I get:
....
cannot find libudbc.h
I tried to find any *udbc* file, but they are not on
the machine.
Any suggestions of where to get the header- and lib files?
Mazzel, cheers, bye, tabe, moi, tot ziens, have a nice day,
Koos
__________________________to be Y999T-compliant_____________________
JJ Schut | e-mail: schut@phys.rug.nl |
Institute for Theoretical Physics | Phone: +31 15 2566804 |
University of Groningen | Phone: +31 70 3116092 |
P.O. Box 800 | Fax: +31 70 3112133 |
9700 AV Groningen, The Netherlands. | Yell: Very, Very loud |
---------------------- use: yyyyyyyyyyyyyyy/mm/dd-------------------
------------------------------
Date: Wed, 24 May 2000 11:04:33 +0100
From: "Franck Lalane" <f.lalane@no-spam.pra.org.uk>
Subject: Re: LWP Module and error 500
Message-Id: <959162669.16216.0.nnrp-09.9e9872de@news.demon.co.uk>
OK, I found the problem. I put the answer if anyone got the same problem, or
if it could be of any use to anyone.
It was the host file which was wrong on the server. The Intranet website
definition was not set in it, so everytime I tried to access a file with the
Intranet address, it was not found. That's why it was working on my
personnal webserver.
Thanks for all the one who helped me (I didn't knew about the "idiot's
guide" ;))
Franck
------------------------------
Date: Wed, 24 May 2000 14:48:22 GMT
From: amerar@my-deja.com
Subject: Matching Question
Message-Id: <8ggq3g$d7t$1@nnrp1.deja.com>
Hello,
Here is a dumb question. I need to do a series of pattern matchings.
For example, I need to search a string for 9 digits in a row, or I need
to find a pattern of 2 digits, followed by letters FR followed by 5 more
digits.
Anyhow, upon finding the match, I need to extract the pattern from the
string.
I can find out whether or not a pattern is in the string as in this
case: ($x =~ /\d{9}/)
But how do I extract the string? I do not even know where the string
starts.......
Please cc a copy of amerar@ci.chi.il.us
Thanks,
Arthur
amerar@ci.chi.il.us
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 24 May 2000 10:21:13 -0400
From: darkon@one.net (David Wall)
Subject: Re: my algorythms suck
Message-Id: <8F3E6A1F6darkononenet@206.112.192.118>
bart.lateur@skynet.be (Bart Lateur) wrote in
<392d94d1.3942296@news.skynet.be>:
>David Wall wrote:
>
>>That's just what I used in a basic little web board I wrote last year.
>>I was hoping that I could find a non-recursive way to do it, but you
>>seem to be saying there's no other way to do it. Bummer.
>
>Ow ow ow! Stop it right there! There is ALWAYS a way to convert
>recursive algorithms into non-recursive ones! It's so generic that even
>automated tools could do it. All you really need, is a data stack. Now,
>Perl's arrays, together with the functions push() and pop(), work very
>nicely for a stack. So it's not even that hard in Perl.
I do think I mentioned that I'm not from a computer background. :-) I just
know that some things *are* impossible, like squaring the circle, so I
wondered if this was one of them. I'm glad to know it isn't.
>But, looking at the source, I wouldn't bother. The non-recursive version
>can't be but (far) more complicated than the recursive version.
Good. I understood the recursive version just by scanning through it, but
the non-recursive version you posted is not as obvious to me. So is it a
safe generalization to say that recursive algorithms are usually simpler
but less efficient than non-recursive algorithms that produce the same
output?
--
David Wall
darkon@one.net
------------------------------
Date: Wed, 24 May 2000 15:19:30 +0200
From: Bert IJff <bert@scanlaser.nl>
To: Afshin Akbari <aakbari@crosskeys.com>
Subject: Re: Need help with su
Message-Id: <392BD6E2.500FF3B9@scanlaser.nl>
Afshin Akbari wrote:
>
> All,
>
> How can I automate login to a machine in Perl.
> or
> This is the situation:
> I have a file that is owned by user A,
> and I need to copy it as root so when it is
> in the new location, it is owned by root.
>
> to me either I have to automate the login
> process or do something with "chmod"
> I have not been able to figure out which
> and how ???
>
> Platform is solaris.
>
> All the help is greatly appreciated.
>
> Thanks,
>
> A.A.
How about copy FILE to the remote machine, and then
chown root FILE
usually you can change the ownership of your own files to someone else
(at least on the unix system I've worked on for the last >15 years)
if all modes are correct before the chown they will stay that way
(except of course for the suid permission ;-)
regards
Bert
------------------------------
Date: Wed, 24 May 2000 06:28:19 -0400
From: "Kevin Bass" <akil1@mindspring.com>
Subject: Net::FTP error
Message-Id: <8ggb89$ss2$1@slb0.atl.mindspring.net>
I am attempting to use Net::FTP for the first time and I have received an
error that I cannot solve. The code that has caused this error and the
error message is below. It seems like a simple problem to solve but I
cannot determine the cause of this error message. What is causing this error
message?
Code
====
#!/usr/local/bin/perl5
use diagnostics;
use Carp;
use Sys::Hostname;
use Socket;
use Net::FTP;
$mfbb = "mfbb.fyi.com";
$username = "user";
$password = "paswd";
$dir = "LOG";
$address = gethostbyname($mfbb) || croak "$!\n";
print "ADDRESS = $address\n";
$hostname = gethostbyaddr($address, AF_INET) || croak "$!\n";
print "HOST = $hostname\n";
$ftp = Net::FTP->new($hostname) || croak "Cannot connect: $!\n";
$ftp->login($username, $password) || croak "Cannot login\n";
$ftp->mkdir($dir) or die "Cannot mkdir\n";
$ftp->quit;
Error Message
===========
ADDRESS =
÷
HOST = bc01f45.unx.com
Uncaught exception from user code:
Cannot connect: Bad file number
Carp::croak('Cannot connect: Bad file number^J') called at ./test.pl
line 19
------------------------------
Date: 24 May 2000 12:39:02 +0100
From: nobull@mail.com
Subject: Re: Net::FTP error
Message-Id: <u9zopgjhyh.fsf@wcl-l.bham.ac.uk>
Please crosspost rather than posting the same thing separately to
multiple groups.
"Kevin Bass" <akil1@mindspring.com> spams:
> I am attempting to use Net::FTP for the first time and I have received an
> error that I cannot solve. The code that has caused this error and the
> error message is below. It seems like a simple problem to solve but I
> cannot determine the cause of this error message. What is causing this error
> message?
> $ftp = Net::FTP->new($hostname) || croak "Cannot connect: $!\n";
> HOST = bc01f45.unx.com
> Uncaught exception from user code:
> Cannot connect: Bad file number
> Carp::croak('Cannot connect: Bad file number^J') called at ./test.pl
> line 19
Well the "Bad file number" doesn't tell us much because the API of
Net::FTP doesn't promise us anything about $!
Obvious question: if you FTP to bc01f45.unx.com by some other means
what happens?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 24 May 2000 14:42:56 +0100
From: "Jon Andrew" <ja@(deletetosend)jon_andrew.freeserve.co.uk>
Subject: newbie question - dbi:mysql
Message-Id: <8ggm7d$1dvk$1@quince.news.easynet.net>
Forgive me if this is blindingly obvious - probably a case of wood not being
seen for the trees.
I am writing a script to insert values into a Mysql database using dbi from
an html form. The script is at a point where it inserts the values ok,
however I would like to verify that the sql insert statement has completed
successfully. How do I do this? Is it via the Do () function? If so how do I
access the rows affected information? I have just noted that $rv is returned
by Do() would I just need to print the content of the variable?
I would also be grateful if somebody could point me in the direction of a
good online dbi tutorial/information - I have looked at the 'official FAQ'
but that didn't really help me on this occasion.
Many thanks.
------------------------------
Date: Wed, 24 May 2000 15:55:02 +0100
From: "Alan Hood" <gi59@dial.pipex.com>
Subject: newbie question
Message-Id: <8ggq4u$suv$1@lure.pipex.net>
I,m sure that this is simple but it's causing me headaches.
I have a script which uses, a third party module, that has been running
under Unix. Since I only have access to the cgi-bin directory I cannot
install the module. However I put the module in the cgi-bin directory and
the line :-
use Module;
works fine.
I have moved to an ISP that uses NT servers and activestate perl.
Again I have put the module in the cgi-bin directory but get the error '
connot find module in @INC'.
I know that the @INC can be modified but cannot seem to get this to work
Can anybody help ?
Thanks
Alan Hood
------------------------------
Date: Wed, 24 May 2000 07:53:38 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: newbie question
Message-Id: <392BECF2.634DE68C@vpservices.com>
Alan Hood wrote:
> ...
>
> use Module;
>
> works fine.
>
> I have moved to an ISP that uses NT servers and activestate perl.
> Again I have put the module in the cgi-bin directory but get the error '
> connot find module in @INC'.
>
> I know that the @INC can be modified but cannot seem to get this to work
Look up the "lib" pragma. Basically you'll put something like
use lib '/full/path/to/your/modules/dir/';
at the top of your script.
In the future, please use a more informative subject line for you
postings. Thanks!
--
Jeff
------------------------------
Date: Wed, 24 May 2000 16:18:27 +0400
From: "Vladimir Rybintsev" <vlad@soft-tronik.ru>
Subject: Re: Newbie-- Sendmail
Message-Id: <8ggh3l$29kg$1@storm.comstar.ru>
Look at CPAN for Sender.pm
Agi <agi@feib.com.tw> wrote
> Hello,theres
> I want to sent a HTML file to someone using Perl.
> Which module can achieve my goal ??
>
> ps.I'm new in Perl.
>
> Best Regards,
> Agi Chen
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 24 May 2000 14:59:06 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: odd behavior printing after randomizing an array from STDIN
Message-Id: <slrn8iqg1t.be8.tjla@thislove.dyndns.org>
I was shocked! How could Decklin Foster <fosterd@hartwick.edu>
say such a terrible thing:
>Kiera <kiera@nnickee.com> writes:
>
>> #!perl -w
>> srand;
>> print "List of strings: ";
>> my @b = <STDIN>;
>> print "Answer: $b[rand(@b)]";
>> #__END__
>
>OK, now do it in a constant amount of space. That is, I can feed the
>program a 10GB file and it will still work (we'll assume here you have
>less than that much RAM.) Hint: it can be done in one line.
I don't think you can do it in constant space. Look to get a randome
line number you have to know how many lines there are. How will you know
how many lines there are till you have read them all in? Ah but you say
I can simply read them all in and then reopen the file and read them
again to the calculated line. But I say, what if I was doing this?:
cat /dev/random | yourscript.pl
How will you read them all in again? Of course in this case there would
be no "end" to the input so the script would never terminate. But a
version that sent (say) 100000000 bytes from /dev/random to your script
would do the trick. Now either you would have to store them all away
somewhere or you could not ever get them back (bar the random number
generator looping of course :)).
<snip>
>> Why is the sky blue? [0]
>
>Magic. ;-)
Actually it's the scattering effect of water particles in the atmosphere
:)
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
"She said, `I know you ... you cannot sing'. I said, `That's nothing,
you should hear me play piano.'"
-- Morrisey
------------------------------
Date: Wed, 24 May 2000 15:28:14 +0200
From: "e8825393" <e8825393@stud2.tuwien.ac.at>
Subject: Perl, system and Cron
Message-Id: <8ggldf$316$1@news.tuwien.ac.at>
Hi,
I want to write a perl script, which modifies the quota of a user.
Therfore I took a close look at webmin and tried it like they do it there:
1.) Create an external "Editor", where the pl-skript fills the temp-File to
modify quota :
$ENV{'EDITOR'} = $ENV{'VISUAL'} = "/usr/local/bin/edquota.pl";
2.) Do the System-Command :
system("edquota -u $_[0]");
................
edquota.pl does something like that :
open(FILE, $f);
while(<FILE>) { $qdata .= $_; }
close(FILE);
$nqdata = &edit_quota_file($qdata, $fs, $sb, $hb, $sf, $hf);
open(FILE, "> $f");
print FILE $nqdata;
close(FILE);
everything works fine (from commandline), since I try to run the script from
Cron, then no changes were made and on trying to debug the script, I found
out, that the Temp-File is not opened.
Can anyone tell me, what i have to do ?
I suggest the problem has to do with the EDITOR-Setting with doesn't effect
the cronjob. But how can I do it ?
Thanx in advance !
Andreas
------------------------------
Date: Wed, 24 May 2000 07:21:22 -0700
From: Mur <jboesNOjbSPAM@qtm.net.invalid>
Subject: Re: Perl, system and Cron
Message-Id: <14c689fc.124729a9@usw-ex0106-046.remarq.com>
In article <8ggldf$316$1@news.tuwien.ac.at>, "e8825393"
<e8825393@stud2.tuwien.ac.at> wrote:
>open(FILE, $f);
>while(<FILE>) { $qdata .= $_; }
>close(FILE);
>$nqdata = &edit_quota_file($qdata, $fs, $sb, $hb, $sf, $hf);
>open(FILE, "> $f");
>print FILE $nqdata;
>close(FILE);
Always check the error status from I/O operations, especially
open's.
open(FILE, $f) || die "Can't open '$f' for input, $!";
..
open(FILE, "> $f") || die "Can't open '$f' for output, $!";
I bet one of these errors out with a permission violation.
Jeff Boes//ICQ=3394914//Yahoo!=jeffboes//AOL IM=jboes
//home=jboes@qtm.net//professional=mur@consultant.com
* 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: Wed, 24 May 2000 12:21:17 GMT
From: montep@about.com (Monte)
Subject: Re: pl2exe missing from ActivePerl
Message-Id: <392bc913.9125186@news.hal-pc.org>
On Mon, 22 May 2000 17:26:02 +0800, Tk Soh <r28629@email.sps.mot.com>
wrote:
>I have been looking for the pl2exe utility which, per the FAQ, should be
>bundled with the installation, but none of the distributions that I have
>checked has it, this includes the latest build 613 as well as the older
>522.
>
>Can anyone please tell me where I can find it? TIA.
>
>-TK
Go to this URL for a very good explanation of what it is, where and
how it works.
http://www.oreilly.com/comments/prkwin32.html
------------------------------
Date: Wed, 24 May 2000 13:14:55 GMT
From: "Thomas Åhlen" <thomas2@dalnet.se>
Subject: Q: exec output into string
Message-Id: <jBQW4.27$Dj2.11817@dummy.bahnhof.se>
How do i get the output from en executed program inta a $string.
I have done it thi way before:
my $sys_cmd = "du -ks " . $path;
$string = `$sys_cmd`;
But i want to use exec instead:
exec 'du', '-ks', $path
or die "can't exec du: $!";
How do i get the output from exec to $string.
-Thomas Å
------------------------------
Date: Wed, 24 May 2000 15:12:13 +0200
From: Bert IJff <bert@scanlaser.nl>
To: rajmannar@aol.com
Subject: Re: Search&Match-script problem
Message-Id: <392BD52D.E38D4D42@scanlaser.nl>
Rajmannar wrote:
>
> Hi,
>
> I am facing problems while running a script for the following problem:
>
> Problem: There are two data files, basically insert statements from
> two different tables with the following format.
>
> First file has the format: Insert into TableName1 (Param1, "Param2", "Param3",
> Param4, Param5)
>
> Second file has the format: Insert into TableName2 (Param6, Param1, Param7,
> Param8,.........Param25)
> *** Note: the second file has "Param1" in the second
> parameter of the insert statement, which is the same as the first parameter
> of the insertstatement of the first file
>
> The files have over 1000's of insert statements. I need to scan through
> the first file, pick up the five parameters and then scan through the
> second file looking for a match on the second parameter. If it matches,
> i need to save all the corresponding 5+25 parameters in a third file .
>
> Here is a sample of two files: .
>
>
> File1:
> --------------------
> INSERT INTO NC_LODUCTS VALUES (999, "Big Dude", "Z", 3956, "FZ","O")
> INSERT INTO NC_LODUCTS VALUES (502, "Nice Sack", "Y", 3071, "FX","O")
> INSERT INTO NC_LODUCTS VALUES (531, "Custom Feature Package - 2 Features AB/CD
> only", "Y", 9999, "FP","C")
>
> .....
> .....
> --------------
>
> File2:
> -------
> INSERT INTO RC_LOD_DETAIL VALUES ('GY',1001,1,"01N", "All-values MM", 0.00,
> 0.00, 0.00, 0.00, NULL, "You get what you want after one hour of browsing at,
> "http://www.zzz.com", "Y", "N", "N", "N", "N", "N", "Y","N", 0, "
> MY-NXYY",NULL)
Is this for real? it looks to me that the number of " characters is
ODD.
You can use the split on comma's, as Tom suggested, only if you are
sure the fields will never contain a comma themselves.
> INSERT INTO RC_LOD_DETAIL VALUES ('MC',531,1,'ER3','Custom Feature (2
> Feature)', 0.00, 0.00, 0.00, 0.00,"",'Custom Package',"",'Y', 'N', 'Y', 'N',
> 'Y', 'N', 'Y', 'Y', 0,' ABC_TBD',NULL)
>
> ....
> ...
> -------------
>
> I have written the following script:
>
> #!/usr/sbin/perl
> $source1="/home/rmannar/perl/source1";
> $source2="/home/rmannar/perl/source2";
> $dest="/home/rmannar/perl/dest";
> open(SOURCE1,$source1) || die "cannot open file $source1 \n";
> open(SOURCE2,$source2) || die "cannot open file $source2 \n";
> open(DEST, >$dest) || die "cannot open file $dest \n";
>
> $count = 0;
> while (<SOURCE1>)
> {
> $count = $count + 1;
> chop;
> /.*\((.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\)/; ->> using Comma as a delimiter
> for pattern
> search
>
> $ID = $1;
> $NAME = $2 ;
> $PACK_FLAG = $3;
> $CT_ID = $4;
> $RC_CAT = $5;
> $FET_TYPE = $6;
>
> $KEY = ID ;
>
> open(SOURCE2,$source2) || die "cannot open file $source2 \n";
> while (<SOURCE2>)
> {
> chop;
> /([A-Z\_\s+])*\((.*)\,(\d+)\,(\d+)\,(.*)\)/;
>
> if ($3 eq $KEY)
> {
> print("$KEY Matched !!! Processing Please wait \n");
>
> /([A-Z\_\s+])*\((.*)\,(\d+)\,(\d+)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)
> \,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,(.*)\,
> (.*)\,(.*)\)/; -->> comma delimiter for search
>
> $STATE = $2 ;
> $AAA = $3;
> $BBB = $5 ;
> ...
> $ZZZ = $23;
> $RRR = $24 ;
> ...
> print DEST ("Values for $KEY are : \n");
> print DEST (" $STATE , $3, $4 ... ");
>
> }
> else
> {
> #print ("$KEY did not match \n");
> }
> }
>
> close(SOURCE2);
> }
>
> close(SOURCE1);
> close(DEST);
>
> ****************
>
> The script seems to work, but the problem is it is toooo slow.
> Is there a better way to implement this???
In addition to Tom's remarks in his answer, I'd like to say:
Well, you have two files, AND you are opening and closing SOURCE2 as
many times as there are records in SOURCE1.
First, how about opening and closing SOURCE2 only once, and at the end
of the "while (<SOURCE1>)" loop, seek to the start of SOURCE2 (in
oldfashioned TAPE terms: rewind SOURCE2)
Second, you could first find out which file is smallest, read it into
memory completely and use
your Param1 as a key to a hash for this file.
Then read the largest file and match on this key.
If I interpreted your code correctly, the Param1 is not a unique key,
so the hash solution will only work if the hash values are arrays
containing a list per array-entry.
If, of course, you know in advance that the Param1 is a unique key to
both files, you can use a simple hash construction.
Hope this helps,
Bert
>
> thanks
> raj
------------------------------
Date: Wed, 24 May 2000 14:59:20 +0200
From: "Davide Locci" <dlocci@tiscali.it>
Subject: send mail
Message-Id: <8ggjmg$u9p$1@pegasus.tiscalinet.it>
Hi all,
I'm would like to send a mail using the Net::SMTP module but i've not
installed the Smtp.pm.
Where can i find it? How can i install it?
Thanks Davide
--
-------------
Davide Locci
Tiscali SpA
VOLTrade System Administrator
------------------------------
Date: Wed, 24 May 2000 15:50:22 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: send mail
Message-Id: <huqnisk3t3fh885cli6skmf81usgsme4h8@4ax.com>
On Wed, 24 May 2000 14:59:20 +0200, "Davide Locci" <dlocci@tiscali.it>
wrote:
>
>Hi all,
>
>I'm would like to send a mail using the Net::SMTP module but i've not
>installed the Smtp.pm.
>
>Where can i find it? How can i install it?
It's part of libnet <http://search.cpan.org/search?dist=libnet>.
Install the way you install all Perl modules. See perlmodinstall for
details.
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: 24 May 2000 13:01:41 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Tanspose rows to columns
Message-Id: <959172739.28384@itz.pp.sci.fi>
In article <392AC8E5.AF768D7C@home.com>, Michael Carman wrote:
>Why not? My question, and your challenge (as originally stated) simply
>concerned the necessity of using eval(). As far as I'm concerned, Ilmari
>has fulfilled that. Why not test his code to ensure that it has the same
>functionality and run some benchmarks on it to see how the performance
>compares?
Actually, I'm willing to assume that he may have done just that before
responding. The warnings about "untested code" were indeed needed,
since the _subnode function contained a silly reference bug. It's
rather obvious once you know it's there, but if he just pasted the
code in, tried it and observed that it didn't work, his response may
have been based on that.
Moral of the story: always test code before posting.
------------------------------
Date: Wed, 24 May 2000 09:04:33 +0100
From: "Todd Carlson" <todd.carlson@bigfoot.com>
Subject: what should i read next??
Message-Id: <8gg2ek$bof$1@neptunium.btinternet.com>
I'm just about finished reading O'Reilly's "Learning Perl on Win32 Systems".
I am not clear on which book(s) I should move on to next.
I'm obviously a beginner, so I'm looking for the next step, as well as a
reference book. I've got the ActiveState distribution but I find the help
documentation a little difficult because it is not incorporated into a
search engine of any kind - any suggestions with this?
Finally, I am not a UNIX person at all.
All suggestions welcome. Thanks.
Todd Carlson
------------------------------
Date: Wed, 24 May 2000 07:37:06 -0700
From: Mur <jboesNOjbSPAM@qtm.net.invalid>
Subject: Re: what should i read next??
Message-Id: <107d4cbc.16623331@usw-ex0106-046.remarq.com>
In article <8gg2ek$bof$1@neptunium.btinternet.com>, "Todd
Carlson" <todd.carlson@bigfoot.com> wrote:
>I'm just about finished reading O'Reilly's "Learning Perl on
Win32 Systems".
>I am not clear on which book(s) I should move on to next.
>
>I'm obviously a beginner, so I'm looking for the next step, as
well as a
>reference book. I've got the ActiveState distribution but I
find the help
>documentation a little difficult because it is not incorporated
into a
>search engine of any kind - any suggestions with this?
>
>Finally, I am not a UNIX person at all.
>
This depends on what it is you want to do with Perl. Books
like "Programming Perl", "The Perl Cookbook", and "Effective
Perl Programming" are all good next steps for a generalist
approach. "Programming with CGI.pm" and "Writing Apache Modules"
takes you off into a different realm (CGI/web
development). "Mastering Algorithms" yet another, and so on.
I recommend you do some thinking about what it is you want to
use Perl *for*, and then some research (www.bookpool.com,
www.perl.com, etc.) to see what books are out there and what
their ratings are.
Jeff Boes//ICQ=3394914//Yahoo!=jeffboes//AOL IM=jboes
//home=jboes@qtm.net//professional=mur@consultant.com
* 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: 24 May 2000 13:30:11 GMT
From: yhlee@mail.med.upenn.edu (Young H Lee)
Subject: where to find lanman.pm?
Message-Id: <8gglh3$6c4$1@netnews.upenn.edu>
Does anyone know where to find this module? I looked in cpan and i tried
to use the "PPM" thing on my command line, all to no avail.. Any help
would be appreciated. (This is all on a winNT box)
--
-----
Young H. Lee
"Never try to teach a pig to sing. It wastes your time and annoys the pig."
------------------------------
Date: Wed, 24 May 2000 13:51:44 GMT
From: hritzman@my-deja.com
Subject: Writing a concurrent server in perl
Message-Id: <8ggmp8$aju$1@nnrp1.deja.com>
I am trying to write a concurrent server in perl, i.e. work for the
daemon comes in faster than it can be serviced so I want to fork a
child to handle each request. The problem I'm having is that if I use a
signal handler to reap the children, the daemon itself is also killed.
Without the signal handler I create a bunch of defunct processes that
have the potential of filling up the process table. The code below is a
trimmed down version of the problem. The child dies at 15 seconds
taking the parent with it. Any suggestions would be greatly
appreciated.
#!/usr/bin/perl -w
use POSIX;
use English;
# Disassociate and kill the parent donating the child to init
#
if (fork)
{
exit 0;
}
else
# This simulates the daemon side. It will fork a child to
# do a long running task (15 secs) and continues to run for 30
# secs. The child's death should be handled by signal handler
# instead of creating defunct processes
{
$0 = "test.daemon";
POSIX::setsid();
$SIG{CHLD} = sub { wait };
if (fork)
{
sleep(30);
print "Daemon process exiting";
}
else
{
$0 = "test.child";
sleep(15);
print "Child process exiting";
}
exit(0);
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 24 May 2000 14:42:53 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Writing a concurrent server in perl
Message-Id: <7a8zx0xb4i.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
hritzman@my-deja.com writes:
> I am trying to write a concurrent server in perl, i.e. work for the
> daemon comes in faster than it can be serviced so I want to fork a
> child to handle each request. The problem I'm having is that if I use a
> signal handler to reap the children, the daemon itself is also killed.
> Without the signal handler I create a bunch of defunct processes that
> have the potential of filling up the process table.
This is described quite well in 'perlipc'. I suggest you read it if you
haven't done so already.
...
> $SIG{CHLD} = sub { wait };
You have to reset $SIG{CHLD} after each call to it. So, try the answer
given in 'perlipc' :
sub REAPER {
$waitedpid = wait;
# loathe sysV: it makes us not only reinstate
# the handler, but place it after the wait
$SIG{CHLD} = \&REAPER;
}
$SIG{CHLD} = \&REAPER;
--Ala
------------------------------
Date: 24 May 2000 10:08:21 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: writing Form content to a File-CGI
Message-Id: <8gg9ml$6qk$1@newsflash.concordia.ca>
In article <8gg8c7$rj$1@nnrp1.deja.com>, <devynckj@sans.co.za> wrote:
>I want to write the form contents to an HTML or text file. I use -
>open(NAME, ">>filename.html");
*always* check system calls.
open NAME, ">>filename.html"
or die "opening filename.html failed: $!";
>print NAME "$FORM{contents}\n";
>close(NAME);
BTW, how can you append to an HTML file? It doesn't make
a lot of sense. Perhaps you meant ">filename.html" ?
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Wed, 24 May 2000 13:12:32 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: writing Form content to a File-CGI
Message-Id: <8ggkfk$8qq$1@nnrp1.deja.com>
In article <8gg8c7$rj$1@nnrp1.deja.com>,
devynckj@sans.co.za wrote:
> Hi
> I want to write the form contents to an HTML or text file. I use -
> open(NAME, ">>filename.html");
open (NAME, ">>filename.html") || die "cannot open filename.html,
$!.\n";
> print NAME "$FORM{contents}\n";
where is %FORM defined and (more specifically) where is the value of
$FORM{contents} established?
> close(NAME);
>
> But it does not open the file.
how do you know the file did not get opened?
> Nothing gets added to the file. I am
> using an IIS server. Any suggestions? Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3146
**************************************