[6528] in Perl-Users-Digest
Perl-Users Digest, Issue: 153 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 21 08:07:24 1997
Date: Fri, 21 Mar 97 05:00:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 21 Mar 1997 Volume: 8 Number: 153
Today's topics:
Re: [Q] Finding the contents of a directory? <tchrist@mox.perl.com>
Re: A question regarding s/(w+)/\L\u$1/g (M.J.T. Guy)
Re: Getting Perl 5 (I R A Aggie)
Re: gzip, perl and libwww <aas@bergen.sn.no>
Re: Help reading pipes "unbuffered"? (Paul D. Smith)
Re: Help Wanted! (Daniel Macks)
Help with called Virtual Classes <kevina@clark.net>
Re: How to use modules in Perl5? <tchrist@mox.perl.com>
Re: how2 run perl on win 3.11 system?? <harald.joerg@mch.sni.de>
Re: Mailing files from a perl script <jimk@tricreations.com>
Multi-dimension array creation <jcp@misty.EUnet.pt>
Re: Open file works under DOS, not under server (Brian Lavender)
Re: overloading operators? <rra@cs.stanford.edu>
Parsing a string <stevej@mistic.net>
Re: Perl Data Structures Cookbook. Wher did it go? <tchrist@mox.perl.com>
Re: Problems with a trivial piece of code.. <tchrist@mox.perl.com>
Re: Q: How to search _VERY_ long scalars for recurring <merlyn@stonehenge.com>
Re: Q: How to search _VERY_ long scalars for recurring <tchrist@mox.perl.com>
Run shared executables (Garret Davis)
Running a DOS-command under perl for OS/2 volker.doerrsam@mach.uni-karlsruhe.de
Re: Running Dos Programs from within Perl For NT ("John Dallman")
Re: SIGPIPE in LWP::Socket::connect on Solaris 2.5.1 <aas@bergen.sn.no>
Re: Sort question ("John Dallman")
Re: Suidperl! <rootbeer@teleport.com>
Re: term 'regular expressions' considered undesirable (Rahul Dhesi)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Mar 1997 20:58:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [Q] Finding the contents of a directory?
Message-Id: <5gs8cr$1n7$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Opera Ghost <agent.email@NetTown.com> writes:
:amas@lhr-sys.dhl.com wrote:
:aside...
:yo, why dont u take a quick look at a index of some perl book before
:asking the world wide comunity? well i guess u have ur reasons...
:
:so, no anwser, but here's an 'index' i wrote last nite...
:http://nettown.com/site_perl/search.cgi
:search for 'find', choose that first link
lissen, dood. ewe hev da simppel choyse uv riting yo poosts
or bee laik tootellie ignorificated bai da rayest uv us. ewe
arrent koooool, and ewe arrent clevver. ewe arre oonlie raiting
like an annoyalting punker, and ewe reelie disurv kialfailling.
In short: get a clue, or get lost. You aren't helping anyone.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
------------------------------
Date: 21 Mar 1997 12:04:58 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: A question regarding s/(w+)/\L\u$1/g
Message-Id: <5gttha$g6v@lyra.csx.cam.ac.uk>
Jim Showalter <gamma@mintaka.iern.disa.mil> wrote:
>
>Last night I played around with this and came up with a similar answer
>that you did. However, I reversed the \L\u construct to \u\L. I would
>have thought the characters should first be forced to lower case and then
>the first chracter changed to upper case. To my surprise, the answer is
>the same and \L does not undo \u. I checked page 40 of Camel 2nd Ed but
>it didn't say. Could you please explain why?
All \L and \u do is set flags which modify processing of subsequent
characters. Specifically,
if \u is set, convert this character to uppercase, taking precedence
over the \L flag, and reset the \u flag.
if \L is set, convert this character to lowercase.
Obviously, setting flags can be done in any order, since the *flags*
don't interact, only the actions they trigger.
Mike Guy
------------------------------
Date: Thu, 20 Mar 1997 09:57:53 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Getting Perl 5
Message-Id: <fl_aggie-ya02408000R2003970957530001@news.fsu.edu>
In article <01bc3527$938b2e20$ae49c2cf@ocoi>, "Jonathan Barry Neufeld"
<jneufeld@rapidnet.net> wrote:
+ How can I get a Perl 5 compiler and a documentation for it?
Do you mean "I have perl v5, the interpreter, but I desire a compiler"
or "I don't have perl at all and want to use it"?
Two different questions, two different answers. One WWW site, tho. :)
<url:http://www.perl.com/perl/>
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 21 Mar 1997 10:05:46 +0100
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: gzip, perl and libwww
Message-Id: <hsp1pzkb9.fsf@bergen.sn.no>
Jeff Seifer <jeffs@pop3.silverplatter.com> writes:
> I have also tried:
> print `gzip -c $filename`;
> on my CGI end, and got the same results...
>
> Anyone know what else I can try???
system "gzip -c $filename";
--
Gisle Aas <aas@sn.no>
------------------------------
Date: 21 Mar 1997 00:49:34 -0500
From: psmith@baynetworks.com (Paul D. Smith)
Subject: Re: Help reading pipes "unbuffered"?
Message-Id: <p5hgi54wwh.fsf@baynetworks.com>
%% Regarding Help reading pipes "unbuffered"?; I wrote:
pds> I've already written my own fork/exec sub in perl: is there any way I
pds> can read from the file descriptor in an "unbuffered" way, rather than a
pds> line at a time? Do I need to use sysread? Can anyone provide a small
pds> example?
Sorry for following up my own post, but I figured it out. I forgot that
read(2) on a pipe returns when the pipe is empty, even if it hasn't read
as many bytes as you asked for (I momentarily thought it waited for the
number of bytes you requested).
This loop seems to do the trick quite nicely:
my ($c, $len, $off) = ("", 0, 0);
while ($len = sysread FD, $c, 256, $off) {
print substr($c, $off);
$off += $len;
}
I can then test the $c string at the end to see if it contains any error
messages. Comments?
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@baynetworks.com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions--Bay Networks takes no responsibility for them.
------------------------------
Date: 21 Mar 1997 08:52:45 GMT
From: dmacks@netspace.org (Daniel Macks)
Subject: Re: Help Wanted!
Message-Id: <5gti8t$hfa@cocoa.brown.edu>
I don't know of one, but it'd be a pretty simple task. Simply use
LWP::UserAgent to send a POST request to
http://www.usps.gov/cgi-bin/zip4/ctystzip
and send the data
ctystzip=02912
and the result will be a bunch of easily-parsable information from the
post office ZIP code database forthe given ZIP code. For more info on
this and other USPS lookups, check out http://www.usps.gov/ncsc/
chandu eati (eati@renoir.csc.vill.edu) wrote:
: Is there a utility (Perl or CGI script) with which we
: can generate US state and county names when a user
: submits only a zip code.
[also emailed as requested]
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Fri, 21 Mar 1997 02:21:09 -0600
From: Kevin Atkinson <kevina@clark.net>
Subject: Help with called Virtual Classes
Message-Id: <858931407.17249@dejanews.com>
I have a problem.
I have a Class that has class data (class defaults actually).
And I want to be able to create so called virtual classes (a new class
that behaves just like the real class but it is actually an object) that
have their own private class data. (Mainly so that I declare the virtual
class using my in a function and be able to modify the defaults with out
effecting the defaults for other functions or outside of that function.)
And for some of the functions I need to able to tell if the thingie that
was passed in is an true object or a class which includes a virtual class.
And to make matters worse, because some of the objects take other objects
as arguments, I need to be able to tell if that object is an object of x
type (including an object created in a virtual class which creates the
same type of objects as the original class).
I would like to know of the best way of doing this with perl version 5.003
with out creating a hopeless mess. Any Ideas? I have a few ways in mind
but all of them will end up being a hopeless mess. Thanks in Advance for
any insight into this problem?
I need this for my Math::Fraction module which can be found on CPAN
Thanks Again,
Kevin A.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 21 Mar 1997 04:09:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to use modules in Perl5?
Message-Id: <5gt1lo$njd$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
breville@uoguelph.ca (Barry G Reville) writes:
:use lib '/var/local/httpd/cgi-bin';
:use CGI qw(:standard);
That's a silly -- and perhaps dangerous -- place to put a module.
: I would also like to use the 'use diagnostics' and 'use strict'
:commands as well as the 'use CGI::Carp qw(fatalsToBrowser);' that I've
:seen around and would be really handy but I can't seem to get them to
:work for me.
Those are standard, so should work. You have mis-installed something.
Did you type 'make install' for both perl and for the CGI modules?
If so, all is well.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Besides, it's good to force C programmers to use the toolbox occasionally. :-)
--Larry Wall in <1991May31.181659.28817@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: Fri, 21 Mar 1997 09:14:05 -0100
From: Harald Joerg <harald.joerg@mch.sni.de>
Subject: Re: how2 run perl on win 3.11 system??
Message-Id: <33325F6D.22E5@mch.sni.de>
[...with copies to Tom and Marc]
Tom Christiansen wrote:
> In comp.lang.perl.misc,
> rubinm@aztec.asu.edu writes:
> :I'd like to develop perl app on my windows 3.1/486 machine. Would be
> :most grateful for instructions on how to get started.
>
> Simple:
>
> Rule 1: upgrade to Linux
> Rule 2: install perl if it wasn't on your install kit
> Rule 3: type perl
>
> Some would point out that you could also install win95 or winNT
> at rule 1, but I prefer my version. It's cheaper and more useful. :-)
And, in addition, I keep pointing out that you _can_ run Perl 5.003
on Windows 3.11. The installation of Perl took me about half an hour
(including the download). Maybe I am wrong, but I think installing
Linux is not that easy.
Here is what I posted some days ago:
-----------------------------------------------------------------
Zac wrote:
> Is it possible to learn Perl on an old 486 running 3.11.
I hope so, since I'm currently trying to do that ;-)
I use Ilya Zacharevich's OS/2 port (Perl 5.003) and brought it to my
PC following a recipe which Dean Pentcheff posted here several times.
It allows me to test quite complex CGI scripts (including DB_File,
CGI, parts of libwww, etc) locally on my PC.
-----------------------------------------------------------------
...Let me add the following now:
This Perl port does not support Socket networking (or maybe I
am too stupid to get it running).
You should find out where to get PERL ports from in your
neighbourhood - otherwise you could find the location from
<URL:http://www.perl.com/CPAN/>.
>From CPAN there should be a link to 'Ports', from there to
either 'os2' or 'Ilyaz', who is named Ilya Zacharevich.
The ftp path you need to download the Win3.11 modules might
end in something like
....perl/cpan/ports/os2/ilyaz/5.00305/
--
Good luck,
--haj--
------------------------------
Date: Fri, 21 Mar 1997 02:21:47 -0500
From: James Kucharski <jimk@tricreations.com>
Subject: Re: Mailing files from a perl script
Message-Id: <3332370B.517A@tricreations.com>
Include the full path to "mail.file"...
-jim
Chris Plachta wrote:
>
> This one has been driving me crazy!
>
> I'm running Perl 5 on a linux box.I'm writing a script to
> email some text files to people.
>
> The way I've been approaching it is to create a mail.file
> that contains commands that the "mail" utility understands, and
> piping this file into the "mail" command within the perl
> script. The mail.file looks like this:
>
> ~rfile1
> ~rfile2
> ....
>
> Within the perl script, I'm trying to execute the mail system command:
>
> `mail -I person@addr.com < mail.file`;
>
> When I do this in the script, an empty mail file gets sent. If I
> do the same thing at the shell prompt, it works fine (file1 and file2
> are included in the mail message). How do I do this within the perl
> script????????????
>
> Thanks in advance.
------------------------------
Date: Fri, 21 Mar 1997 12:20:58 +0000
From: Jose4 Carlos Oliveira Pereira <jcp@misty.EUnet.pt>
Subject: Multi-dimension array creation
Message-Id: <33327D2A.6DC335D8@misty.EUnet.pt>
I'm having trouble creating multidimension arrays. What I
want is something like:
@allRecords( %record1,%record2,....) OR
%allRecords{ $key1,%record1,$key2,%record2,.... }
The actions I need are something like:
CREATION:
my $numrows= 10
for($index= 0;$index< $numrows; $index++){
$allRecords{"$index"} = &fetchhash;
}
DEREF:
foreach $number (sort keys(%allRecords)){
%next = $allRecords{$number};
foreach $column (sort keys(%next)){
print "columName : $column columnVal: $next{$column}\n";
}
I don't think that this is supported by perl. All the documentation I
have on multi-dimension array emulation isn't very clear.(I am using
perl5.003
but have only perl4 documentation :( )
I'd appreciate any help.
Thanks in advance.
--
Jose' Carlos Pereira.
------------------------------
Date: Fri, 21 Mar 1997 01:41:17 -0600
From: brian@brie.com (Brian Lavender)
Subject: Re: Open file works under DOS, not under server
Message-Id: <858883186.19220@dejanews.com>
You might try changing your current working directory. When the O'Reilly
Web server fires up that program it uses its home directory as the
working directory. I believe there is the chdir command. Since you are
working in DOS you might have to issue cd as a system command. In Unix
there is the pwd command, but off the top of my head I can't think of an
equivalent in DOS.
Brian
----------
Brian Lavender
Brie Web Publishing
http://www.brie.com
"The only thing constant in the world is change."
In article <5g6l75$n4e@fridge-nf0.shore.net>,
nvp@shore.net (Nathan V. Patwardhan) wrote:
>
> dsmith6@sct.edu wrote:
> : Why does the following code work fine under DOS, but doesn't appear
> : to work under the O'Reilly Web Server. From the server, the file
> : doesn't appear to read in any data. Other CGI's seem to work OK.
>
> : $file = "ratedata/comments.txt";
>
> Use the absolute path to the file. CGI doesn't know where it is.
>
> --
> Nathan V. Patwardhan
> nvp@shore.net
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 20 Mar 1997 13:41:17 -0800
From: Russ Allbery <rra@cs.stanford.edu>
To: Phil Sallee <phil@irvine.com>
Subject: Re: overloading operators?
Message-Id: <qum913imebm.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Phil Sallee <phil@irvine.com> writes:
> Does anyone know of a way to overload operators in Perl? Other object
> oriented languages such as C++ or Ada allow you to do this, but I
> haven't found a way to do this in Perl yet. How do you allow objects to
> be manipulated using standard operators?
An overload module is included in the latest beta release of Perl
(5.003_93 as I write this) and will be in 5.004. Looking at the
documentation, it seems fairly straightforward to use.
The package was also in 5.003, but I know extensive work has been done on
it since then, so it may not be fully functional in that version.
--
Russ Allbery (rra@cs.stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 21 Mar 1997 02:45:53 GMT
From: Steven R. Johnson <stevej@mistic.net>
Subject: Parsing a string
Message-Id: <5gssp1$gi3$1@news.wco.com>
I have a string that looks like this
<TR><TD>From: <a href=http://www.mistic.net>Steve Johnson</a></td><td>
<a href=mailto:stevej@mistic.net>stevej@mistic.net</a></td></tr>
except its one big line (no carriage returns my news reader wordwraped it to
look likt this)
I need to pull out JUST the name, the name and the address in the ahref
will always be different. What would be the easiest way to get rid of
EVERYTHING except the name? Can someone help me out on this one?
I guess basicly what I want to do is remove everything between all the <>
-Steve
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stevej@mistic.net http://www.mistic.net/stevej
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 21 Mar 1997 04:49:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Data Structures Cookbook. Wher did it go?
Message-Id: <5gt41c$p9r$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Jerome O'Neil <joneil@is.ssd.k12.wa.us> writes:
:I am having some problems finding Tom's Perl Data Structures Cookbook
:on-line. The FTP site says it isn't where it used to be, and I'm
:wondering if it is somewhere else?
type
man perldsc
or
http://www.perl.com/perl/nmanual/html/pod/perldsc.html
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Do we define evil as the absence of goodness? It seems only logical
that shit happens--we discover this by the process of elimination."
--Larry Wall
------------------------------
Date: 20 Mar 1997 16:49:42 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Problems with a trivial piece of code..
Message-Id: <5grpr6$hfd$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl, a dead newsgroup,
fazfar@romulus.rutgers.edu (Faisal Azfar) writes:
:According to the exercise, I only need to add one line and modify
My, that sounds remarkably like someone else to do your school homework
for you, which of course would be unethical. Surely you wouldn't
wish us do such a thing.
Instead of just doing your work for you, in the spirit of researching
your own problem in existing written texts, which is not only ethical
but also fully in line with a university spirit, I offer this clue:
your question is answered (perhaps somewhat indirectly) in the Perl FAQ.
You can retrieve it all in one swell fetch in the following formats:
FAQ broken up into little html pieces:
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq.html
FAQ in one giant html file:
http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.html
FAQ in one giant pod file:
http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.pod.gz
FAQ in one giant man page:
http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.man.gz
FAQ in one giant postscript page:
http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.ps.gz
FAQ in one giant plain text page:
http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.txt.gz
Why it's not quite really plain text:
http://www.perl.com/CPAN/doc/manual/text/README
You can also grab the full manual for the 5.004 release, now in beta release:
The Perl manual broken up into little html pieces:
http://www.perl.com/CPAN/doc/manual/html/index.html
All those little pieces tarred up:
http://www.perl.com/CPAN/doc/manual/html/PerlDoc-5.004beta-html.tar.gz
The Perl manual as one giant postscript file:
http://www.perl.com/CPAN/doc/manual/postscript/PerlDoc-5.004beta1.ps.gz
Table of contents for that postscript file:
http://www.perl.com/CPAN/doc/manual/postscript/PerlTOC-5.004beta1.ps.gz
The Perl manual as one giant text file:
http://www.perl.com/CPAN/doc/manual/text/PerlDoc-5.004beta1.txt.gz
Table of contents for that text file:
http://www.perl.com/CPAN/doc/manual/text/PerlTOC-5.004beta1.txt.gz
Why it's not quite really plain text:
http://www.perl.com/CPAN/doc/manual/text/README
--
Tom Christiansen tchrist@jhereg.perl.com
It's there as a sop to former Ada programmers. :-)
--Larry Wall regarding 10_000_000 in <11556@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 20 Mar 1997 13:19:15 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: kodis@jagunet.com
Subject: Re: Q: How to search _VERY_ long scalars for recurring patterns?
Message-Id: <8cg1xqnwos.fsf@gadget.cscaper.com>
>>>>> "John" == John Kodis <kodis@kodis.jagunet.com> writes:
John> I've solved that exact problem by simply running the single-line file
John> through the unix `fold' program which inserts newlines periodically to
John> transform it back into a more normally-formatted multi-line text file.
John> This simplifies subsequent processing enormously. You could also do
John> this in Perl itself by opening a fold pipeline for the process to read
John> from, thusly:
John> open LINE_ORIENTED, "fold -$line_length $one_line_filename |"
simpler:
while (read(STDIN,$_,8192) > 0) {
process $_;
}
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 529 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 20 Mar 1997 21:12:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Q: How to search _VERY_ long scalars for recurring patterns?
Message-Id: <5gs973$1n7$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Opera Ghost <agent.email@NetTown.com> writes:
:Xraargu J. Yrr jebgr:
:>
:> Uv,
:>
:> Ubj qb lbh cebprff na _rkgerzryl_ ybbbbbat fpnyne svyr
:> (v.r. n 3 zrt nfpvv grkg svyr jvgu ab arjyvarf) gung unf
:> n havdhr erpheevat ertrkc? (Vzntvar n irel ynetr
:> svkrq-yratgu nfpvv gnoyr... naq abj vzntvar gung
:> gung gnoyr unf nyy gur arjyvar punenpgref erzbirq...lhpx)
:>
:> Sbe fvzcyvpvgl, pbafvqre gur rknzcyr:
:>
:> SBB 12345 SH
:> ONE 67890 ZA
:> SBB 12345 PU
:> ...
:>
:> gung vf zlfgrevbhfyl punatrq gb:
:>
:> SBB 12345 SH ONE 67890 ZA SBB 12345 PU ... nq anfrhz
:>
:> ($jp -y jvyy erghea n inyhr bs mreb)
:> Vf gurer n zrgubq bs cnefvat guvf ybat fpnyne gb erghea
:> gur yratgu bs gur havdhr cnggrea /\j{3}\f\q{5}\f\j{2}/?
:> V'ir ybbxrq va gur cvax naq oyhr pnzryf, gur ovt ubj-gb,
:> nf jryy nf gur zna cntrf. (V'z ehaavat crey5 ba FhaBF
:> 4.1.3) Guvf vf qevivat zr ahgf!
:>
:> Gunaxf va nqinapr,
:>
:> --
:> Xra
:>
:> --
:
:fher gurer vf, hfr gur by vgrengbe va //t...
:
:juvyr (/\j{3}\f\q{5}\f\j{2}/t) {
: qb fbzrva jvgu $&;
:}
:
:gurer vf n irel fvzhvyne hfr ehaavat ng
:uggc://arggbja.pbz/fvgr_crey/qbp/rt/arjf.fgevat.ptv
:(unf yvax gb fbhepr)
:
:znc pna nyfb qb guvatf yvxr guvfn
:
:nfvqr...
:zl jbhyqa'g vg or avpr vs 1 qvq ABG unir gb fyhec va gur jubyr svyr, vr:
:$/ = /KKK/;
:
:!
:
:tbbq yhpx!
:--
:<v>Bcren Tubfg
:<znvygb:ntrag.rznvy@ArgGbja.pbz>
:[uggc://ArgGbja.pbz/fvgr_crey/]
:unir n tbbq qnl!
--
Tom Christiansen tchrist@jhereg.perl.com
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons
several minutes ago. We don't need no stinkin' tactical nukes.
(By the way, do you have change for 10 million people?) --lwall
------------------------------
Date: Thu, 20 Mar 1997 23:34:03 GMT
From: 104075.2120@compuserve.com (Garret Davis)
Subject: Run shared executables
Message-Id: <3331c770.25259348@news.compuserve.com>
What would be the best way to launch a shared executable via a web
browser and get the output back to the web browser?
Example:
Open the browser, be able to run the "last" command and have the
output come back to my browser.
TIA
Garret
------------------------------
Date: Fri, 21 Mar 1997 09:39:20 +0100
From: volker.doerrsam@mach.uni-karlsruhe.de
Subject: Running a DOS-command under perl for OS/2
Message-Id: <33324938.515C@mach.uni-karlsruhe.de>
Hello,
is there a way to tell perl running under OS/2 to start a DOS-Box and/or
a DOS-programm? I've already tried to run at least 'command.com' but it
doesn't work. :-(
any hint is appreciated
ciao
-Volker
------------------------------
Date: Thu, 20 Mar 1997 20:50:51 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Running Dos Programs from within Perl For NT
Message-Id: <E7D0Kr.KKA@cix.compulink.co.uk>
"Jonathan Tracey" <jont@uunet.pipex.com> asked:
> How can I execute a dos program from within a Perl script running under
> windows NT?
Try
system("the_prog.exe parameter1 parameter2");
John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked:
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, Perl for
NT/Win 95 can be found at http://www.activeware.com, with an excellent
FAQ file at
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html and no,
I don't have the slightest idea what's wrong with your CGI script. Try
http://www.perl.com/perl/faq/idiots-guide.html
------------------------------
Date: 21 Mar 1997 10:20:21 +0100
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: SIGPIPE in LWP::Socket::connect on Solaris 2.5.1
Message-Id: <hohcdzjmy.fsf@bergen.sn.no>
gerben@cs.vu.nl (Gerben Vos) writes:
> It doesn't always happen, but it does for example when fetching
> http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/jimz/www/the.html .
> It also happens when using other programs that use LWP, such as the HEAD
> program that comes with it.
This has been discussed on the libwww-perl mailing list, but I don't
think we came to any real conclusions. A $SIG{PIPE}='IGNORE'
statement somewhere in you program might help.
http://www.ics.uci.edu/pub/websoft/libwww-perl/archive/1997h1/0109.html
--
Gisle Aas <aas@sn.no>
------------------------------
Date: Thu, 20 Mar 1997 22:34:12 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Sort question
Message-Id: <E7D5D0.JMo@cix.compulink.co.uk>
milan@xilinx.com (Milan Saini) wrote:
> %list1=("1_2.9" => 1,"1_2.7" => 1,"1_2.11" => 1);
>
> foreach $keys (sort keys %list1)
...
> 1_2.11
> 1_2.7
> 1_2.9
> What I actually want is:
> 1_2.7
> 1_2.9
> 1_2.11
The default sort is alphabetical. To sort numerically, or in other ways,
you have to supply a comparison function. This is a subroutine, which can
be declared separately, or given in place. The latter is fine if the
comparison is simple: you want something quite similar to:
foreach $key (sort {$b <=> $a} keys(%list1))
{
...
}
To find the exact answer, look up sort in the manpage or the Camel book.
This will recover the karma you have lost by asking a question whose
answer is so trivially found in standard sources.
John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked:
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, Perl for
NT/Win 95 can be found at http://www.activeware.com, with an excellent
FAQ file at
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html and no,
I don't have the slightest idea what's wrong with your CGI script. Try
http://www.perl.com/perl/faq/idiots-guide.html
------------------------------
Date: Thu, 20 Mar 1997 12:09:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Pedro Vapi <vapi@student.dei.uc.pt>
Subject: Re: Suidperl!
Message-Id: <Pine.GSO.3.96.970320120326.12789J-100000@kelly.teleport.com>
[ Another try, because I realized my mistake just after sending my first
reply to this message. ]
On Wed, 19 Mar 1997, Pedro Vapi wrote:
> I am trying to implement a suid perl script on a system. It does allow
> suid scripts (i made a bourne shell suid and guid, and it worked).
Does your system have secure setid scripts? If not, the fact that that
worked is scary! (Or did you mean that you made the bourne shell _binary_
suid, instead of a bourne shell _script_?)
> It does have the suidperl wich is a link to sperl.5003 program (with
> permitions 4711). I have made a small program that just have the
> following lines:
>
> #!/usr/bin/perl
Are you certain that that is a binary which knows which suid perl to
execute? You may need to recompile it, if it's not.
> I have made this program chown root:bin at a Linux system.
Uh, oh. Linux does not have secure setid scripts. Something isn't right
here; either you're talking about two different systems, or something is
wrong with Linux, or something else. Let us know what you're really doing,
and we may be able to help. Good luck!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 21 Mar 1997 04:49:56 GMT
From: c.c.eiftj@33.usenet.us.com (Rahul Dhesi)
Subject: Re: term 'regular expressions' considered undesirable
Message-Id: <5gt41k$c5v@samba.rahul.net>
I got email from Jeffrey Friedl and I'm not sure if it was private email
or a copy of a posting. In any case, based on his comment's here's a
followup posting.
In <5gcv7d$jbj@samba.rahul.net> I wrote:
> /a.*b.*c/ # greedy, needs backtracking, slow, not regular expression
> /a.*?b.*?c/ # non-greedy, no backtracking, fast, regular expression
The above examples would have been better written as anchored:
/^a.*b.*c/ # greedy, needs backtracking, slow, not regular expression
/^a.*?b.*?c/ # non-greedy, no backtracking, fast, regular expression
Now the second one needs no backtracking:
find an 'a' or fail;
skip past all non-'b' characters;
find the 'b' or fail;
skip past all non-'c' characters;
find the 'c' or fail;
succeed
A non-anchored version simply repeats the search at every point in the
search string until it succeeds or, if it runs out of string, fails. So
the non-anchored non-greedy version will also need no backtracking.
I am assuming that one-character lookahead is not considered to be
backtracking. If one-character lookahead is backtracking, then here are
better examples:
/^a.*b.*c/ # greedy, needs backtracking, slow, not regular expression
/^a[^b]*b[^c]*c/ # non-greedy, no backtracking, fast, regular expression
The important point in all this is that some patterns are regular
expressions and others are not, and calling all of them regular
expressions is not a good idea. The term 'search pattern' or just
'pattern' is nicely generic and does not cause any confusion. Those
being introduced to search patterns for the first time will find no
useful meaning in the term 'regular expression' anyway, since it's not
an English term but a mathematical term. If we must use a mathematical
term, we should use it correctly.
--
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
** message body scan immune to fake headers *** see http://www.rahul.net/
>>> "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> <<<
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 153
*************************************