[12397] in Perl-Users-Digest
Perl-Users Digest, Issue: 5997 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 01:07:35 1999
Date: Mon, 14 Jun 99 22:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 14 Jun 1999 Volume: 8 Number: 5997
Today's topics:
Re: @INC bizarreness (Ronald J Kimball)
Re: ADO and Perl billsterz@my-deja.com
Re: Afraid to ask about Y2K! <webmaster@chatbase.com>
Re: Compiling regexes for the duration of a subroutine (Ronald J Kimball)
Re: Compiling regexes for the duration of a subroutine <uri@sysarch.com>
DBI connect statement weazies@yahoo.com
Re: Digest::MD5 <walton@frontiernet.net>
Re: File Uploading via html form <camerond@mail.uca.edu>
File Uploading <aneesha@vettweb.net.au>
Re: File Uploading <JFedor@datacom-css.com>
Re: importing comma-delimited data into perl? <escba@home.com>
Re: importing comma-delimited data into perl? <rick.delaney@home.com>
Re: importing comma-delimited data into perl? <jeff@vpservices.com>
In need of email from perl on NT <escba@home.com>
Re: In need of email from perl on NT (Sam Holden)
Re: In need of email from perl on NT <wyzelli@yahoo.com>
Re: Increment counter by Decials? (Tad McClellan)
Re: my() in a loop (Eric Bohlman)
Re: Newbie wants to know: How would you do this? <walton@frontiernet.net>
Re: Perl Compiler j@m.c
Perl Server? paul@gina.net
Re: Perl tuning/speed question: all subsets of a set of (Tad McClellan)
Re: Polling a file? (Tad McClellan)
Regex question <JFedor@datacom-css.com>
Re: regex to replace quotes delimited by quotes. (Ronald J Kimball)
Re: SIGCHLD problems (Charles DeRykus)
Re: Sorting Arrays of Arrays, Thanks! (Completed script (Marc Bissonnette)
Re: Sorting Arrays of Arrays, Thanks! (Completed script (Tad McClellan)
Re: Sorting Arrays of Arrays, Thanks! (Completed script (Eric Bohlman)
user IP <leonid76@erols.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jun 1999 00:41:14 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: @INC bizarreness
Message-Id: <1dtetvd.b2wamg1s2i96oN@p24.tc2.metro.ma.tiac.com>
Uri Guttman <uri@sysarch.com> wrote:
> you obviously have 2 different installed perl's there. carefully check
> for perl on your path and the one used in the shebang line.
>
> run a plain perl -V and /usr/sbin/perl -V (and any other paths to perl)
> and look at the results.
>
And here's a useful script by Tom Christiansen for finding all those
perls (or whatever executable you're looking for) in the path.
#!/usr/local/bin/perl
# wh - like which, but find all in path.
foreach $file (@ARGV) {
for $dir (split(/:/,$ENV{'PATH'})) {
print $path,"\n" if -f ($path="$dir/$file") && -x _;
}
}
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 15 Jun 1999 03:29:37 GMT
From: billsterz@my-deja.com
Subject: Re: ADO and Perl
Message-Id: <7k4hao$b4t$1@nnrp1.deja.com>
In article <7hpbu2$ea2$1@nickel.uunet.be>,
"Wesley" <wesley@persup.com> wrote:
> Does anyone have an example on how to access a SQL server database
using ADO
> in Perl?
>
> TIA (please reply to my e-mail address).
>
> Is your server Unix?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 14 Jun 1999 20:08:43 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: mmorris@mindspring.com
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3765C3BB.687A2F03@chatbase.com>
Mitchell Morris wrote:
>
> In article <7jspcn$2c4$1@nnrp1.deja.com>, finsol@ts.co.nz wrote:
<SNIP>
You may have missed Jocelyn's previous rantings here. It seems Jocelyn
has some vindictive type personality, as Jocelyn is convinced there's
some huge problem with Perl's Y2K problem that she made up for herself.
Therefore, until *we* (as a group and as Perl programmers) agree with
*her* conclusion (no matter how uninformed and ignorant *she* is about
it), then she will continue to label *all* Perl (and is seems "C")
programmers as "ignorant", "naive" and "stubborn". You're wasting your
time talking to a stone wall my friend, and a very thick one at that.
Apparently Jocelyn is the only person that has the exclusive right to be
correct, even when Jocelyn's observations are distorted and lack study
of the subject in question.
Luckily I've seen very few people practice the religion of such
belligerent and blatant stupidity, wherein they are their own victim and
attempt to blame their problems on everyone else. Unfortunately I don't
have the PHD to offer Jocelyn the proper help, so I think you're just
adding wood to her fire of stupidity.
I have serious doubts Jocelyn will understand your post, and will only
take offense, but I enjoyed it. :-)
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
------------------------------
Date: Tue, 15 Jun 1999 00:41:33 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <1dteum7.ykt2niwnlxwoN@p24.tc2.metro.ma.tiac.com>
John Siracusa <macintsh@cs.bu.edu> wrote:
> I can't put /o on those matches because it'll only compile
> the regexes the first time foo() is called. I can't use the
> dubious "last successful match" null regex technique because
> I have more than one regex.
I must object to this characterization of the null regex technique as
'dubious'. Although it will not work for your case, as you say, I have
put it to very good use in one of my programs for a noticeable gain in
efficiency.
So there.
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -se'" "=~/\s/;print sort grep//,keys%main::
' -- -is -' Just' -' another ' -'Perl ' -'hacker
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: 15 Jun 1999 00:41:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <x7u2saf52p.fsf@home.sysarch.com>
>>>>> "RJK" == Ronald J Kimball <rjk@linguist.dartmouth.edu> writes:
RJK> John Siracusa <macintsh@cs.bu.edu> wrote:
>> I can't put /o on those matches because it'll only compile
>> the regexes the first time foo() is called. I can't use the
>> dubious "last successful match" null regex technique because
>> I have more than one regex.
RJK> I must object to this characterization of the null regex
RJK> technique as 'dubious'. Although it will not work for your case,
RJK> as you say, I have put it to very good use in one of my programs
RJK> for a noticeable gain in efficiency.
have you compared it to using qr//? if all you gain is not recompiling
the regex, it would be even in cpu but clearer in code to use qr.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 15 Jun 1999 02:12:11 GMT
From: weazies@yahoo.com
Subject: DBI connect statement
Message-Id: <7k4cpl$9ml$1@nnrp1.deja.com>
Thank you all for your inputs, I finally figure out that
there is something wrong with my DBI connect
statemet. And here it is:
$dbh=DBI->connect('DBI:mysql:mysql:localhost:port=3309:socket=/tmp/mysql
d-new.sock', 'dbuser', 'dbpasswd') or
die "Cannot connect to database : $DBI::errstr\n";
Output: Access denied blah, blah, blah
(As you might have guessed, I try to connect to the second MySQL
database using the alternative socket and port.)
What is wrong with this connect statement and what would be the correct
one? Thanks a lot.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 15 Jun 1999 00:00:46 -0400
From: Bob Walton <walton@frontiernet.net>
To: jonathan.loh@bankamerica.com
Subject: Re: Digest::MD5
Message-Id: <3765CFEE.A2DFFDEC@frontiernet.net>
Jonathan, MD5 gets you a "message digest", which is a short character
string generated from the contents of a file. It is used to ensure that
the file hasn't been corrupted or modified in some way, but it can't be
used to regenerate the contents of a file. It is almost impossible to
modify a file in such a way that the modified file will generate the same
MD5 string as the original file.
I recommend you use PGP for file encryption and decryption. PGP has
nothing in particular to do with perl. It's probably a no-no if you want
to do anything outside of the US or Canada, though.
jonathan.loh@bankamerica.com wrote:
> Can someone please provide me a sample of how to encrypt and decrypt a
> file using the Digest::MD5 package? Or can I even do this using this
> package? If not what package do I need?
>
> Please email me as well as post the answer to this newsgroup.
> --
> Jonathan Loh
> System Administrator
> Bank Of America
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Mon, 14 Jun 1999 23:10:11 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
To: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: File Uploading via html form
Message-Id: <3765D223.BF16B905@mail.uca.edu>
[cc'd to dc]
David Cassell wrote:
>
> [courtesy cc to poster]
>
> Cameron Dorey wrote:
> > [snip of mg's text]
> >
> > The code to all of the examples in the book is listed at Lincoln's
> > website (actually Wiley's)
> > http://www.wiley.com/compbooks/stein/source.html. I figure from this
> > it's fair game to copy.
>
> Well, the OED is on-line if you know where to go, but I'm pretty
> sure that has a copyright or trademark or *something*. :-)
>
> I'm not too comfortable with the inference:
> readable -> free-to-copy-at-will
>
> But perhaps I'm just a stick in the mud.
I guess I should have been more complete in my reasoning. If you read
Lincoln's web page cited above, you come to the sentence:
"There are no restrictions on your use of this source code. Feel free to
redistribute it, modify it for your own purposes, or incorporate it into
your own projects. Have fun!"
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Tue, 15 Jun 1999 14:50:57 +1000
From: "Aneesha" <aneesha@vettweb.net.au>
Subject: File Uploading
Message-Id: <kTk93.2008$fR5.12111@ozemail.com.au>
Hi
While I'm familiar with ASP, and Javascript I'm very new to writing cgi
programs with perl. I basically need to get a script that will allow a user
to upload a file to a directory on my webserver. All the scripts i have
tried don't work and just get an internal server error. The problem is that
all the scripts i can find use the CGI.pm module which i don't think is
installed on the server. When i ring the ISP tech support - all they say is
that they will check and send me an email. I never get that email. I don't
have telnet access either. My client really wants the site finished but I'm
stalled because of where it is hosted. So my question is can i upload files
without the cgi.pm module. Is there any way to use ftp from a perl cgi
script? Any help in the right direction would be much appreciated.
Aneesha
------------------------------
Date: Tue, 15 Jun 1999 01:28:54 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: File Uploading
Message-Id: <7k4mij$kpc$1@plonk.apk.net>
You might want to get an new ISP. APK allows telnetting and has the latest
and greatest Perl installed along with all the modules. Also has all docs,
faqs etc.
Jody
http://www.apk.net
------------------------------
Date: Tue, 15 Jun 1999 03:09:25 GMT
From: Peg Grubb <escba@home.com>
Subject: Re: importing comma-delimited data into perl?
Message-Id: <3765C326.AEF8BD4C@home.com>
Try this to slurp up a comma delimited line...
($var1,$var2,$var3,$ect) = split(/\,/, $_); # Note the backslash to
escape the first comma. Hope this helps!
Kate Roberts wrote:
>
> Dear all: I'm very new at this, so please excuse asking what might be
> obvious to others.
>
> I have a file containing comma-delimited data (exported from EXCEL),
> egmyfile... "field1-wanted later","field2","field3-wanted"
> "field1-wanted later","field2","field3-wanted"
> "field1-wanted later","field2","field3-wanted"
> which I want to bring into perl, filter out most of the fields, and
> then output the fields of interest.
>
> I had thought that since you can assign separate fields to a list-array
> as follows:
> @listarray = ("field1-wanted later","field2","field3-wanted");
>
> that it might also be possible to first put each line from the file into
> a scalar, and then replicate the pattern above using that scalar
> eg
> open (FILEHANDLE, "myfile");
> while ($scalar1 = <FILEHANDLE>) {
> chomp $scalar1;
> @listarray1 = ($scalar1); #This line should be equivalent to above
> print "$listarray1[0]\n";
> print "$listarray1[2]\n";
> }
> close(FILEHANDLE);
>
> It doesn't work, though.
> Can anyone advise me on how to achieve importing this data?
>
> Many thanks,
> Kate
--
Esc (Executive Search Consultants)
URL: www.escba.com
Peg Grubb, President/Principal Recruiter
Check out our web page for hints on Interviewing, When to use a
Recruiter & other Informative Tips to enhance your search.
------------------------------
Date: Tue, 15 Jun 1999 03:39:36 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: importing comma-delimited data into perl?
Message-Id: <3765CAB5.D6436288@home.com>
[posted, but not to alt.perl, & mailed]
Peg Grubb wrote:
>
> Try this to slurp up a comma delimited line...
>
> ($var1,$var2,$var3,$ect) = split(/\,/, $_); # Note the backslash to
> escape the first comma.
Noted. Why is that there again? Oh, yes. Same reason as $_ and those
parentheses. :-)
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 15 Jun 1999 03:49:31 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: importing comma-delimited data into perl?
Message-Id: <3765CCB0.F5880E48@vpservices.com>
Peg Grubb wrote:
>
> Try this to slurp up a comma delimited line...
>
> ($var1,$var2,$var3,$ect) = split(/\,/, $_);
Sorry, that is just plain wrong. See perlfaq4, especially the part that
says:
<quote_from_perlfaq4>
You can't use split(/,/) because you shouldn't split if the comma is
inside quotes. For example, take a data line like this:
SAR001,"","Cimetrix, Inc","Bob Smith","CAM",N,8,1,0,7,"Error, Core
Dumped"
</quote_from_perlfaq4>
Should "Error" and " Core Dumped" be two separate fields, as they would
be using your slurp method? No, they are both part of a single field
which happens to have a comma in it.
--
Jeff
------------------------------
Date: Tue, 15 Jun 1999 03:03:40 GMT
From: Peg Grubb <escba@home.com>
Subject: In need of email from perl on NT
Message-Id: <3765C1CD.C3A89DB9@home.com>
I use sendmail in Unix...what's typically used on NT using Perl to send
the email? Any help appreciated. ggrubb@sr.hp.com
------------------------------
Date: 15 Jun 1999 03:07:00 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: In need of email from perl on NT
Message-Id: <slrn7mbgqk.fin.sholden@pgrad.cs.usyd.edu.au>
On Tue, 15 Jun 1999 03:03:40 GMT, Peg Grubb <escba@home.com> wrote:
>I use sendmail in Unix...what's typically used on NT using Perl to send
>the email? Any help appreciated. ggrubb@sr.hp.com
What does the FAQ 'How do I send mail?' mention in the documentation
that comes with perl?
Read the documentation before you post, otherwise you look like an idiot.
If the answer given doesn't work then post and ask explaining what went
wrong...
--
Sam
Anyway, the other successor to C gobbled up two letters instead of one.
Which is why many Perl scripts have the extension, ``.pl'', finishing
off BCPL. --Larry Wall
------------------------------
Date: Tue, 15 Jun 1999 13:19:46 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: In need of email from perl on NT
Message-Id: <c4k93.117$hR4.37580@vic.nntp.telstra.net>
Peg Grubb <escba@home.com> wrote in message
news:3765C1CD.C3A89DB9@home.com...
> I use sendmail in Unix...what's typically used on NT using Perl to send
> the email? Any help appreciated. ggrubb@sr.hp.com
I have found Blat works well.. though you need to address it differently
from sendmail
Wyzelli
------------------------------
Date: Mon, 14 Jun 1999 15:26:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Increment counter by Decials?
Message-Id: <m1l3k7.nsc.ln@magna.metronet.com>
Trent (trent@jps.net) wrote:
: Nothing in Deja,
: Nothing found in FAQ.
: Is it possible to increment a counter
: by anything other than 1?
Yes.
: $saw_sold{$salesperson}++;
: I need to increment the counters by (.5) for each match found, instead
: of just by (1).
: Manipulating the count after sorting the keys doesen't work in this case.
I'm sure that I don't know what that sentence means. <shrug>
: Is there a way?
Yes, Perl _does_ support the addition operator:
$saw_sold{$salesperson} = $saw_sold{$salesperson} + .5;
Which can be shortened to:
$saw_sold{$salesperson} += .5;
But be aware that you are now using floating point instead of
integers with the inaccuracies that go with them.
Don't know it that will make any difference or not, since you
haven't shared what the counter is to be used for...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Jun 1999 04:05:32 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: my() in a loop
Message-Id: <ebohlmanFDCop8.Et@netcom.com>
Lee (rlb@intrinsix.ca) wrote:
: In article <7k39m0$es$1@news1.bu.edu>,
: John Siracusa <macintsh@cs.bu.edu> wrote:
: >So, where do you put your my()'s, and why?
:
: I always do as in Example 1 [declarations outside the loop], because I'm
too durn lazy to find
out what the : repercussions of style-2 declarations may or may not be.
But sometimes putting the declaration outside the loop has repercussions
as well. "Always" is an awfully strong word. Can you tell why this code
doesn't work properly?
my @params;
while (<INPUT>) {
chomp;
@params=split(/:/);
push @paramlist,\@params;
}
------------------------------
Date: Tue, 15 Jun 1999 00:09:08 -0400
From: Bob Walton <walton@frontiernet.net>
To: Barista@End.Of.Universe
Subject: Re: Newbie wants to know: How would you do this?
Message-Id: <3765D1E4.593CA29E@frontiernet.net>
Ken, you will want to visit newsgroup comp.infosystems.www.authoring.cgi,
rather than comp.lang.perl.misc. Start with their FAQ's. Try a couple of
books on CGI. Read your web server's docs. If you have specific perl
questions, ask here :-).
Ken Bass wrote:
> (First, thanks to all who responded to my earlier request. I got a lot
> of very helpful information, and very little arrogance :-) ).
>
> Being a newbie to perl and all of the other web stuff, I have become
> overwhelmed trying to understand it all. I know that what I want to do
> is possible, but I just need someone to help me wade through
> everything and point me to the right stuff, and in the right, general
> direction. TIA:
>
> I would like to design a "personalized" home page for our site. The
> <stuff deleted>
>
> ken bass
> kbb@SoftSteps.com
------------------------------
Date: Tue, 15 Jun 1999 04:07:18 GMT
From: j@m.c
Subject: Re: Perl Compiler
Message-Id: <3765d0f7.53175058@news.mindspring.com>
On Tue, 15 Jun 1999 01:15:35 GMT, cor75@my-deja.com wrote:
>Do I need to have root access in order to run make for the Perl
>Compiler?
>
>Thanks
>Cory
In most cases, a yes. I've never tried it but I think I saw somewhere
in the docs that it's possible to do a local perl install in your home
directory ... sounds like a headache to me. Better off talking to your
sysadmin about installing perl ... after all, what sysadmin worth
anything wouldn't want perl!? :P
- James
------------------------------
Date: Tue, 15 Jun 1999 02:52:12 GMT
From: paul@gina.net
Subject: Perl Server?
Message-Id: <7k4f4p$afg$1@nnrp1.deja.com>
I am trying to create an artificial printer out of an IP. I wiould like
to take all files sent to an IP on a given port and simply write them to
a file. What would the best way to do this? Use IO::Socket and listen
for a given port? Any other suggestions?
-Paul Vining
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 14 Jun 1999 15:32:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl tuning/speed question: all subsets of a set of length k -- keeping
Message-Id: <4cl3k7.nsc.ln@magna.metronet.com>
Armin S. A. Roehrl (Armin.Roehrl@epfl.ch) wrote:
: Subject: Perl tuning/speed question: all subsets of a set of length k -- keeping
: I got some problem, and I wonder how close to the speed of C I can get
: with the following problem. I appreciate all your input a lot.
Where is the Perl code that your Subject says you want "tuned"?
I think you forgot to include it...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 14 Jun 1999 18:26:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Polling a file?
Message-Id: <8iv3k7.nsc.ln@magna.metronet.com>
Mitch (portboy@home.com) wrote:
: fundamental question. If I open the file for reading, and do nothing to
: it, does the modification time change or only the access time?
You don't need to clog up Usenet with that question.
You just dash off a little Perl program to see
for yourself what it does...
-----------------------
#!/usr/bin/perl -w
use strict;
my($atime, $mtime) = (stat 'datafile')[8,9];
print "before a: $atime m: $mtime\n";
open(FILE, 'datafile') || die "could not open 'datafile' $!";
1 while <FILE>; # read all of the lines
close(FILE);
($atime, $mtime) = (stat 'datafile')[8,9];
print " after a: $atime m: $mtime\n";
-----------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Jun 1999 00:16:06 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Regex question
Message-Id: <7k4ia6$id4$1@plonk.apk.net>
Ok.. I'm bashing my head in the wall here... I've look and read perldoc
perlre...
I've looked in my perl books and just can't understand this:
$date=localtime;
My $date variable now has Tue Jun 15 00:10:02 1999.
I would like $date to have Tue Jun 15 1999.
I came up with $date =~ s/(\w+{4}?)//;
(My thinking \w matches first letter in word adding + matches whole word,
using () because of grouping using {4} because perlre says to and ? because
it could be anything.)
I think the regex would match the 4th whole word and replace it with
nothing. I doesn't work but I don't understand why not. I have been
reading "Mastering Regular Expressions" but for an old GW Basic programmer
this is a hard concept to grasp. It's very complicated and I don't have any
friends who know Perl except you guys and gals.
Please help me.
Jody
------------------------------
Date: Tue, 15 Jun 1999 00:41:19 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: regex to replace quotes delimited by quotes.
Message-Id: <1dtezc3.hvmxenyune1jN@p24.tc2.metro.ma.tiac.com>
Vicuna <vicuna@my-deja.com> wrote:
> s/"(.*)"/$_=$1;s|"|""|g;'"'.$_.'"'/e;
>
> Challenge: more elegent solution? Perhaps wrong am I?
This probably isn't more 'elegant', but it is OMWTDI.
s/"/""/g;
s/""/"/;
s/(.*)""/$1"/s;
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 15 Jun 1999 02:08:46 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: SIGCHLD problems
Message-Id: <FDCJAM.AGp@news.boeing.com>
In article <7k110g$8p1@overload.lbl.gov>,
Michael Helm <helm@fionn.es.net> wrote:
>Someone's installing a SIGCHLD handler and not resetting
>things to normal after they are done. (That's my theory.)
>I've been using some assorted modules in a project, & I suspect
>that some of the database modules may be responsible, but
>not sure yet.
>
>How can I debug this problem? How can I trace the changes to the
>perl data structures that manage signal handling, and/or any other
>changes to it that mite take place outside the interpereter itself?
>Any ideas or recommendations appreciated.
What're the symptoms of the problem - children reaped in the
bud, core dumps, signal havoc, etc. ... ?
--
Charles DeRykus
------------------------------
Date: Tue, 15 Jun 1999 03:33:27 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: Sorting Arrays of Arrays, Thanks! (Completed script included)
Message-Id: <bQj93.10877$ga.13096@news21.bellglobal.com>
In article <377172f4.8474535@enews.newsguy.com>, marcel.grunauer@lovely.net
says...
>There's probably more that could be improved here. Sorry about the
>nit-picking.
No need to be sorry, the advice is much appreciated. I'm going to try to
implement everything you suggested (well, try it anyways, the stuff I
understand)
There were a couple of variables left in there from previous iterations I
forgot to take out, like the @printed stuff, and the $test.
I keep meaning and meaning to read CGI.pm and learn it, since at least two
dozen people have told me it's superior to cgi-lib, but the one time I tried
calling stuff from it, the webserver generated an error (yes, I'm going to
switch hosts soon)
Thanks again for your help!
--
----------------------------
Marc Bissonnette
InternAlysis
Corporate Internet Research and Results!
http://www.internalysis.com
------------------------------
Date: Mon, 14 Jun 1999 15:41:26 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Sorting Arrays of Arrays, Thanks! (Completed script included)
Message-Id: <6tl3k7.nsc.ln@magna.metronet.com>
Marcel Grunauer (marcel.grunauer@lovely.net) wrote:
: On Mon, 14 Jun 1999 19:16:56 GMT, dragnet@internalysis.com (Marc
: Bissonnette) wrote:
: I haven't been following the thread from the beginning (sorry), but I
: saw the script and wanted to make a few comments.
: > $data{$blarg} = {
: > fname => $line[0],
: > lname => $line[1],
: > title => $line[2],
: > company => $line[3],
: > address1 => $line[4],
: > address2 => $line[5],
: > city => $line[6],
: > province => $line[7],
: > postal => $line[8],
: > country => $line[9],
: > work_phone=> $line[10],
: > work_fax => $line[11],
: > email => $line[12],
: Isn't there a more elegant way? Anyone?
I think the way given is self-documenting, and I would leave
it that way.
If you don't want to leave it that way, you could use
a hash slice:
@{$data{blarg}}{ qw/fname lname title company/} = @line;
Saves typing, and nobody but you will know what is going on.
Not Good...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Jun 1999 04:17:28 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Sorting Arrays of Arrays, Thanks! (Completed script included)
Message-Id: <ebohlmanFDCp94.19L@netcom.com>
Marcel Grunauer (marcel.grunauer@lovely.net) wrote:
: On Mon, 14 Jun 1999 19:16:56 GMT, dragnet@internalysis.com (Marc
: Bissonnette) wrote:
: > $data{$blarg} = {
: > fname => $line[0],
: > lname => $line[1],
: > title => $line[2],
: > company => $line[3],
: > address1 => $line[4],
: > address2 => $line[5],
: > city => $line[6],
: > province => $line[7],
: > postal => $line[8],
: > country => $line[9],
: > work_phone=> $line[10],
: > work_fax => $line[11],
: > email => $line[12],
:
: Isn't there a more elegant way? Anyone?
A hash slice:
@{$data{$blarg}}{qw/fname lname title company ... email/}=@line;
------------------------------
Date: Tue, 15 Jun 1999 00:03:52 -0400
From: "Leonid Goltser" <leonid76@erols.com>
Subject: user IP
Message-Id: <7k4j9g$127$1@autumn.news.rcn.net>
Is there a method in perl to check for IP?
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5997
**************************************