[8026] in Perl-Users-Digest
Perl-Users Digest, Issue: 1651 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 16 00:05:59 1998
Date: Thu, 15 Jan 98 21:00:21 -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 Thu, 15 Jan 1998 Volume: 8 Number: 1651
Today's topics:
Re: Can I create a Linked List in Perl (Ken)
Cost of a 3 day Perl training course (Bradley M. Kuhn)
counting entries in a file (root)
Re: Critique My Code! (Please) (Terry Michael Fletcher - PCD ~)
Re: EMTY FILE? (Charles DeRykus)
find.pm question (Lloyd Vancil)
Re: GDBM module <zenin@best.com>
Re: getting info out of multidimentional assoc. array? <rhodri@wildebst.demon.co.uk>
Give me reasons to use Perl for CGI <hso@voyager.atc.fhda.edu>
Re: Give me reasons to use Perl for CGI (brian d foy)
Re: IIS on NT and perl32 <corky@ultranet.com>
Re: Logical 'and' in regex? <joseph@5sigma.com>
Re: Logical 'and' in regex? <ebohlman@netcom.com>
Re: Parsing in Perl <rpsavage@ozemail.com.au>
Re: Pattern match of no character, any character, or sp <*@qz.to>
Re: reg exp question <ebohlman@netcom.com>
Re: reg exp question <bw@pindar.com>
Regular Expressions and the hyphen? (Paul Thomas)
Re: source into binary code (brian d foy)
Re: source into binary code (Jim Michael)
Re: source into binary code <dformosa@st.nepean.uws.edu.au>
Re: source into binary code <tchrist@mox.perl.com>
What's a good tutorial for perl <dyang@mork.uni.uiuc.edu>
Why does Perl5.0004 use a "Configure" script <eldridge@graphics.stanford.edu>
Re: Why does Perl5.0004 use a "Configure" script <rra@stanford.edu>
Re: WHY DOES THIS FAIL? (Gene Kaufman)
Win95: can I associate file type with perl script? <lyanddon@peapod.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 Jan 1998 19:04:05 -0500
From: ken@forum.swarthmore.edu (Ken)
Subject: Re: Can I create a Linked List in Perl
Message-Id: <ken-1501981904050001@news.swarthmore.edu>
In article <34be1839.3240236@news.idx.com>, draggs@hawkeye.idx.com wrote:
>In answer to the question of 'why?', the answer is that I have a
>flat-file database to write. In C, its a matter of storing each
>record into a linked list of structures.
>
>I'm still working on figuring out the detail of the PERL version of
>this. And additional suggestions or comments will be appreciated.
Here's one technique I often use: multidimensional arrays and hashes.
Let's say your file looks like this:
ID date name
___________________________________
0001:1998/01/15:Bob Peterson Bob Peter's son
0002:1998/01/14:Bob Peter's son
0003:1998/01/13:Bob, Peter's son
...
Then you can read the data into a hash, like this:
while ($line = <FILE>) {
chomp $line;
($id, $date, $name) = split (/:/, $line);
$records{$id}{'date'} = $date;
$records{$id}{'name'} = $name;
}
Notice that this only works if there are no two records with the same ID
number. Also, by using a hash instead of a linked list you can have
"instant" lookups of any of your data:
print ("date for #0003: $records{'0003'}{'date'}\n");
Does this fit the bill? I've found Perl's data structures to be better
than C's, mainly because it's really easy to create all kinds of big nasty
ugly things - you don't have to declare things in structs.
-Ken Williams
The Math Forum
ken@forum.swarthmore.edu
------------------------------
Date: 15 Jan 1998 22:34:05 -0500
From: bmk@agnostic.ebb.org (Bradley M. Kuhn)
Subject: Cost of a 3 day Perl training course
Message-Id: <69mkfd$4rg$1@agnostic.ebb.org>
What is the reasonable cost (per day) if a company wants to bring in a Perl
trainer (to teach the language basics) to a group of 20-30 people for 3 days
or so?
I realize that it depends on the experience of the trainer. Obviously,
getting tchrist@mox.perl.com or merlyn@Stonehenge.com is not so cheap, but
what would someone with good Perl skills and reasonable training skills (as
opposed both excellent training and Perl skills) cost per day?
--
* Bradley M. Kuhn *
* The address in the From: line above will send an autoreply with my *
* real email address. Or, check out my WWW site at: *
* http-colon-slash-slash-www-dot-ebb-dot-org-slash-bkuhn *
------------------------------
Date: 16 Jan 1998 04:28:46 GMT
From: root@lizard-breath.tiac.net (root)
Subject: counting entries in a file
Message-Id: <69mnlu$mrs@news-central.tiac.net>
Keywords: perl, web, stats
I'm writing a custom web analysis tool in perl to count up the total number of
searches on my site -- that's the easy part. The part I'm having some
difficulty with is I want to list the top 10 entries for the file. The
file looks something like this:
search term1
search term2
search term3
search term1
search term1
search term2
.
.
.
search term16000
The file has over 16,000 search terms. Any suggestions as to how to
tally up the entries in the file?
I'm trying to obtain the following results:
search term1 -120
search term2 - 2
search term3 - 1
search term4 - 454
.
.
.
search term16000 - 3
scott
------------------------------
Date: 15 Jan 1998 23:00:25 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: Critique My Code! (Please)
Message-Id: <69m4e9$jp2$1@news.fm.intel.com>
dg50@chrysler.com so eloquently and verbosely pontificated:
> Here's a little (heh - it got a little bloated) utility I wrote to strip
> those annoying ^M characters from the ends of files imported from MS/DOG
> or WinDoze.
>
> Sure, it's overkill, but I'm releasing it into the public domain, and
> want it to be robust. ;)
>
> What I'd like though, is some constructive de-construction of my code.
> Have a look, and tell me where I can make speed improvements, take
> shortcuts, etc to make it smaller/faster/better.
>
> Thanks,
>
> DG
>
> (watch out for linewrap in the following)
>
> ----------8<----------Clip'n'Save----------8<----------Clip'n'Save--------------
you're right, its overkill :)
i dont know if its your line wrapping totally, but your style could use some
polishing (see 'perlstyle' for that).
as long as you are printing to STDERR, and using newlines at the end of your
strings, you might as well look up what "warn" does (see 'perlfunc' for
that).
you dont need to escape single quotes inside double quoted strings (see
'perlop' under Quote and Quote-like)
lastly, this script can be a one-liner, so i hope you inform your public that
perl doesnt need 50 lines to do this task. :)
--
#!/usr/local/bin/perl -w- tfletche@pcocd2.intel.com
sleep 1;$"=(time-$^T)<<1;$SIG{ALRM}=sub{print};${q$_$}=join"",
map{chr(hex)}split/(..)/,"4a75737420";alarm$";<>;s y(\0\w){4}.
?yreverse q brehtonabyex;alarm$";<>;for(;length>4;chop){}tr&to
an&empti&;alarm$";<>;s@$_@reverse',ret'.q csaw c@e;alarm$";<>;
------------------------------
Date: Fri, 16 Jan 1998 00:14:55 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: EMTY FILE?
Message-Id: <EMuoow.Cq8@bcstec.ca.boeing.com>
In article <EMuA37.FHq@bcstec.ca.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
> In article <34BE1434.F478E6F0@xarch.tu-graz.ac.at>,
>Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> wrote:
> > How can i test a file weather its empty or not (but not with the testing
> > of the file size)
>
>
> perl -ne 'END {print "empty\n" unless $.}' file
>
>
This would be even faster:
perl -ne 'exit; END { print "empty\n" unless $.}' file
--
Charles DeRykus
------------------------------
Date: Fri, 16 Jan 1998 03:46:48 GMT
From: lev@dartm.com (Lloyd Vancil)
Subject: find.pm question
Message-Id: <34bed56a.2314634@news.pacbell.net>
Using
use File::Find;
fiddepth(\&wanted, $ARGV[0]);
sub wanted {
print $File::File::dir $File::File::$_\n";
}
What I get is nothing for $File::File::dir and
directories and filenames for $File::File::$_
I don't understand...
L.
- lev@dartm.com - lev@apple.com
http://www.dartm.com/resume.html
AA6NX
------------------------------
Date: 16 Jan 1998 03:58:42 GMT
From: Zenin <zenin@best.com>
Subject: Re: GDBM module
Message-Id: <884923363.559567@thrush.omix.com>
Lou Avrami <L.Avrami@dialogic.com> wrote:
>snip<
: Do I now need to reinstall/recompile perl itself, in order to
: include the module?
Nope, just the GDBM Module. You will however, need the perl
source again to do it. Unpack the perl source, go into the
ext/GDBM_File directory within it, and run:
perl Makefile.PL
make
make test
make install
You may also be able to find the package by itself at CPAN, and
if so it would be under CPAN/modules/by-module/GDBM_File, but I
think I remember not finding it there by itself for some reason.
--
-Zenin
zenin@best.com
------------------------------
Date: Fri, 16 Jan 1998 00:02:49 +0000 (GMT)
From: Rhodri James <rhodri@wildebst.demon.co.uk>
Subject: Re: getting info out of multidimentional assoc. array?
Message-Id: <4809115828rhodri@wildebst.demon.co.uk>
In article <69lavt$4cp$1@xena.acsu.buffalo.edu>,
Andrew S Gianni <agianni@xena.acsu.buffalo.edu> wrote:
> I'm trying to go through a miltidimentional associative array and get
> information out of it. I'm trying to do something like useing nested
> foreach statements, but as soon as a pull the first variable out of the
> array like:
> foreach $name (%service_array){...}
> it simply pulls each ordered pair out and I don't know how to access the
> data except by brute force.
Assuming that you mean that you want to go through each of the keys of
hash, try:
foreach $name (keys %service_array) {...}
--
Rhodri James *-* Wildebeeste herder to the masses
If you don't know who I work for, you can't misattribute my words to them
... Error: routine Lunchtime is purely virtual
------------------------------
Date: Thu, 15 Jan 1998 18:18:15 -0800
From: Hann SO <hso@voyager.atc.fhda.edu>
Subject: Give me reasons to use Perl for CGI
Message-Id: <34BEC365.B734D7F8@voyager.atc.fhda.edu>
Hi everybody:
I'm teaching CGI at a community College. Would you please give me
reasons why I should use Perl and not C, C++ or TCL?
Thanks,
Hann
------------------------------
Date: Thu, 15 Jan 1998 22:51:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Give me reasons to use Perl for CGI
Message-Id: <comdog-ya02408000R1501982251080001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34BEC365.B734D7F8@voyager.atc.fhda.edu>, Hann SO <hso@voyager.atc.fhda.edu> posted:
>I'm teaching CGI at a community College. Would you please give me
>reasons why I should use Perl and not C, C++ or TCL?
use whatever language your students are comfortable with. CGI
doesn't depend on any particular language.
however, if you are interested in Perl advocacy, perhaps you'll
want to read the opinions at
<URL:http://language.perl.com/versus/index.html>
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 15 Jan 1998 20:38:17 -0500
From: Bob Trieger <corky@ultranet.com>
To: Steve Linberg <slinberg-bitme@crocker.com>
Subject: Re: IIS on NT and perl32
Message-Id: <34BEBA09.7A55@ultranet.com>
Steve Linberg wrote:
> Um, maybe this is dumb of me, but did you include:
>
> print "Content-type: text/html\n\n";
>
> so you can see your output over the web?
In a word, yes.
I only included the code that wasn't working.
------------------------------
Date: Thu, 15 Jan 1998 20:32:43 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Logical 'and' in regex?
Message-Id: <34BED495.4F29AA99@5sigma.com>
Abigail wrote:
>
> Joseph N. Hall (joseph@5sigma.com) wrote on 1598 September 1993 in
> <URL: news:34BE62B1.C2A8B027@5sigma.com>:
> ++ Frank wrote:
> ++ >
> ++ > The following expression is essentially a logical "or":
> ++ >
> ++ > $breakfast =~ /bacon|eggs|hashbrowns|juice/;
> ++ >
> ++ > however, suppose I want ALL of the above for breakfast? Is there a
> ++ > similar construct that AND's all of the items?
> ++ >
> ++ > Of course, one could evaluate every item, but that's a rather clumsy
> ++ > way to do it.
> ++
> ++ You think so? When the "alternative" is $breakfast =~
> ++ /(?=.*?bacon)(?=.*?eggs)(?=.*?hashbrowns)(?=.*?juice)/?
>
> This may, or may not be correct, depending if you allow overlapping
> matches. Suppose you want to match juice and cereal. Then
Yeah, yeah, yeah. The point was /a/ or /b/ or /c/ ....
-joseph
------------------------------
Date: Fri, 16 Jan 1998 03:40:56 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Logical 'and' in regex?
Message-Id: <ebohlmanEMuy88.y7@netcom.com>
Frank <FHeasley@chemistry.com> wrote:
: The following expression is essentially a logical "or":
: $breakfast =~ /bacon|eggs|hashbrowns|juice/;
: however, suppose I want ALL of the above for breakfast? Is there a
: similar construct that AND's all of the items?
: Of course, one could evaluate every item, but that's a rather clumsy
: way to do it.
There's no way around it. The very definition of AND is that every item has
to be present.
If you only need to match literal strings rather than patterns, doing
multiple tests with index() would be faster than doing multiple regex
matches:
$matched=1;
foreach (qw(bacon eggs hashbrowns juice)) {
if (index($breakfast,$_)<0) {
$matched=0;
last;
}
}
------------------------------
Date: Fri, 16 Jan 1998 09:55:51 +1000
From: Ron Savage <rpsavage@ozemail.com.au>
Subject: Re: Parsing in Perl
Message-Id: <34BEA207.610F@ozemail.com.au>
Mike Stok wrote:
>
> In article <69jgrl$3um$1@marina.cinenet.net>,
> Craig Berry <cberry@cinenet.net> wrote:
> >I'm working on a script which will parse out a source file with mildly
> >complex syntax and generate some binary data based on what it
> >finds...it's rather similar to a programming language compiler, though
> >that's not actually what it is. :)[snip]
Alternatives:
1. The Mother Of All State Machines (formal name: Discrete Finite Automaton, I believe) - Libero. Search the
net for it, or email me & I'll look up my records
2. A simple state machine generator (yes) and executor. Simple because I wrote it. Email for details
--
Cheers,
Ron Savage
Office: savage.ron.rs@bhp.com.au
Home (preferred): rpsavage@ozemail.com.au
------------------------------
Date: 16 Jan 1998 00:52:21 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Pattern match of no character, any character, or space (word boundary)
Message-Id: <qz$9801151942@qz.little-neck.ny.us>
Keywords: from just another new york perl hacker
Posted and mailed.
Subject: Pattern match of no character, any character, or space (word boundary)
. = any character, " " = space, \s = any single whitespace, \b = word boundary
See perlre.
In article <884895682.461111315@dejanews.com>, <cotal@delphi.com> wrote:
> I need a SIMPLE way to match all 3 of the following;
>
> as/400 as 400 as400
m:as[/ ]?400:
> as*400 matches as400 and as/400
No it doesn't.
> as.400 matches as 400 and as/400
And many more like "ask400".
> Is there a special character that will match all without having
> to use a boolean?
You want a [] character class and the ? zero-or-one of operator.
Elijah
------
perl -e 's Y Yreverse q N ny pm srekcah lrep kroy wen emosNYex and s Pmp ynP
P and s MsMjust sMx and print and s NYPM MPYN Nis or reverse and print q qq'
------------------------------
Date: Fri, 16 Jan 1998 03:11:27 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: reg exp question
Message-Id: <ebohlmanEMuwv3.Lr5@netcom.com>
Chipmunk <rjk@coos.dartmouth.edu> wrote:
: Ian Goldstein wrote:
: > I want to extract all instances of duplicate consecutive
: > characters from a string. I came up with a simple algorithm,
: > but was wondering if there was a "shorter" method.
[snip]
: > while ( /([a-z])\1/ ) {
: > print "dupe $1\n";
: > $_ = $';
: > }
: $' should be avoided. It slows down the entire script because
: it forces all regexes to make copies of the target strings.
: while (/([a-z])\1/g) {
: print "dupe $1\n";
: }
: This takes advantage of the magic of /g in a scalar context.
Better still:
while (/([a-z])(?=\1)/g) {
which will count runs of length greater than two.
------------------------------
Date: Thu, 15 Jan 1998 14:50:20 -0000
From: "Bob Wilkinson" <bw@pindar.com>
Subject: Re: reg exp question
Message-Id: <34be218d.0@nnrp1.news.uk.psi.net>
Ian Goldstein wrote in message <34BD338A.B1A09D42@ny.ubs.com>...
>I want to extract all instances of duplicate consecutive
>characters from a string. I came up with a simple algorithm,
>but was wondering if there was a "shorter" method.
>
>Any pointers would be appreciated. Here is the script:
>
>#!/usr/local/bin/perl5
>
>$string = $ARGV[0];
$string =~ tr/a-z//s;
will do the same as the code below.
>$_= $string;
>
>while ( /([a-z])\1/ ) {
> print "dupe $1\n";
> $_ = $';
>}
>Ian
Bob
------------------------------
Date: 16 Jan 1998 02:00:11 GMT
From: paul@cue.com (Paul Thomas)
Subject: Regular Expressions and the hyphen?
Message-Id: <69mevb$vaq@freya.yggdrasil.com>
Hello,
I am trying to search for directory names within a directory using and am
trying to get the following to work so I can adapt it to my program:
$lstname = "tEst2";
opendir(ETC,"/mnt/home/lists/") || die "no etc?";
foreach $name (sort readdir(ETC)) {
if ($name =~ /$lstname\b/i ) {print "$name\n"}; #print "$name\n"; }
}
closedir (ETC);
With this I just want to print $name, however some of the directories
are named 'somedir' and 'somedir-digest'. So in my above routine,
'somedir' and 'somedir-digest' are always printed even though all I
want is 'somedir'. It seems that /$lstname\b/i does not condider a
hyphen following $lstname a word boundry and goes ahead and matches
anything resembline $lstname that is hyhenated like $lstname-digest.
I want to set a word boundry so /$lstname\b/i on matches $lstname and
not $lstname-digest.
Any suggestions or explanations appreciated. Please copy any response
to my email as my newsfeed is flaky.
Thanks in advance!
--Paul T.
--
Calvin and Hobbes (Bill Watterson): "The surest sign that intelligent
life exists elsewhere in the universe is that it has never tried to contact
us."
------------------------------
Date: Thu, 15 Jan 1998 19:50:55 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: source into binary code
Message-Id: <comdog-ya02408000R1501981950550001@news.panix.com>
Keywords: from just another new york perl hacker
In article <ken-1501981848490001@news.swarthmore.edu>, ken@forum.swarthmore.edu (Ken) posted:
>Dan Boorstein <dboorstein@ixl.com> posted:
>>*heh* forget about the dictionary. your enemy is a hacker - a person
>>with seemingly unlimited curiousity, unending devotion to the task
>>at hand, and a master of technical trivia.
um, i said that.
>How in the world would you know that the enemy is a hacker?? Perhaps the
>original poster was a high school teacher teaching a class on programming,
>and he wanted to make some simple "black box" scripts to give to his
>students. You know, "Run this program a bunch of times and figure out
>what it does. Then write a program in Perl that does the same thing."
sounds like hacking to me.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 16 Jan 1998 01:13:03 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: source into binary code
Message-Id: <genepoolEMurDs.F1o@netcom.com>
Ken (ken@forum.swarthmore.edu) wrote:
: The thing that gets me depressed is that everyone's assuming they know
: what this guy needs, and not listening to what he said in the first
: place. For example:
...
: The point is, just as there are different levels of security, there are
: different levels of _need_ for security. Not everybody's making the
: controls for atomic bombs. The guy said what his needs were - I
: understand that people were trying to help him by saying that compiling
: isn't very good security, but if he doesn't need very good security then
: what's the problem?
Case in point: You write a program (in Perl, of course) which you would
like to distribute over the net which you would like to expire after x
days if there is no registration key. Your goal is to maximize the number
of registrations, not to make the registration process totally
hacker-proof. How can you best obfuscate the code to prevent the typical
GUI interface OS user from stealing your code and make it moderately
difficult (the payoff isn't quite worth the time involved for use of the
program) for a semi-skilled hacker?
Cheers,
Jim
------------------------------
Date: 16 Jan 1998 01:14:52 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: source into binary code
Message-Id: <884913268.501107@cabal>
In <34BE2AFA.E94BF263@ixl.com> Dan Boorstein <dboorstein@ixl.com> writes:
>Tom Christiansen wrote:
>> Compiling produces no security.
>Tom Christiansen wrote:
>> Security through obscurity is a terribly dangerous miscarriage of
>> truth.
[...]
>security - "measures taken to guard against espionage or sabotage,
>crime, attack, or escape"
>obscure - "not readily understood or clearly expressed"
>i'm not submitting that compiling is good security, only that it is
>security. [...] do you agree or disagree with tom c's original statement?
Obscure implies that with work that you could uncerstand the work with
effort. Obscure things can be turned up with resurch and or effort.
[...]
> isn't key based cryptography security through obscurity?
The effort in decoding a key based document [1] requires a great amount of
time. This is not obscure, this is opaic.
[...]
>i believe perl's own crypt is just obscuring, though irreversibly.
If its obsured irreversibly, its not obsure.
[1] Given that it is a good system and not ROT13
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Support NoCeM http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: 16 Jan 1998 02:32:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: source into binary code
Message-Id: <69mgrp$fqk$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, genepool@netcom.com (Jim Michael) writes:
:Case in point: You write a program (in Perl, of course) which you would
:like to distribute over the net which you would like to expire after x
:days if there is no registration key. Your goal is to maximize the number
:of registrations, not to make the registration process totally
:hacker-proof. How can you best obfuscate the code ...
<qumohhwo6gz.thoron@cyclone.stanford.edu>] contained:
And just as you're under no obligation to publish your source code
to please me, I'm under no obligation to help you hide it. --Russ
<fl_aggie-1501981551510001@aggie.coaps.fsu.edu contained:
The rich culture in the Perl community exists because everything is
in the open. Perl is more than _just_ a programming language, and
far more than the sum of its parts. Hiding code just goes against
that culture. --James
<news:53mal3$4b5$1@csnews.cs.colorado.edu> contained:
The Internet Revolution was founded on open systems: an open system is one
whose software you can look at, a box you can unwrap and play with. It's
not about secret binaries or crippleware or brother-can-you-spare-a-dime
shareware. If everyone always had hidden software, you wouldn't have
1/100th the useful software you have right now. And you wouldn't
have Perl.
Furthermore, you wouldn't have the Internet.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
X-Windows: Never had it, never will.
--Jamie Zawinski
------------------------------
Date: 16 Jan 1998 03:58:56 GMT
From: "Steve Michaels" <dyang@mork.uni.uiuc.edu>
Subject: What's a good tutorial for perl
Message-Id: <01bd2231$ed6b0e40$271a7e82@dilbert>
I have basic programming experience (C, C++, pascal, assembly) and I was
wondering where I could get a good perl tutorial (on the web or in book
format) that is concise but has all the information.
steve
------------------------------
Date: Thu, 15 Jan 1998 15:43:58 -0800
From: Matthew Eldridge <eldridge@graphics.stanford.edu>
Subject: Why does Perl5.0004 use a "Configure" script
Message-Id: <34BE9F3E.41C6@graphics.stanford.edu>
Hi-
I've come to know and love the gnu autoconf stuff. Nothing finer
than typing "./configure" and having it race through, figuring
out everything under the sun.
Without starting a religious war, or stepping on too many toes,
why does Perl5 use "Configure" which spends a huge amount of
time answering questions it could trivially answer itself?
I mean the wheel needn't be reinvented, just use autoconf,
right?
-Matthew
------------------------------
Date: 15 Jan 1998 16:16:04 -0800
From: Russ Allbery <rra@stanford.edu>
To: Matthew Eldridge <eldridge@graphics.stanford.edu>
Subject: Re: Why does Perl5.0004 use a "Configure" script
Message-Id: <m31zy9uvcr.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
Matthew Eldridge <eldridge@graphics.stanford.edu> writes:
> Without starting a religious war, or stepping on too many toes, why does
> Perl5 use "Configure" which spends a huge amount of time answering
> questions it could trivially answer itself? I mean the wheel needn't be
> reinvented, just use autoconf, right?
Perl isn't reinventing the wheel -- it's using metaconfig. I believe that
actually predates autoconf as a package, and it's also used for trn.
There are a lot of complicated and semi-religious differences between the
autoconf advocates and the metaconfig advocates; autoconf is more
automated, but metaconfig lets you fix things if you know they need to be
fixed.
At this point, Perl is fairly well integrated with its configure script,
which checks for a lot of things that autoconf doesn't know how to check
for and which has configurations for a variety of platforms that would
have to be redone for configure.
I think the real answer to your question is that you're looking for:
./Configure -ds
which looks much more like autoconf. :)
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 15 Jan 1998 15:46:08 -0500
From: kaufmanNOSPAM@redrose.net (Gene Kaufman)
Subject: Re: WHY DOES THIS FAIL?
Message-Id: <MPG.f283f9f9719c6ac989684@news.redrose.net>
In article <34BA3AC6.6907@isc.mds.lmco.com>, sjenifer@isc.mds.lmco.com
says...
> $x = "yes";
> ($x eq "yes") ? $y = "YES\n" : $y = "NO\n";
> print $y;
>
>
>
try putting parens around the TRUE/FALSE parts:
$x = "yes";
($x eq "yes") ? ($y = "YES\n") : ($y = "NO\n");
print $y;
this works correctly.
===================================================
Gene Kaufman
kaufmanNOSPAM@alpha.fiorill.com
Terrik Software: http://alpha.fiorill.com/~kaufman
------------------------------
Date: 16 Jan 1998 00:38:51 GMT
From: "Don Silvia" <lyanddon@peapod.com>
Subject: Win95: can I associate file type with perl script?
Message-Id: <01bd2217$75e3d6a0$0100a8c0@djsilvia.ma.ultranet.com>
Hi,
I have a perl script that reads a text file, strips out some garbage and
sends the good stuff to another text file. I create the output file with
the same root filename as the input file, but a different extension. To do
this I search and replace on the filename string:
s/prt/edt/ or die("Substitution failed");
I run the perl script from a batch file (prtconv.bat) so I can just type
the command and pass the input file name:
perl -w d:\perl\scripts\prtconv.pl %1
This works fine when run from the command line in a DOS box, but when I try
to associate the batch file with the file extension via explorer, the
s/prt/edt/ won't work. I would appreciate it if anyone could tell me why
the search and replace fails, as well as if there's a better way to
associate a perl script with a file extension. Us windows kids fear the
command line.
Thanks,
Don Silvia
------------------------------
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 1651
**************************************