[8253] in Perl-Users-Digest
Perl-Users Digest, Issue: 1870 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 12 01:08:11 1998
Date: Wed, 11 Feb 98 22: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 Wed, 11 Feb 1998 Volume: 8 Number: 1870
Today's topics:
Re: C structures mapping into PERL <dfetter@shell4.ba.best.com>
clueless in Columbus <gwallace@ee.net>
Re: Code Example Needed <rjk@coos.dartmouth.edu>
Re: Code Example Needed (Frank)
Re: Counter problem - resets (Mark Kramer)
Credit Card Check posting@antigo.com
Re: defined() bug? (or feature? :) <zenin@best.com>
Extra text from die on Perl-VMS (David Stashower)
Re: FAQless Forays (was: Code Example Needed) <rjk@coos.dartmouth.edu>
Re: FAQless Forays (was: Code Example Needed) <rjk@coos.dartmouth.edu>
Re: FAQless Forays (was: Code Example Needed) <tchrist@mox.perl.com>
Re: Forgery => Killfile (Martin Oakley)
Re: getting rid of duplicate lines in a file <rjk@coos.dartmouth.edu>
help! Perl Compiler <hostmaster@DrZone.COM>
Re: How to get disk's volume label under Win95? (Allen Evenson)
Re: HUMOR: Userspeak vs Hackerspeak <dgoddard@us.oracle.com>
Re: Installing Linux and Perl? <ted@taki.net>
Re: PUZZLE: Answer me these questions three <tom@moertel.com>
Re: PUZZLE: Answer me these questions three <tchrist@mox.perl.com>
Re: RFC about ``Matt's Script Archive'' (Jeff Yoak)
Re: Search files seq. help <rra@stanford.edu>
Re: Seriously Off Topic, but a Common Complaint/Problem <dgoddard@us.oracle.com>
Re: strange key behaviour and the Blue Camel <rra@stanford.edu>
Re: Substitution : \n with space <rra@stanford.edu>
Re: Tom wins flamer of the year award! (Iain Chalmers)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Feb 1998 03:32:31 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: C structures mapping into PERL
Message-Id: <6btqgf$dc6$1@nntp1.ba.best.com>
Waldek Grudzie? <waldekg@uhc.lublin.pl> wrote:
> Does anyone know where I can find examples of C structures mapping into
> PERL structure (to use in C functions wrote in XSUB)
> I would like to map e.g. structure :
> struct test {
> char id[20];
> char name[50];
> struct test *next;
> }
> to list of hash tables :
> %test = ( 'id' => '...',
> 'name' => '...')
My first guess is perl's pack/unpack functionality, with the proviso
that more than one pointer in the struct or struct inside the struct
may leave some ambiguity for pack to chew on. Maybe you'd want to
look up XS for more complicated stuctures.
HTH,
Dave.
--
David Fetter 888 O'Farrell Street Apt E1205
shackle@ren.glaci.com San Francisco, CA 94109-7089 USA
http://www.best.com/~dfetter +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)
"I am not one of those weak-spirited, sappy Americans who want
to be liked by all the people around them. I don't care if people
hate my guts; I assume most of them do. The important question
is: 'What are they in a position to do about it?'"
William S. Burroughs
------------------------------
Date: Wed, 11 Feb 1998 22:01:05 -0500
From: Greg Wallace <gwallace@ee.net>
Subject: clueless in Columbus
Message-Id: <34E265F1.DC4E3FE9@ee.net>
I need to run a perl program which operates on globbed files in a
certain directory. I'd like to launch the program from SQL Server 6.5
on Windows NT 4. My perl program works well when it is launched in the
same directory as the files it will read. But SQL Server's xp_cmdshell
(which shells me out to perl) wishes to run the perl script on from
/winnt/system32. And for some reason my glob doesn't work with a path
in front of it. Nor can I chdir. Nor can I Win32::SetCwd (which may
not be the right idea anyway).
The problem is obvious. I don't have rights, right? But I'm an
administrator logged into the database as 'sa' and I've given the SQL
Executive administrator rights for the moment. Clearly I'm missing the
point somewhere. Advice will be greatly appreciated.
------------------------------
Date: Thu, 12 Feb 1998 00:04:42 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Eileen Kortright <mystra@torilmud.com>
Subject: Re: Code Example Needed
Message-Id: <34E282EC.D8A3A445@coos.dartmouth.edu>
[posted and mailed]
Eileen Kortright wrote:
>
> %fr_months =
> ( 1..30,"Hammer",
> 31,"Midwinter",
> 32..61,"Alturiak",
> 62..91,"Ches",
> 92..121,"Tarsakh",
> 122,"Greengrass",
> 123..152,"Mirtul",
> 153..182,"Kythorn",
> 183..212,"Flamerule",
> 213,"Midsummer",
> 214..243,"Eleasias",
> 244..273,"Eleint",
> 274,"Higharvesttide",
> 275..304,"Marpenoth",
> 305..334,"Uktar",
> 335,"Moonfest",
> 336..365,"Nightal",
> 366,"Shieldmeet"
> );
If you're going to use the integers from 1 to 366 as keys, it seems rather
silly to use a hash.
@fr_months = (
'',
('Hammer') x 30,
'Midwinter',
('Alturiak') x 30,
('Ches') x 30,
('Tarsakh') x 30,
'Greengrass',
...
);
For getting the first day of the month, though, it would be worthwhile to
use a hash.
%fr_month_starts = (
Hammer => 1,
Midwinter => 31,
Alturiak => 32,
Ches => 62,
...
);
Then, starting with the Julian day in $jday:
$month = $fr_months[$jday];
$mday = $jday - $fr_month_starts{$month} + 1;
print "Today is the $mday of $month\n";
For the one-day 'months' you could even do this:
%fr_month_starts = (
Hammer => 1,
Midwinter => 0,
Alturiak => 32,
...
);
$month = $fr_months[$jday];
if ($fr_month_starts($month)) {
$mday = $jday - $fr_month_starts{$month} + 1;
print "Today is the $mday of $month.\n";
} else {
print "Today is $month.\n";
}
Chipmunk
------------------------------
Date: Thu, 12 Feb 1998 05:41:05 GMT
From: FHeasley@chemistry.com (Frank)
Subject: Re: Code Example Needed
Message-Id: <34e28b43.54396700@news.halcyon.com>
Hi Eileen,
Just read your posting on perl.
Are you any relationship of Kenneth H. Kortright, recently living in
S. Florida?
Frank Heasley
------------------------------
Date: Thu, 12 Feb 1998 05:38:08 GMT
From: c28f62@world.std.com (Mark Kramer)
Subject: Re: Counter problem - resets
Message-Id: <Eo93nM.JGM@world.std.com>
Tom, perhaps it is time to turn the computer off for a while and go skiing
or something recreational.
In article <6brain$3rd$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>Relying upon that ineffably perverse monstrosity of newsreader-wannabe,
>Mozilla 3.01 (Win16; I), doug@idi-ut.com in comp.lang.perl.misc writes:
I examined the article you replied to carefully. It was properly
formatted, and although it had a MIME header it contained no MIME
encoded material. The signature was a little long, but the signature
is not the fault of the newsreader, it depends on the author.
If someone wants to use what you consider to be a poor tool, and is
does not impact upin you in any way (as it does not, here) that should
be their right. Unless you grant others the same right to whine about
YOUR choice of newsreader ...
And this is how he feels about the good guys. Remember, "Mozilla" is
going to be releasing their code to the public. "Free software".
>:$galcnt=0;
>:open (GALCNTRIN, "cgi-bin/galcntr");
>
>Did you check the return value from that system call?
>
>:flock (GALCNTRIN, 2);
>
>Did you check the return value from that system call?
The point was made, Tom.
>
>:$galcnt = <GALCNTRIN>;
>:close GALCNTRIN;
>
>Did you check the return value from that system call?
The point was made, Tom.
>
>:flock (GALCNTRIN, 8);
>
>Did you check the return value from that system call?
The point was made, Tom.
>
>Why are you unlocking an invalid (closed) file handle?
Because he doesn't understand flock, perhaps, and is asking for help?
>:$galcnt++;
>
>*THE HORROR*
>
>:open (GALCNTROUT, ">cgi-bin/galcntr");
>
>Did you check the return value from that system call?
The point was made, Tom. Or are you saying that you don't understand perl
well enough to read the code and see that he didn't?
>
>:flock (GALCNTOUT, 2);
>
>Did you check the return value from that system call?
Sigh.
>
>:print GALCNTROUT $galcnt;
>
>Did you check the return value from that system call?
Even I can read the code and can tell he didn't.
>I don't imagine you thought to flush.
Did you read the documentation that comes with every perl distribution
that says that a close does a flush? The next statement is a close.
>I suppose mentioning O_SYNC at this point would just confuse.
>
>:close GALCNTROUT;
>
>Did you check the return value from that system call?
Doesn't look like he did, does it?
>:flock (GALCNTROUT, 8);
>
>Did you check the return value from that system call?
>
>Why are you unlocking an invalid (closed) file handle?
>
>Here's my question: why are you incrementing your variable when you don't
>have the file locked? Didn't anyone ever teach you about semaphores and
>locking, critical sections, and transactional integrity? You'd better
>retake that operating systems design course you seem to have forgotten,
>as well as the one on hand-coded database design.
If Tom assumes that this person has had an operating systems design course,
then the implication is that Tom thinks that the only people who should be
using perl are university trained professional computer scientists.
>CGI isn't easy.
Oops. Tom confuses CGI with perl flocking. Tom usually points out this
confusion to others.
>I'm afraid that contrary to popular belief,
>programming is serious stuff. Whoever told you it was has done you a
>cruel disservice. Programming just isn't at *all* trivial. You can't
>learn it in 7 days, or 21, or whatever. It's a real profession, with
>theoretical issues that you can't just skip over. And data integrity
>in a multiprocessing system is no simple task.
Oops. There goes the idea of "free software" with code available to
anyone who wants to tinker with it. Programming is serious business,
better left to the professional computer scientists who are trained to
do it.
>I'm sorry is this is really too harsh a diatribe for your simple problem.
No, you aren't.
>And remember: there is a newsgroup for CGI programming -- and it's
>not this one.
And remember, there is a newsgroup for perl questions, and it is THIS ONE.
------------------------------
Date: Wed, 11 Feb 1998 20:51:24 -0600
From: posting@antigo.com
Subject: Credit Card Check
Message-Id: <887251750.1907621900@dejanews.com>
Hello, I've developed a online shopping cart for a company and have a
credit card checker, however, I want to be able to test it without
entering my actual credit card number. Is there a so called fake credit
card number that would pass the credit checker? Thanks.
Tim Lindner
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 12 Feb 1998 05:21:41 GMT
From: Zenin <zenin@best.com>
Subject: Re: defined() bug? (or feature? :)
Message-Id: <887261167.666599@thrush.omix.com>
Mark Morgan <morganm@qualcomm.com> wrote:
: Unfortunately, I can't do that, as we use a combination of both C-shell
: scripts and Perl scripts, and I want to be able to source the C-shell
: config files and use the variables from there, also.
There's your real mistake, trying to program anything in C-Shell...
See: http://language.perl.com/versus/csh.whynot
: So the CONFIG.pm was
: written to be able to source C-shell files without choking on them, and is
: a necessity, since I can't change the C-shell config files to look like
: perl.. :P (I don't think csh would appreciate that too much :)
Hmm, this won't work?
## Read perl config file
eval `cat file.conf | sed -e 's/\$//g'`
I still think you'd be MUCH better off with a perl function call
that returned a hash you could catch from anywere into anything
without having to trash your main:: namespace at random. Forcing
it to set main:: package globals almost completely trashes any
chance of reusing the code. No OOP needed, nore would it help
any in this case, however it would be nice if you stayed out
of one's living room if you were not invited (to paraphrase the
perl manual).
--
-Zenin
zenin@best.com
------------------------------
Date: Wed, 11 Feb 1998 19:17:20 -0700
From: rc0230@email.mot.com (David Stashower)
Subject: Extra text from die on Perl-VMS
Message-Id: <rc0230-1102981917200001@mac-stash.sps.mot.com>
I am running Perl (v5.0.4_01) on a VMS/AXP system (6.2-1H3). Every time
perl executes a "die", some extra "system" message is generated, like:
%SYSTEM-F-NOLOGNAM, no logical name match
or
%RMS-F-SYN, file specification syntax error
These messages are in addition to the expected output from the Perl
script, and are generated regardless of whether the expression passed to
die is terminated with "\n" or not.
Note that the text of the message is from the last value of "$!", which
indicates that the Perl-VMS implementation of die seems to automatically
include output of this value -- which is not the case on other
implementations (SunOS 4.1.4, for example).
I want to supress this extra gobledegook, and I do NOT want to have to
write my own exception handler (i.e. using $SIG(__DIE__)).
Any ideas ? Is there some option I could use and rebuild Perl-VMS to
change this behavior (I used the default configuration to build the
current executables & libraries) ? Any ideas on who may be a good contact
for Perl-VMS questions ?
Thanks,
David Stashower
P.S. I posted on this problem a while ago, and got not response, so I
thought I would try again.
------------------------------
Date: Thu, 12 Feb 1998 00:24:43 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <34E2879F.88B6B6DD@coos.dartmouth.edu>
[posted and mailed]
Tom Christiansen wrote:
>
> Recently, with little prior analysis beyond intuition, I tossed out
> the flippant comment that this newsgroup would be a much more legible
> place if we simply killfiled all postings coming from a PC (meaning Mac
> or Windows).
I post from a Mac.
> [...]
> Further investigation revealed a depressing but indisputable correlation:
> nearly all such postings were written by someone using a PC (meaning Mac
> or Windows) system, more often than not using a web browser with a lame,
> patched-together USENET interface rather than a dedicated newsreader tool.
Fallacious statistical reasoning.
"Most of the bad posts originate from PCs." Here is a representation of that
observation:
PC non-PC
good post ?? ??
bad post Many Few
Your conclusion, that in general posts from PCs should be killfiled, does
not necessarily follow.
For example, this is possible:
PC non-PC
good post Many Few
bad post Many Few
If that were the case, there would be no correlation between PC/non-PC and
bad post/good post.
Now I'm sure you'll be happy to point out that good posts tend to originate
from non-PCs rather than PCs. But I still don't agree your conclusion
because, as I said, I post from a Mac. :-)
Chipmunk
------------------------------
Date: Thu, 12 Feb 1998 00:37:51 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <34E28AB3.553740AA@coos.dartmouth.edu>
Tom Christiansen wrote:
>
> Killing by newsreader is probably the most effective thing you can do,
> but unfortunately, there are perhaps a scant few out of each hundred
> who don't really deserve that kind of treatment. But perhaps it's
> worth it. I'm sure there are a few people who don't get addicted to
> crack cocaine, either but they're not the ones we're worried about.
> Plus any real programmer can trivially write their own newsreader,
> or forge the posting attribution.
Wow, Tom, you must have a great view from your saddle way up there.
Chipmunk
------------------------------
Date: 12 Feb 1998 05:36:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <6bu1p4$sq7$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, rjk@coos.dartmouth.edu writes:
:Now I'm sure you'll be happy to point out that good posts tend to originate
:from non-PCs rather than PCs. But I still don't agree your conclusion
:because, as I said, I post from a Mac. :-)
A Mac *is* a PC, since PC == (primitive) personal computer.
Remember that: A Mac is a PC. Anyone who told you otherwise
is lying, probably Bill.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"You need to go and find someone to teach you the rudiments of irrational
discourse." --Larry Wall
------------------------------
Date: Thu, 12 Feb 1998 04:03:27 GMT
From: meo@qld.mim.com.au.SPAMMERGOHOME (Martin Oakley)
Subject: Re: Forgery => Killfile
Message-Id: <6btsa6$8e1$1@news.mel.aone.net.au>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, Eli the Bearded <*@qz.to> writes:
>:> People who forge their return address will not receive my
>:> help. In fact, you will be killfiled. I'm not going to
>:
Well Tom probably won't see this post (if spam is a case-insensitive
match), but I've got to point out that not everyone has an environment
where mail filters are possible. Some, myself included, are forced to
use M$ mailers though NO fault of their own.
So without incoming mail filtering , one does what one can to reduce
the clutter at the source.
If forging my address stops people replying, or reading my posts, then
I can live with that.
For that matter, I could even live with the junk mail if they were
advertising something I was remotely interesed in.
It is most annoying to receive junk mail describing how to purchase 93
million addresses, while knowing that yours is one of them.
------------------------------
Date: Wed, 11 Feb 1998 23:31:39 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: getting rid of duplicate lines in a file
Message-Id: <34E27B2C.1D9E2C7B@coos.dartmouth.edu>
M.J.T. Guy wrote:
>
> Chipmunk <rjk@coos.dartmouth.edu> wrote:
> >
> >You could use others' suggestion of a hash, but if you really want the
> >equivalent of `uniq`:
> >
> >perl -ni -e 'BEGIN{$_=""} print unless $_ eq $prev; $prev = $_;' filename
>
> What's that BEGIN{$_=""} meant to be doing? Did you mean BEGIN{$prev=""} ?
> Tho' it's not needed anyway, since you're not using -w.
Yup, that's what I meant. No, I'm not using -w, but I figured I'd make it -w
friendly anyway.
Chipmunk
------------------------------
Date: Thu, 12 Feb 1998 13:40:29 +0900
From: "EWON I&C Inc." <hostmaster@DrZone.COM>
Subject: help! Perl Compiler
Message-Id: <6btugc$o28$1@newstmp1.bora.net>
hi all ~
I've problem on perl script compiling.
My test environment is below:
FreeBSD-980208-SNAP,
perl 5.004_04,
pg_perl-1.6.3
and wrote perl script name pg.pl:
#!/usr/bin/perl
use Pg;
1;
and compile with Compler-a3 like below:
perl -Iblib/arch -MO=C,-opg.c,-uPg pg.pl
perl cc_harness -o pg pg.c -L/usr/local/pgsql/lib -lpq
then, i get error messages:
pg.pl syntax OK
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_lseek' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_import' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_export' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_write' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_unlink' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_tell' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_open' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_creat' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_close' referenced
from data segment
/var/tmp/cc0143811.o: Undefined symbol `_XS_Pg_PQlo_read' referenced
from data segment
i did everything i know ... ^^;
i wanna to make executable binary using Compiler-a3.
what shall i do ?
help me ...
------------------------------
Date: 12 Feb 1998 03:54:46 GMT
From: ase@seanet.com (Allen Evenson)
Subject: Re: How to get disk's volume label under Win95?
Message-Id: <6btrq6$cs3@q.seanet.com>
In article <34E198F8.B40556D1@patriot.net>, spam@patriot.net says...
>
>I've searched through the FAQ's that seemed appropriate, CPAN, and
>message boards for references to disk labels and found nothing.
>
>I am writing a script that needs to read the volume label from a
>floppy disk (or any disk, for that matter), but I am too stupid to
>figure out how to do it nor can I find any function (perlfunc),
>module (CPAN, ...) that does it.
>
>Q: How can I get a Win95 (DOS or NT) disk volume label in a Perl
> script?
>
one Answer in many possible solutions:
from command line type: perl -e "print `vol c:`;"
also check perlfunc under system. (ie. perldoc -f system)
HTH,
Allen Evenson
------------------------------
Date: Wed, 11 Feb 1998 19:28:53 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: HUMOR: Userspeak vs Hackerspeak
Message-Id: <34E26C75.C7AFC533@us.oracle.com>
Tom Christiansen wrote:
> C:\ root#
> ============= =================
[snip]
Very funny and cool overall
,.... but....
> shortcut link
Not even remotely true!!!
And if you don't believe me, write an NFS client for NT that assumes
the above. I'll be behind the bunker, cowering. :)
-Denis
--
__ __ _ __ __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff |"I see the heads of men arise
email: dgoddard@us.oracle.com |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The Oracle_
------------------------------
Date: Thu, 12 Feb 1998 00:08:58 -0500
From: Ted Stein <ted@taki.net>
Subject: Re: Installing Linux and Perl?
Message-Id: <Pine.BSF.3.96.980212000712.20764A-100000@cheddar.netmonger.net>
What you ask is a very touchy question. Linux gurus could argue
for hours over what 'distribution' is the best. Some will say RedHat,
other Slackware, others prefer commercial. You might want to try Perl for
Win32, and then port it to UNIX, although I don't know how much porting it
requires, seeing as I've never used Win32 Perl. Also, you can create a
directory ~/testbed, or the like, for testing your Perl scripts on the
machine they'll run on, since it ultimately decides. :)
+-------------------------------------------------------+
| Ted Stein | http://www.taki.net |
| CGI/Backend | ted@taki.net |
| taki solutions | Web Design & Hosting |
|-------------------------------------------------------|
| PGP Public Key: 3852E911 |
+-------------------------------------------------------+
| "I'd give my right arm to be ambidextrous." |
+-------------------------------------------------------+
------------------------------
Date: Wed, 11 Feb 1998 21:02:19 -0500
From: "Tom Moertel" <tom@moertel.com>
Subject: Re: PUZZLE: Answer me these questions three
Message-Id: <6btl7c$avf$1@banyan.moertel.com>
OK, I'll give it a whirl.
Tom Christiansen wrote in message <6btdvg$2c4$11@csnews.cs.colorado.edu>...
> Question 1: Is this program recursive?
> Question 2: How many hashes does it use?
> Question 3: What are the names of these hashes?
No.
2.
login and group.
Nasty ;-)
Cheers,
Tom
------------------------------
Date: 12 Feb 1998 03:07:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: PUZZLE: Answer me these questions three
Message-Id: <6btp2f$ir0$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Tom Moertel" <tom@moertel.com> writes:
:Tom Christiansen wrote in message <6btdvg$2c4$11@csnews.cs.colorado.edu>...
:No.
:2.
:login and group.
:Nasty ;-)
You mean %main:: doesn't count? ;-)
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
English is a 5-tuple ... --dmr
------------------------------
Date: Thu, 12 Feb 1998 02:43:10 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <6bto0f$1q1@sjx-ixn5.ix.netcom.com>
Jerome O'Neil <joneil@cks.ssd.k12.wa.us> wrote:
>I think he's just a kid. Mahaps a sloppy, evil, bad programmer kid?
For whatever difference it makes, I'm pretty sure that he just turned
18 and started college, though most of those scripts saw their last
updates when he was about 16. The last few months have seen the
release of the first book he's co-authored, CGI/Perl Cookbook from
Wiley (which sports a nice compliment from Randal on the cover, btw.)
On a personal note, one of Matt's scripts was the first Perl script I
downloaded years ago and installed when I started learning Perl. Over
three months of learning I extended it considerably until I finally
outgrew it and started over from scratch. Back then, there weren't
many complete CGI applications out there that worked that could be
downloaded and installed for free. All I remember is MSA and Selena
Sol. They definately helped me at the time, both for their
functionality and the experience of getting to modify and improve
them.
I'm not sure if I can draw any further conclusion. As has been
pointed out by others (and as I've seen myself) there are weaknesses
in the programming in many cases.
Cheers,
Jeff
-------------------------------
Jeff Yoak jeff@yoak.com
------------------------------
Date: 11 Feb 1998 19:03:54 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Search files seq. help
Message-Id: <m3ra59v811.fsf@windlord.Stanford.EDU>
Jonathan S Gines <jsgines@uu.net> writes:
> I would like to write a script that will accept input from the keyboard,
> and use that input as a reg. expression to search a file. I was using
> the $variable = <STDIN> scalar value to be used in the search, but I am
> unsuccessful.
$search = <STDIN>;
open (FILE, "filename") or die "Cannot open filename: $!\n";
while (<FILE>) {
if (/$search/) {
# Do whatever you want to do with matching lines.
}
}
If you want to only search specific fields in each line, you'll want to do
something like:
@fields = split (' ', $_); # or whatever delimiter is used
if ($fields[2] =~ /$search/) { ... } # or whatever field is used
--
#!/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: Wed, 11 Feb 1998 19:16:47 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: Seriously Off Topic, but a Common Complaint/Problem in this NG
Message-Id: <34E2699F.90B00D0D@us.oracle.com>
Cameron Dorey wrote:
>
> "Fix your word wrapping, or I _will_ killfile you."
I must say, while this riled me at first, it *did* prompt me to
resolve the problem...
(At least I *think* it's resolved, but maybe everybody killfiled me!)
["It started with a shared killfile." -W Gibson, _Idoru_]
> Is there a feature of NS that I'm missing (surely some of you use NS,
> maybe even some of the real programmers)?
Not one of the real programmers (but I sometimes drink with them :)
Anyways, to niceify Netscape's newsreader:
Edit -> Preferences -> Mail & Groups
Choose "Fixed Width Font"
Edit -> Preferences -> Messages
UN-check "By default, send HTML messages"
Wrap long lines at: (any positive number less than 80)
-> click "More Options..." button
Send messages that use 8-bit characters: [x]As is (NOT MIME encoded!)
When sending HTML messages...: [x]Always convert to Plain Text
HTH!
And if I'm missing something, let me know!
-Denis
--
__ __ _ __ __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member, Tech. Staff |"I see the heads of men arise
email: dgoddard@us.oracle.com |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The Oracle_
------------------------------
Date: 11 Feb 1998 18:55:43 -0800
From: Russ Allbery <rra@stanford.edu>
To: perlbug@perl.org
Subject: Re: strange key behaviour and the Blue Camel
Message-Id: <m3vhulv8eo.fsf@windlord.Stanford.EDU>
Russ Allbery <rra@stanford.edu> writes:
> My understanding was that => was supposed to treat the string on the
> left side as a quoted string, but that appears to fail for numbers.
To follow up to this, I see that the documentation does say => only quotes
legal identifiers. It would seem to me to make sense to extend this to
such things as 000, but perhaps that would be too hard for the parser to
manage?
--
#!/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: 11 Feb 1998 19:07:41 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Substitution : \n with space
Message-Id: <m3oh0dv7uq.fsf@windlord.Stanford.EDU>
thanasis bothos <thanasis@uclink4.berkeley.edu> writes:
> I am trying to substitute new lines embedded in a scalar ($DESCRIPTION)
> with space. I tried: $DESCRIPTION =~ s/(\n)/ /g; This takes the NL's
> out, but messes up the result.
In what way does it mess up the result? In order for us to help you,
you'll have to be more specific.
BTW, those parentheses are completely needless;
s/\n/ /g;
does the same thing. And, even better, there's a Perl function for doing
precisely this (character substitution); just do:
tr/\n/ /;
and that will be even faster.
--
#!/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, 12 Feb 1998 16:53:54 +1100
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Tom wins flamer of the year award!
Message-Id: <bigiain-ya02408000R1202981653540001@news.ozemail.com.au>
In article <34E225E5.BCDBE91@weboneinc.com>, Douglas Clifton
<doug@weboneinc.com> wrote:
> ;-)
i suspect Doug just came *this close* to winning the "largest number of
killfile entries on a single day" award <GRIN>
iain
Iain Chalmers
bigiain@mightymedia.com.au
------------------------------
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 1870
**************************************