[13010] in Perl-Users-Digest
Perl-Users Digest, Issue: 420 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 8 14:06:30 1999
Date: Sun, 8 Aug 1999 11:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 8 Aug 1999 Volume: 9 Number: 420
Today's topics:
Re: 3 dimensional array <stirling@banet.net>
Re: can Perl send e-mail with attached files? <stirling@banet.net>
Re: capturing login and send passwd (Mike Bristow)
Re: cgi-lib.pl / File Upload <stirling@banet.net>
Re: CHMOD files under NT?? <stirling@banet.net>
Re: CHMOD function <stirling@banet.net>
Re: file manipulation? <rootbeer@redcat.com>
Re: getting files from a user through the internet (Bill Moseley)
Getting Info (Jimtaylor5)
Re: Getting Info (Matthew Bafford)
Re: Getting Info (I R A Darth Aggie)
Re: How to protect perl script? <flavell@mail.cern.ch>
Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
Re: I guess this is a Misc question: Cgi-bin (I R A Darth Aggie)
Re: I guess this is a Misc question: Cgi-bin (I R A Darth Aggie)
Re: Is this an appropreate use of -i switch? <rootbeer@redcat.com>
Re: Is this an appropreate use of -i switch? (Bill Moseley)
Re: Is this an appropreate use of -i switch? <rootbeer@redcat.com>
Re: just days away f7.8ez5.88ox <Graeme@greywall.demon.co.uk>
Re: lstat on a unicode file in NT? <rootbeer@redcat.com>
Re: LWP::Simple and URI::URL <rootbeer@redcat.com>
matching ONLY first match in dada stream... ("Bill Jones")
Re: Nastiness contrary to the spirit of perl? (I R A Darth Aggie)
Re: Nastiness contrary to the spirit of perl? (I R A Darth Aggie)
Re: Nastiness contrary to the spirit of perl? (I R A Darth Aggie)
Re: Newbie question about $_ <bowman@montana.com>
Newbie question <dheller1@rochester.rr.com>
Re: Newbie question <rootbeer@redcat.com>
Re: Nicer Way <admin@gatewaysolutions.net>
Re: Nicer Way (Anno Siegel)
Re: Nicer Way (Larry Rosler)
Re: Nicer Way (Larry Rosler)
Re: Precompliled perl5.005 for sun4 <rootbeer@redcat.com>
Re: sed vs. grep for string manipulation? <rootbeer@redcat.com>
Re: Spider engine database script <rootbeer@redcat.com>
Re: SSH2, Need a little help <rootbeer@redcat.com>
Re: Where to find help other than perldoc and books. (I R A Darth Aggie)
Re: Where to find help other than perldoc and books. (Anno Siegel)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 8 Aug 1999 13:36:18 -0400
From: <stirling@banet.net>
Subject: Re: 3 dimensional array
Message-Id: <37adbe7b@news1.us.ibm.net>
c
------------------------------
Date: Sun, 8 Aug 1999 13:45:53 -0400
From: <stirling@banet.net>
Subject: Re: can Perl send e-mail with attached files?
Message-Id: <37adc0bd@news1.us.ibm.net>
YES! you can use the MIME::Entity module for perl this will allow you to
send both ASCII and Binary attachments through e-mail!
--
Yours Sincerely,
Stirling Hughes
DesignMultimedia
stirling@designmultimedia.com
nothlit@my-deja.com wrote in message <7o7p6e$748$1@nnrp1.deja.com>...
>I know that Perl can easily be used to send e-
>mail by piping into the sendmail program, and I
>have used this many times. But is there a way to
>attach a separate file (ascii or binary) to an e
>mail sent using Perl? For example, I'd like
>people who visit my site to be able to upload fan
>fiction stories using a typical INPUT TYPE="file"
>form field. I would then like to have a Perl
>script send me that file attached to an e-mail.
>Is this possible?
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
------------------------------
Date: Sun, 08 Aug 1999 17:50:18 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: capturing login and send passwd
Message-Id: <slrn7qrgqq.4ls.mike@lindt.fat.dotat.at>
On Sun, 08 Aug 1999 07:46:17 -0400, Carlos Reed <creeds@sprint.ca> wrote:
>a) I'm wonering, if someone has done such a script, somewhere in the
>net.
Probably.
>b) Is there a perl module that acts like expect?
Yes, it's called expect.
You might also want to take a look at Net::Telnet.
>c) any sugestions will be welcomed.
Do not reinvent the wheel - the world has enough square wheels already.
Learn how to search CPAN - it'll save you time.
--
Mike Bristow, Geek-At-Large. GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!
------------------------------
Date: Sun, 8 Aug 1999 13:49:35 -0400
From: <stirling@banet.net>
Subject: Re: cgi-lib.pl / File Upload
Message-Id: <37adc194@news1.us.ibm.net>
try
if(defined($in{'upfile'})) {
do whatever
} else {
print "No such file";
}
--
Yours Sincerely,
Stirling Hughes
DesignMultimedia
stirling@designmultimedia.com
Andrew Holman wrote in message ...
>I am using the example off of the cgi-lib.pl page,
>for the file upload scripts. However, I want to verify that
>someone chose a file. On the html it shows the filename text box is named
>upfile, and the notes text box is named notes. However when I try and do
>error checking
>to make sure that someone entered a filename in the upfile text box it does
>not work.
>
>I have tried
>
>if ($in{'upfile'} eq "" ) {
> print "No file chosen!";
>} else
>
> do whatever ....
>}
>
>this does not work. When I have an if elsif else statement it totally skips
>the the first
>part where if the filename is "". This is what I get when I print @in to
the
>page....
>
>
>Content-Disposition: form-data; name="upfile"; filename="C:\Program
>Files\Outlook Express\msoe.txt" Content-Type: text/plain
>Content-Disposition: form-data; name="note" Content-Disposition: form-data;
>
>I am looking for a way to check that filename="" up there. If it is blank
>then print a message then if it is ok then check note and make sure it is
>ok, then continue on. I have tried just about everything I could think of
>and it didn't work. Any help in helping me determine how the check and see
>if filename="" would be greatly appreciated.
>
> Thanks,
> Andy
>
>--
>Andrew J. Holman
>MCI WorldCom
>Engineer III
>DaimlerChrysler NMC
>
>
------------------------------
Date: Sun, 8 Aug 1999 13:51:02 -0400
From: <stirling@banet.net>
Subject: Re: CHMOD files under NT??
Message-Id: <37adc1ec@news1.us.ibm.net>
Perl and CGI scripts are automatically executable in windows NT and do not
need to have permissions set
--
Yours Sincerely,
Stirling Hughes
DesignMultimedia
stirling@designmultimedia.com
rezn8 wrote in message <7o9mpj$l29$1@pegasus.csx.cam.ac.uk>...
>How do you set CHMOD settings under NT, I am running Apache for NT.
>
>
------------------------------
Date: Sun, 8 Aug 1999 14:01:24 -0400
From: <stirling@banet.net>
Subject: Re: CHMOD function
Message-Id: <37adc476@news1.us.ibm.net>
try:
$orig="sample.txt";
chmod (0770,$orig);
NOTICE: There are double quotes instead of single quotes.
--
Yours Sincerely,
Stirling Hughes
DesignMultimedia
stirling@designmultimedia.com
NightFever wrote in message <37a5cb50.16860675@news.idt.net>...
>I'm tring to make this work:
>
>$OrignialLogFile = 'sample.txt';
>..
>..
>..
>..
>chmod (0770, $OrignialLogFile);
>
>I'm tring to chmod a file to 770 (or any mode for that matter) and it
>won't change it. It will change it if I put the exact file, but not a
>a variable like this example, can anyone help?
------------------------------
Date: Sun, 8 Aug 1999 08:59:42 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: file manipulation?
Message-Id: <Pine.GSO.4.10.9908080857480.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999, ted fiedler wrote:
> also is there a way that i can print a file and in one font and switch
> to another font in the middle of it such as in adding a barcode
> font...
It sounds as if you want to find out how to control the output of your
printer; see its manual for details. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 08:27:18 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: getting files from a user through the internet
Message-Id: <MPG.121741ae4f2f91fc989693@nntp1.ba.best.com>
Webexchange Team (help@xellent.co.uk) seems to say...
> I'm trying to write a script that allows people to upload photos to my web
> site. Does anyone know what modules etc I need to use? Something to point
> me into the right direction would be nice.
Can you post a couple of the photos???
Try CGI.pm
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 08 Aug 1999 15:07:40 GMT
From: jimtaylor5@aol.com (Jimtaylor5)
Subject: Getting Info
Message-Id: <19990808110740.14799.00004343@ng-cj1.aol.com>
Here's a question for you guys. Is there a way with perl to get the total kb of
files in a directory, and the space left? If so could give me an example or
direct me to where I can find the information. Thanks.
------------------------------
Date: Sun, 08 Aug 1999 16:09:30 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Getting Info
Message-Id: <slrn7qr8rh.3ub.*@dragons.duesouth.net>
08 Aug 1999 15:07:40 GMT, a great smashing of the head occured against
Jimtaylor5)'s keyboard, causing comp.lang.perl.misc to receive this:
: Here's a question for you guys. Is there a way with perl to get the total kb of
: files in a directory, and the space left? If so could give me an example or
: direct me to where I can find the information. Thanks.
perldoc -f opendir
perldoc -f readdir
perldoc -f closedir
perldoc -f stat
perldoc perlop
perldoc -f printf
HTH,
--Matthew
------------------------------
Date: 8 Aug 1999 16:43:07 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Getting Info
Message-Id: <slrn7qrd10.tfp.fl_aggie@thepentagon.com>
On 08 Aug 1999 15:07:40 GMT, Jimtaylor5 <jimtaylor5@aol.com>, in
<19990808110740.14799.00004343@ng-cj1.aol.com> wrote:
+ Here's a question for you guys. Is there a way with perl to get the total kb of
+ files in a directory, and the space left? If so could give me an example or
+ direct me to where I can find the information. Thanks.
#!/usr/bin/perl
#-- -*-perl-*-
@files=`du -sk $ARGV[0] * | sort -nr`;
chomp(@files);
$sum=0;
foreach (@files) {
print ;
print "\n";
($num,undef) = split;
$sum+=$num
}
print "Total: $sum\n";
James
------------------------------
Date: Sun, 8 Aug 1999 16:47:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to protect perl script?
Message-Id: <Pine.HPP.3.95a.990808163520.14285D-100000@hpplus03.cern.ch>
On Sun, 8 Aug 1999 jteens@my-deja.com wrote:
> Sorry if this is off topic.
It is. The answer would be the same if you were writing your CGI script
in shell or C++ or COBOL; it has nothing to do with the Perl language.
> I've cgi script running on my site and I
> don't want another host to run my cgi from their host. I try
> to protect my script by check HTTP_REFERER but they send fake
> HTTP_REFERER to my server so I can't block them.
You haven't explained your problem very clearly.
If one known site is accessing your script inappropriately, then surely
you just block access from that site or domain?
I thought at first you meant they were serving out an HTML page
that references your script. And then the actual requests could be
coming from anywhere. But then there shouldn't be any way they could
forge the referer header.
> Any help would be mostly apreciated.
It would?
I suggest you should explain the problem on the c.i.w.authoring.cgi
group in rather more detail. Make it clear what you a really trying to
achieve, in real world terms; it may well be that an alternative
approach to the task is called for, rather than trying to fix some
problem with the solution that you're currently trying.
------------------------------
Date: Sun, 8 Aug 1999 14:06:14 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37adb699.0@news2.cluster1.telinco.net>
>>>!! Lighten up
>>>
>>>*ploink*
>>
>>Meaning....
>
>ploink (interjection): Dialectal variant of Standard Usenet English
>"plonk." Indicates that the "plo(i)nkee" has been placed in the
>"plo(i)nker's" killfile, i.e. that the "plo(i)nker" will no longer see any
>postings from the "plo(i)nkee". Also used as a verb: "I plo(i)nked him."
>Probably from the sound of an object hitting the bottom of a metal
>(bit-)bucket.
Riiight. I've been killfiled. OH NO!!
Why, was it because a truthful description of this group cannot be handled?
>--
>Jon Bell <jtbell@presby.edu> Presbyterian College
>Dept. of Physics and Computer Science Clinton, South Carolina USA
> [ Information about newsgroups for beginners: ]
> [ http://www.geocities.com/ResearchTriangle/Lab/6882/ ]
------------------------------
Date: Sun, 8 Aug 1999 17:22:46 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37adc3b7.1@news2.cluster1.telinco.net>
>> No, in a supermarket you'd ask one of the staff and they'd point you in
the
>> right direction. I didn't know that my post wo
>> uld be considered off topic until you lot gave me all this useless grief
>
>It's only "useless" if you've refused to learn anything from it.
I'm not refusing. I asked a question and would've appriecated an answer.
Whic I (eventually) got
>It's pointless making any further comments about your usenet posting
>style, isn't it?
Could you expand on that please?
>You're just demanding to be plonked by many of those
>who could be genuinely helpful to you. So be it.
I've demanded nothing
------------------------------
Date: 8 Aug 1999 16:46:26 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <slrn7qrd77.tfp.fl_aggie@thepentagon.com>
On Sat, 7 Aug 1999 23:34:13 +0100, Ben Quick <newsgroup@bigwig.net>, in
<37ad85a1.0@news2.cluster1.telinco.net> wrote:
+ No, in a supermarket you'd ask one of the staff
Yes, and the staff are there because?
Hint: you help *pay* their salaries...I haven't seen any monies coming
from you on my pay sheet...
James
------------------------------
Date: 8 Aug 1999 16:51:20 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <slrn7qrdgc.tfp.fl_aggie@thepentagon.com>
On Sun, 8 Aug 1999 14:06:14 +0100, Ben Quick <newsgroup@bigwig.net>, in
<37adb699.0@news2.cluster1.telinco.net> wrote:
+ Riiight. I've been killfiled. OH NO!!
+ Why, was it because a truthful description of this group cannot be handled?
Why should any given person on this group be expected to know the answer
to a unix file permissions question? Perl doesn't just work under unix,
you know.
You did know that, right? I'll be blunt: you are a jackass.
James - next time, go ask in the C newsgroups...they're as likely to know...
------------------------------
Date: Sun, 8 Aug 1999 08:41:58 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is this an appropreate use of -i switch?
Message-Id: <Pine.GSO.4.10.9908080834250.19222-100000@user2.teleport.com>
On Sat, 7 Aug 1999, Bill Moseley wrote:
> One solution would seem to be to wrap the while loop in an eval and
> check $@. If $@ returns true then do something like put the file back
> to the way it was by copying the .bak file over the source and making
> some type of fuss in a log file.
My soul nonverbally howls in protest against this method. But maybe that's
just me....
> Well, when trying this I get a permission denied error. Is that
> because the while (<>) still has the file open for reading?
Shouldn't be. Unless your non-Unix system has some restrictions on
renaming open files; Unix doesn't mind that.
> If the error is because the file is still open, then how does one close
> the magic <>?
Use the ARGV filehandle; see perlfunc's entry for eof for an example.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 09:55:52 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Is this an appropreate use of -i switch?
Message-Id: <MPG.12175671bc599085989694@nntp1.ba.best.com>
Tom Phoenix (rootbeer@redcat.com) seems to say...
> My soul nonverbally howls in protest against this method. But maybe that's
> just me....
Oh please don't be shy. If you didn't have opinions about things I
wouldn't be asking about things.
> > Well, when trying this I get a permission denied error. Is that
> > because the while (<>) still has the file open for reading?
>
> Shouldn't be. Unless your non-Unix system has some restrictions on
> renaming open files; Unix doesn't mind that.
You mean DOS and Unix have different file systems ;)
> Use the ARGV filehandle; see perlfunc's entry for eof for an example.
The example works on BSD, but fails on Win98 -- even with adding a
close ARGV before attempting to rename.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Sun, 8 Aug 1999 10:39:57 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is this an appropreate use of -i switch?
Message-Id: <Pine.GSO.4.10.9908081031170.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999, Bill Moseley wrote:
> Tom Phoenix (rootbeer@redcat.com) seems to say...
> > My soul nonverbally howls in protest against this method. But
> > maybe that's just me....
>
> Oh please don't be shy. If you didn't have opinions about things I
> wouldn't be asking about things.
It's just that reading from diamond is a quick-and-dirty kind of thing.
Nothing wrong with that, in and of itself. But putting it inside an eval
block, well, I can't quite put my finger on it, but... Imagine seeing
James Bond, agent 007, played by Sean Connery, wearing his Saville Row
suit, and now you see he's ordering a Big Mac, two large fries, and a
Happy Meal at McDonalds. Something doesn't seem quite right, now does it?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 07 Aug 1999 20:12:55 +0100
From: Graeme Wall <Graeme@greywall.demon.co.uk>
Subject: Re: just days away f7.8ez5.88ox
Message-Id: <ba73fd2d49%Graeme@greywall.demon.co.uk>
In message <5IIq3.4770$dE1.6107@newreader.ukcore.bt.net>
"Michael Connell" <mconnell@lineone.net> wrote:
> > This is no mere coincidence my friends. The Lord is Present.
>
> While he's here can he please tell us whether a ticket from London to
> Carlisle route Direct is or isn't valid via the Settle & Carlisle?
>
>
Usual request, how do you get coffee out of the keyboard :-)
--
Graeme Wall
------------------------------
Date: Sun, 8 Aug 1999 08:27:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: lstat on a unicode file in NT?
Message-Id: <Pine.GSO.4.10.9908080821350.19222-100000@user2.teleport.com>
On 7 Aug 1999, Tom Shou wrote:
> I'm trying to open a unicode file on an Windows NT4.0 system, but
> lstat (stat behaves the same way) doesn't seem to be able to examine
> the file.
Maybe you should encourage perl to tell you what went wrong.
> ($dev,$ino,$mode,$nlink) = lstat($_); # where $_ happens to be a unicode file
> print "lstat output:$dev,$ino,$mode,$nlink \n";
How about something like this, between those two statements:
die "Can't lstat '$_': $!" unless defined $dev;
I should say that I'm not completely certain that $dev should be defined
on Windows after a successful lstat, and that I'm not certain that the
reason for failure will be in $!, since I don't have any Windows machines
to test this on. And of course, if you don't want your code to die, that's
easily changed.
The fact that it's a unicode file shouldn't have anything to do with your
troubles.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 08:52:18 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: LWP::Simple and URI::URL
Message-Id: <Pine.GSO.4.10.9908080851150.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999, Rob Sedgwick wrote:
> Is there a free web host that provides these two libraries?
Yes, you can get them from CPAN.
Or is that not what you meant? If you're looking to find web hosting
services, this newsgroup is probably not the resource for you. Search on
Yahoo or a similar service. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 08 Aug 1999 10:38:36 -0400
From: bill@fccj.org ("Bill Jones")
Subject: matching ONLY first match in dada stream...
Message-Id: <199908081434.KAA02389@astro.fccj.cc.fl.us>
> $1 only encompasses the first part of the regex. You need capturing
> parentheses around the whole thing.
>
> s{(\d+(?:\.\d+)+)} {<A HREF="$1">$1</A>}g;
>
> BTW, instead of {1}, you could have written {1,1}.
> Or even {1,1}?. ;)
>
OK; I am using the below to capture key MIS definitions -
s{(mis\b)} {<A HREF="/cgi-bin/http_webster?isindex=$1">$1</A>}ig;
But that matches everything, on each line, in the complete data (even
without the global modifier.)
I tried the below, to match just one, but it doesn't appear to work:
s{(mis\b{1})} {<A HREF="/cgi-bin/http_webster?isindex=$1">$1</A>}i;
???
-Sneex- :]
____________________________________________________________________
Bill Jones Data Security Specialist http://jacksonville.pm.org
------------------------------
Date: 8 Aug 1999 16:54:09 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7qrdlm.tfp.fl_aggie@thepentagon.com>
On Sun, 08 Aug 1999 06:13:27 GMT, Matt <mck@iag.net>, in
<37af1583.1957865@news.iag.net> wrote:
+ On 6 Aug 1999 20:53:25 GMT, fl_aggie@thepentagon.com (I R A Darth
+ Aggie) wrote:
+ >Multiple aliases? is that due to "lighthearted" fun, or an attempt to
+ >evade killfiles? To coin a phrase: that simply isn't cricket.
+ Simple levity, nothing more. Killfiles were not a concern. Personally,
+ I have no need for a killfile, and thus did not have much interest in
+ other's.
Please be considerate of other people. If you aren't considerate of them,
why should they be considerate of you?
+ Note from the headers that I have lost my "sense of humor". Another
+ reply to this thread segment is the reason.
Oh, good. Now I can *plonk* and not have you metamorphise on me...
James
------------------------------
Date: 8 Aug 1999 17:17:10 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7qrf0p.tfp.fl_aggie@thepentagon.com>
On Sun, 08 Aug 1999 06:13:29 GMT, Matt <mck@iag.net>, in
<37b0161b.2109192@news.iag.net> wrote:
+ On 7 Aug 1999 09:57:25 -0700, Tom Christiansen <tchrist@mox.perl.com>
+ wrote:
+
+ >The cretin has earned a new killfile entry:
+ >
+ > /\biag\.net/HMessage-ID:j
+ >
+ >Pity I have to throw all the apples out due to one bad one. But I shall
+ >not suffer illegal and unaccountable messages to grace my screen.
+ I say with
+ no malice that you damage your image, with some of us, through this
+ type of dialog. Perhaps you do not care. Perhaps you feel you have
+ earned the right to look down on others.
+ Cretin? I believe you have too little knowledge of me to make such an
+ assumption. I would not assume to make such a judgement on someone
+ with such public exposure as yourself. Even if you find my actions
+ distasteful (although, I cannot believe anyone could, reasonably),
Oh, yes, I do. You were morphing your From: line, and the only reliable
fingerprint for your posts was your ISP. In my experience, the only people
who morph around like that are those attempting to evade killfiles. Such
behaviour is considered rude. You don't want to post with a deliverable
address? fine, but use only *one*.
+ why would you killfile an entire ISP?
Because that was the only reliable way of nuking *your* posts. This is
something that *you* thru *your* actions have directly caused.
You talk about public image, and perception. Take a deep breath, step
back, and look at you own. It isn't exactly one that makes me want to
take your words at face value...
James
------------------------------
Date: 8 Aug 1999 17:21:12 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7qrf8d.tfp.fl_aggie@thepentagon.com>
On Sun, 8 Aug 1999 02:30:38 -0400, J. Moreno <planb@newsreaders.com>, in
<1dw746v.irehoo1kdrynuN@roxboro0-0021.dyn.interpath.net> wrote:
+ So when someone post such utter stupidity the only proper response is to
+ flame the hell out of them, in the hopes that (1) they won't do it
+ again, (2) the non-clueless newbie will read it and RTFM, and (3) as a
+ warning to other morons that they should be more careful when posting or
+ they too will go through life extra crispy.
Just like such people go thru Real Life. Amazing. When they do it in
perl, we're supposed to be nice.
But when they do it in Real Life, and the end up on Jenny Jones, or Cops,
or the ultimate list, the Darwin Awards, we laugh at them...
Hmmm...
James
------------------------------
Date: Sun, 08 Aug 1999 10:48:35 -0600
From: bowman <bowman@montana.com>
Subject: Re: Newbie question about $_
Message-Id: <37ADB4E3.DB87845@montana.com>
Abigail wrote:
>
> animal food trough water! I fart in your general direction! Your mother
> was a hamster and your father smelt of elderberries! I do wish we could
> chat longer, but I'm having an old friend for dinner. The maple syrup
Finally got that Markov chain snippet from _The Practice of Programming_
working, did you?
------------------------------
Date: Sun, 08 Aug 1999 13:09:14 -0400
From: David Heller <dheller1@rochester.rr.com>
Subject: Newbie question
Message-Id: <37ADB9BA.7C3D679D@rochester.rr.com>
Hi All
I get the following message from my perl interpreter: Warning Setting
locale failed Check your settings LC_ALL = (unset) and LANG = us what
does this mean and how do I fix it? my O.S. is NetBSD 1.4 .
Thanks
Dave
------------------------------
Date: Sun, 8 Aug 1999 10:43:33 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie question
Message-Id: <Pine.GSO.4.10.9908081041250.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999, David Heller wrote:
> Subject: Newbie question
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> I get the following message from my perl interpreter: Warning Setting
> locale failed Check your settings LC_ALL = (unset) and LANG = us what
> does this mean and how do I fix it?
The perldiag manpage says the following. Cheers!
=item perl: warning: Setting locale failed.
(S) The whole warning message will look something like:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "En_US",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Exactly what were the failed locale settings varies. In the above the
settings were that the LC_ALL was "En_US" and the LANG had no value.
This error means that Perl detected that you and/or your system
administrator have set up the so-called variable system but Perl could
not use those settings. This was not dead serious, fortunately: there
is a "default locale" called "C" that Perl can and will use, the
script will be run. Before you really fix the problem, however, you
will get the same error message each time you run Perl. How to really
fix the problem can be found in L<perllocale> section B<LOCALE PROBLEMS>.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 11:26:42 -0500
From: "Scott Beck" <admin@gatewaysolutions.net>
Subject: Re: Nicer Way
Message-Id: <rqrbppp6kur92@corp.supernews.com>
Just writting to thank you for your reply.
Thanks. (Alot!!)
--
Scott Beck
admin@gatewaysolutions.net
www.gatewaysolutions.net
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.121600294528cf0a989dff@nntp.hpl.hp.com...
> In article <rqohn6emkur21@corp.supernews.com> on Sat, 7 Aug 1999
> 09:49:19 -0500, Scott Beck <admin@gatewaysolutions.net> says...
> > I am sure there is a nicer way to write this so I am not even going to
pose
> > that question.
> > What is the nicer way?
> >
> > #!/usr/bin/perl
> > %ch=(r=>4,
> > w=>2,
> > x=>1,
> > k=>0
> > );
> > $chmod="rwxr-xr-x";
> > $chmod =~ s/\-/k/g;
>
> Needless transformation; '-' => 0 in the hash.
>
> > $chmod =~
> >
s/(.)(.)(.)(.)(.)(.)(.)(.)(.)/$ch{$1}+$ch{$2}+$ch{$3}.$ch{$4}+$ch{$5}+$ch{$6
> > }.$ch{$7}+$ch{$8}+$ch{$9}/e; #note: this is one long line!
>
> Needlessly one long line!
>
> > print "$chmod";
>
>
> The hash is better replaced by direct translation. This looping
> approach is undoubtedly 'nicer':
>
>
> #!/usr/local/bin/perl -w
> use strict;
>
> my $chmod = 'rwxr-xr-x';
> ($_ = $chmod) =~ tr/rwx-/4210/;
> $chmod = '';
> $chmod .= $1 + $2 + $3 while /(.)(.)(.)/g;
> print "$chmod\n";
> __END__
>
>
> Don't forget that if you feed the result back to chmod(), you must
> convert it to octal first.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: 8 Aug 1999 16:51:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Nicer Way
Message-Id: <7okcio$jdk$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <rqohn6emkur21@corp.supernews.com> on Sat, 7 Aug 1999
>09:49:19 -0500, Scott Beck <admin@gatewaysolutions.net> says...
>> I am sure there is a nicer way to write this so I am not even going to pose
>> that question.
>> What is the nicer way?
[snip original solution]
>The hash is better replaced by direct translation. This looping
>approach is undoubtedly 'nicer':
>
>
>#!/usr/local/bin/perl -w
>use strict;
>
>my $chmod = 'rwxr-xr-x';
>($_ = $chmod) =~ tr/rwx-/4210/;
>$chmod = '';
>$chmod .= $1 + $2 + $3 while /(.)(.)(.)/g;
>print "$chmod\n";
>__END__
I don't think pack() has been exploited yet. It brings back the \e
modifier, but it's faster by a factor of almost three:
#!/usr/bin/perl -w
use strict;
my $chmod = 'rwxr-xr-x';
$chmod =~ tr/rwx-/1110/;
$chmod =~ s/(...)/ord pack 'b3', $1/ge;
print "$chmod\n";
__END__
I won't say how many attempts I took to make pack work. I lost
count anyway.
Anno
------------------------------
Date: Sun, 8 Aug 1999 10:28:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nicer Way
Message-Id: <MPG.12175e125d8155b9989e04@nntp.hpl.hp.com>
In article <rqrbppp6kur92@corp.supernews.com> on Sun, 8 Aug 1999
11:26:42 -0500, Scott Beck <admin@gatewaysolutions.net> says...
> Just writting to thank you for your reply.
> Thanks. (Alot!!)
You're welcome. And thank you for a little 'fun' problem.
> Larry Rosler <lr@hpl.hp.com> wrote in message
> news:MPG.121600294528cf0a989dff@nntp.hpl.hp.com...
...
> > #!/usr/local/bin/perl -w
> > use strict;
> >
> > my $chmod = 'rwxr-xr-x';
> > ($_ = $chmod) =~ tr/rwx-/4210/;
> > $chmod = '';
> > $chmod .= $1 + $2 + $3 while /(.)(.)(.)/g;
> > print "$chmod\n";
> > __END__
Abigail showed a 'nicer' way of writing the conversion loop:
$chmod =~ tr/rwx-/4210/;
$chmod =~ s/(.)(.)(.)/$1 + $2 + $3/eg;
Her way of reducing that two-liner to a one-liner was grotesque, though,
IMO. So that may be as 'nice' as it gets.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 8 Aug 1999 10:46:28 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nicer Way
Message-Id: <MPG.12176252de44a39b989e05@nntp.hpl.hp.com>
In article <7okcio$jdk$1@lublin.zrz.tu-berlin.de> on 8 Aug 1999 16:51:36
-0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
...
> I don't think pack() has been exploited yet. It brings back the \e
> modifier, but it's faster by a factor of almost three:
>
> #!/usr/bin/perl -w
> use strict;
>
> my $chmod = 'rwxr-xr-x';
> $chmod =~ tr/rwx-/1110/;
> $chmod =~ s/(...)/ord pack 'b3', $1/ge;
> print "$chmod\n";
> __END__
>
> I won't say how many attempts I took to make pack work. I lost
> count anyway.
About 3.5 times faster on this machine than the attempt I published a
few minutes ago. Certainly the 'nicest', by yet another dimension.
What an instructive little problem this has turned out to be!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 8 Aug 1999 08:33:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Precompliled perl5.005 for sun4
Message-Id: <Pine.GSO.4.10.9908080829150.19222-100000@user2.teleport.com>
On 7 Aug 1999, Michael Ghens wrote:
> Subject: Precompliled perl5.005 for sun4
>
> Subject says it all. Looking for a precompiled version of perl5.005 for
> sun4.1.4
Have you seen CPAN?
http://www.cpan.org/ports/
But you should probably compile your own. It's a simple process that
should go without a hitch if your system is at all normal - and if it
isn't, the binary from a normol site won't work for you anyway.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 08:56:41 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: sed vs. grep for string manipulation?
Message-Id: <Pine.GSO.4.10.9908080856250.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999 donturn@my-deja.com wrote:
> i'm running into this puzzler as i'm trying to replace the strings
> "card=", "cards=", or for that matter
> "cardinals=".
>
> this command works fine for grep:
>
> grep -e card*= lookfile.txt
>
> but this doesn't work in sed:
>
> sed -e 's/card*=/replacestring/' lookfile.txt>newfile.txt
>
>
> any help appreciated
Use perl instead. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 08:13:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Spider engine database script
Message-Id: <Pine.GSO.4.10.9908080812440.19222-100000@user2.teleport.com>
On Sun, 8 Aug 1999, Craig wrote:
> I am looking for a script
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 8 Aug 1999 08:17:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: SSH2, Need a little help
Message-Id: <Pine.GSO.4.10.9908080815570.19222-100000@user2.teleport.com>
On Sat, 7 Aug 1999, Kevin Reid wrote:
> Another way is:
>
> @x = qw( C D . _ ), '#', qw( M X N M V ALL );
>
> BTW, I think that warning is more annoying than useful.
$ perl -w
@x = qw( C D . _ ), '#', qw( M X N M V ALL );
Useless use of a constant in void context at - line 1.
Use of implicit split to @_ is deprecated at - line 1.
Name "main::x" used only once: possible typo at - line 1.
Which one of those three warnings was more annoying than useful? :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Aug 1999 17:22:34 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Where to find help other than perldoc and books.
Message-Id: <slrn7qrfau.tfp.fl_aggie@thepentagon.com>
On Sun, 8 Aug 1999 04:33:07 -0400, James A Culp III <admin@futuristic.net>, in
<7ojfp8$p94$1@ffx2nh3.news.uu.net> wrote:
+ I am interested in finding one or more experienced perl programmers
+ that would be willing to spend a minimal amount of time (by their
+ definition) to peruse code, and answer style
You've read perlstyle, I take it?
James
------------------------------
Date: 8 Aug 1999 17:52:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Where to find help other than perldoc and books.
Message-Id: <7okg5j$jg3$1@lublin.zrz.tu-berlin.de>
James A Culp III <admin@futuristic.net> wrote in comp.lang.perl.misc:
> Is there a newsgroup, website, or group of people one can goto for
>critiques of code. I am just beginning to learn perl, and have many style
>based questions that cannot or are not answered in any FAQ, or document that
>I have come across.
>
> I am interested in finding one or more experienced perl programmers
>that would be willing to spend a minimal amount of time (by their
>definition) to peruse code, and answer style and hard-headed newbie
>questions. I would post some of these here but am frankly not anxious to A)
>waste bandwidth for what most would consider silly/stupid questions and B)
>draw flames upon myself for asking silly/stupid questions.
Oh, easy. Just post your code here. Don't ask for critique, though.
Claim it's the optimal solution that can't be improved, no way, noho, sir.
Serious answer: You can get that here if you observe a few points.
- Post a self-contained script, that demonstrates your solution to
a single problem. Usually that means not to dump to the newsgroup
a script as it exists on your machine. Isolate a salient point,
if possible in just five to ten lines, but then make it self-
contained. If necessary, include data using the __DATA__ construct.
- Start your script with the lines
#!/your/path/to/perl -w
use strict;
Note the -w at the end of the first line. People are much more
inclined to take a closer look if your script compiles and gives
no warnings with these two restrictions. Also, if you have to
open files, always check for success, as in
open( IN, $file) or die "Can't read $file: $!\n";
If you observe these points, you have avoided the three most
frequent reasons for people to dismiss your code as inadequate
without even bothering to look closer.
- Be sure your question is a Perl question. This group is not
about HTML, or CGI, or Databases. Asking questions about
one of the above is another common reason why posters receive
errmmm... unsatisfactory replies in this group.
- Be sure your question isn't answered in the documentation that
comes with Perl. You access this with the perldoc command, which
is also included in any recent Perl installation. In particular,
you can read about all Perl functions if you issue the command
perldoc -f <function-name>
The documentation also includes the FAQ list. This is accessed
by
perldoc -q <keyword>
, which scans all the questions for the given keyword and displays
the answers. Of course, perldoc explains itself more fully if
you type "perldoc perldoc".
Good luck.
Anno
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 V9 Issue 420
*************************************