[11196] in Perl-Users-Digest
Perl-Users Digest, Issue: 4796 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 1 10:07:13 1999
Date: Mon, 1 Feb 99 07:00:25 -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 Mon, 1 Feb 1999 Volume: 8 Number: 4796
Today's topics:
Re: activeperl ppm help nite_eagle@hotmail.com
Re: alternative perl NG for newbies? <staffan@ngb.se>
aWebVisit 0.1.4 - New update for a Web Visit / Session (Michel Dalle)
Bath.pm-ish Meetings <leon@netcraft.com>
Re: Bath.pm-ish Meetings (brian d foy)
Can't compile 5.005_02 under Linux.. <rlaflamm@sscinc.com>
CGI/PERL execution problem, GRAVE <reginel@remnet.fr>
Re: Check if a file is open <tchrist@mox.perl.com>
Re: Comments in Perl code <tchrist@mox.perl.com>
Re: Comments in Perl code (Bart Lateur)
Help! Problem searching for data in a large text file . <cbowring@softwareparadise.co.uk>
Re: Help! Problem searching for data in a large text fi <jdf@pobox.com>
Re: How do I define and use typedef in perl? <tchrist@mox.perl.com>
Re: How to do query in a list? (William D. Reardon)
I need a good working environment for PERL <c-denman@dircon.co.uk>
Re: Match first character of string? (Tad McClellan)
Re: Need Tutorial (Randal L. Schwartz)
Re: Need Tutorial (brian d foy)
Re: Need Tutorial (Bart Lateur)
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Regexp problem [possible] (Tad McClellan)
Re: Soft reference question (Larry Rosler)
Re: Soft reference question <jdf@pobox.com>
Re: Stopping a foreach loop droby@copyright.com
Re: Sys::Syslog trouble... <bas@yournews.nl>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 01 Feb 1999 14:18:37 GMT
From: nite_eagle@hotmail.com
Subject: Re: activeperl ppm help
Message-Id: <794d3n$trn$1@nnrp1.dejanews.com>
Point you browser to http://www.activestate.com/packages/zips/
You download zipped modules, follow directions in the readme.
In article <36B2C85E.4421@swbell.net>,
Edward Perry <emperry@swbell.net> wrote:
> I just downloaded and install activeperl 509,
> connect to net, run ppm.bat, enter search, and
> get nothing. Is it just me or is ppm hosed?
> Any other recommends for installing Tk module?
>
> Thanks
>
> EdVenture
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 01 Feb 1999 14:21:15 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: alternative perl NG for newbies?
Message-Id: <36B5AA4B.B61C9517@ngb.se>
23_skidoo wrote:
> no one
> would _have_ to use it, perhaps no one would but it would give a more
> helpful direction for the busy people to point rather than 'rtfm' or
> references to 'perlfunc, perlfaq4, and perlre manuals'.
Well, I think that these responses are not in anyway inpolite or
unhelpful -- actually, they are often more helpful than an explicit
explanation of how to do it. Why? Because an explicit explanation
containing the actual code could easily be used to just insert the code
into the program, without understanding it, whereas a pointer to a faq
or a manual is saying "You can find how to do this by reading this
document".
Note that many of these replies contain _detailed_ pointers to the faqs
or manuals, ie "Check faq7 under ..." or "perldoc perlre". Maybe
replying in this fashion is humbly stating that you are unable to say
anything better in the matter than is said in the documentation, an
assumption which is not too unlikely.
The Faqs are usually more well written than anything you could wipp up
as a response to a question in a newsgroup -- after all, that's what
they are for. And the manuals are well written and contain plenty of
examples. If you don't understand the answers in the faq or the examples
in the manuals, you should probably read a basic book on programming in
general or on programming on perl in particular.
If there is probable cause to believe that a person asking a question
hasn't even looked in the faqs or manuals before asking the question,
then that's a good reason to believe that the person is too lazy to read
and properly understand any reply one would give.
To learn a programming language it is vital to learn to read the
documentation, and unless one at least tries, one cannot expect to
learn. The advice to read the manuals and faqs is advice on what is the
best way to learn about a specific topic. It isn't about the author of
the reply being lazy, or about not respecting the person who asks the
question and not being interested in whether this person finds the
answer or not.
But there is one more matter: If people DO reply to questions that are
answered in the FAQ and/or the manuals, without pointing this out, it is
an invitation to people, stating: Be lazy, don't learn, don't try, don't
read the manuals. Come here, and we'll write your programs for you, and
you can take credit for them. This is not what this newsgroup (or,
hopefully, any newsgroup) is for.
Newbies DO ask important and interesting questions, and when they post
enough code for people to be able to find the problem, people DO help
them out. But when newbies ask uninteresting questions which are well
documented, they will have to swallow their pride when someone tells
them so, especially if this person guides them toward the solution of
the problem.
On the other hand there's nothing to stop you from creating a
clp.newbies.
Staffan
PS: RTFM doesn't mean "READ THE FUCKING MANUALS YOU STUPID NEWBIE, AND
DON'T COME BACK UNTIL YOU HAVE MEMORIZED THEM". It means "If you'd care
to look in the manuals at the place specified, you'd find the answer to
the question you've asked, and to many more like it". I don't find this
inpolite or unhelpful, do you?
------------------------------
Date: Mon, 01 Feb 1999 12:12:41 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: aWebVisit 0.1.4 - New update for a Web Visit / Session Analyser
Message-Id: <36b599de.2252834@news.mch.sni.de>
Hi,
thanks to the 450+ people who had a look at my previous version(s). If
you're happy (or unhappy), please drop me a note...
Finally, version 0.1.4 of aWebVisit is released at :
http://gallery.uunet.be/Michel.Dalle/awv.html.
Changes include :
- separation of internal links into incoming, internal, outgoing and
'in&out'
links
- some status code information
- basic entry and exit trees
For those who don't know what aWebVisit is all about, it analyses WWW
logfiles for visitor information, extracting entry and exit points,
links, duration, time spent per page etc. Only Common Logfile Formats
or Extended/Combined ones are supported (yet), but they are the most
common, so...
Michel.
------------------------------
Date: Mon, 01 Feb 1999 12:56:18 +0000
From: Leon Brocard <leon@netcraft.com>
Subject: Bath.pm-ish Meetings
Message-Id: <36B5A472.B9788791@netcraft.com>
Lo all.
In order to kick-start all the Bristol.pm people, and because I'm
still annoyed that they started it just before I was going to start
Bath.pm[1], I'm going to set up weekly unofficial Bath.pm-ish
meetings.
The idea is that if people start turning up, we'll go official.
If not, we'll just be a sub-part of Bristol.pm. Once Bristol.pm
gets going we'll head over there too ;-)
Anyway, it's really just an excuse to go down to the pub and
have a drink and talk about funky stuff.
As self-declared head monger ($monger{Bath}='Leon Brocard') I say
head down to The Hobgoblin in Saint James's Parade, Bath,
every Wednesday from 6pm. I'll be the one with the camel book ;-)
I would give a map, but I can't find a decent online one and
www.bath.co.uk's maps are giving 404's. And hence no website.
Or mailing list. Sorry.
Basically spread the word. I don't expect it to be big yet, so
relax, and see you soon...
Leon
[1] For those not in the know, Bath is not very far indeed from
Bristol. The former is more beautiful, the latter is much bigger..
--
Leon Brocard...............................................Perl Hacker
leon@netcraft.co.uk.........................http://www.netcraft.co.uk/
... Mental Floss prevents Moral Decay.
------------------------------
Date: Mon, 01 Feb 1999 09:07:15 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Bath.pm-ish Meetings
Message-Id: <comdog-ya02408000R0102990907150001@news.panix.com>
In article <36B5A472.B9788791@netcraft.com>, Leon Brocard <leon@netcraft.com> posted:
> In order to kick-start all the Bristol.pm people, and because I'm
> still annoyed that they started it just before I was going to start
> Bath.pm[1],
now, just how many groups do you plan on starting? ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 1 Feb 1999 08:43:08 -0500
From: "Bob Laflamme" <rlaflamm@sscinc.com>
Subject: Can't compile 5.005_02 under Linux..
Message-Id: <794ban$og6$1@client2.news.psi.net>
I'm using Caldera OpenLinux and I can't compile version 5.005_02.
The OS version is 2.0.25 and has not been patched at all.
The Configure process reports finding a bunch of shared libraries, gdbm, c,
etc.. which are all in /usr/lib.
When the try.c program is compiled to test the compiler, the linker reports
that it cannot find -lgdbm and the system crashes.
I've tried all kinds of switches, looked at all the man pages for both gcc
and ld, to no avail.
Can someone shed some light on this for me?
Thank you in advance,
bob laflamme
------------------------------
Date: Mon, 1 Feb 1999 15:52:57 +0100
From: "Rigine Leconte" <reginel@remnet.fr>
Subject: CGI/PERL execution problem, GRAVE
Message-Id: <794etg$r26$1@minus.oleane.net>
Apache send me :
"Premature end of script Header"
when i trie to execute a script cgi whith PERL
My configuration :
Version de PERL :
=================
This is perl, version 5.004_01
Apache/1.3.2
Linux
CGI/1.1
HTTP/1.0
Files permissions : 755
Can you help me.
Thanks .
------------------------------
Date: 1 Feb 1999 07:36:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Check if a file is open
Message-Id: <36b5bbe0@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Dan Albertsson" <dan@albertsson.com> writes:
:In a multiuser environment you can create a lock file when you want to
:avoid simultaneous update of a file and check that the lock file does not
:exist before you open the file you want to update.
That's the wrong approach -- you open yourself up to a race condition.
Remember that creating and unlinking files is not atomic over NFS.
:Is it instead possible to directly see if the file you are opening is
:already opened by another user?
Not portably.
:PS. Can someone recomend reading of locking techniques in multiuser
:environments.
Normally, you just use flock(). The Perl Cookbook shows many examples
of using this, as well as an example of using fcntl and another that uses
stateful directory-based locking.
--tom
--
"Software Engineers are like economists." --Rob Pike
------------------------------
Date: 1 Feb 1999 06:19:28 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Comments in Perl code
Message-Id: <36b5a9e0@csnews>
In comp.lang.perl.misc, springnr@home*com writes:
:Do comments in codes slow down there processing? And if so, how much?
That question has several answers, and I could answer either way depending
on what you meant. If you hadn't screwed up your address, I could have
asked for clarification privately. Pity, that.
--tom
--
last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
That's gonna be tough for Randal to beat... :-)
--Larry Wall in <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: Mon, 01 Feb 1999 13:48:33 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Comments in Perl code
Message-Id: <36bbb01b.22995999@news.skynet.be>
BloodStone wrote:
>Do comments in codes slow down there processing? And if so, how much?
I've been wondering about this a bit myself, today. I'd expect a
one-time SLIGHT slowdown, mainly due to the reading in of the source
file, which got a bit bigger, thus took longer to read.
I also wonder if the extensive use of lots of (tiny) modules wouldn't
have a worse effect (exporter, autoload, ...).
Bart.
------------------------------
Date: Mon, 1 Feb 1999 13:45:14 -0000
From: "Chris Bowring" <cbowring@softwareparadise.co.uk>
Subject: Help! Problem searching for data in a large text file ..
Message-Id: <917876756.23948.0.nnrp-06.c2ded70a@news.demon.co.uk>
To whoever can help.....
We are new to writing software in perl and have written an online catalog
program which allows users/visitors to search for data in a fairly large
sorted text file containing some 5000 line entries. It all works fine but we
are getting constant complaints from the ISP hosting our site because of the
time it takes for a wildcard/wordsanywhere sequential search to be performed
on the file by multiple visitors to our site. (Understandable really)
Can anyone suggest how we could reorganise the file and/or implement some
better/more efficient searching techniques to appease our ISP before thery
shut us down?
Are there any perl sites we could visit for tips or freeware code?
Any help would be appreciated
Thanks so much
Chris Bowring & Phil Brewer.
------------------------------
Date: 01 Feb 1999 15:29:20 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Chris Bowring" <cbowring@softwareparadise.co.uk>
Subject: Re: Help! Problem searching for data in a large text file ..
Message-Id: <m3zp6yxkn3.fsf@joshua.panix.com>
"Chris Bowring" <cbowring@softwareparadise.co.uk> writes:
> Can anyone suggest how we could reorganise the file and/or implement
> some better/more efficient searching techniques to appease our ISP
> before thery shut us down?
You should index the file and search the index. A discussion of how
to do so is beyond the limited scope of this group. If your ISP's OS
supports it, you might try Glimpse, available at
http://glimpse.cs.arizona.edu/ .
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 1 Feb 1999 05:10:15 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do I define and use typedef in perl?
Message-Id: <36b599a7@csnews>
You don't. And you don't post one message twice, especially when you
can't be replied too using that lame address mutilation. If it weren't
for that, maybe I would have told you why you asked the wrong question.
--tom
--
"That government is best which governs least."
--Thomas Jefferson
------------------------------
Date: Mon, 1 Feb 1999 14:36:21 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: How to do query in a list?
Message-Id: <F6HCKL.KL3@midway.uchicago.edu>
In article <36B4170B.11567309@hp.com>, Pep Mico <pep_mico@hp.com> wrote:
>Hello,
>
>I'd like to know what is the best way to ask if some string is included
>in a list. This is the case.
>
>I have a list of 100 computers in a text file, and I want to check if
>the existence of a computer name on this list.
>
>Actually I've loaded this list into an "array" and I'm looking each
>field of this array to check for the existence of one computer.
>
>I want to find a better and efficient way to do this step.
If all your script is doing is checking for to see if the computer is
present, there is no point loading everything into a hash file, or
even necessarily reading the whole file:
#!/usr/local/bin/perl -w
$file = "computers.txt";
$computer = shift;
open(F, $file) || die("Couldn't open $file: $!);
while (<F>) {
die("Found $computer") if ($_ eq $computer);
}
print "$computer not found", "\n";
You may have to change things around a bit based upon how your data is
stored, but that's the general idea.
If you are reading it for other reasons, and lookups will be a
frequent action, a hash is probably the way to go.
If you have to keep things in a list for other reasons, you can use a
for loop (which it sounds like you're using now) or 'grep':
grep {$computer eq $_}, @computers;
Which is better will depend upon how likely it is that the element exists.
HTH,
-Bill
--
William Reardon ---- http://www.nhma.com/~wdr1/ ---- wdr1@pobox.com
It takes 41 muscles to frown, but only 4 to pull a trigger.
------------------------------
Date: Mon, 1 Feb 1999 14:07:23 -0000
From: "Chris Denman" <c-denman@dircon.co.uk>
Subject: I need a good working environment for PERL
Message-Id: <794c9h$gg8$1@starburst.uk.insnet.net>
Anyone know of a good GUI for perl? I have found a few, but none of them
seem to have a good way of testing perl in a real-world browser environment.
What I mean is, it would be good to be able to run, and trace through perl
in a snazzy GUI, have all the variables showing, and...... (oh, yea, all off
line - athough I have apache running locally)
I am asking a lot, I was just asking in case!
Chris D
------------------------------
Date: Mon, 1 Feb 1999 07:44:23 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Match first character of string?
Message-Id: <n3b497.5l.ln@magna.metronet.com>
Delphine Coupal (delphine@qx.net) wrote:
: What's the easiest way to match the first non-space character of
: a string?
The easiest way to do any Frequently Asked Question is to
look it up in the Perl FAQ list.
You are expected to see if your Question has been Asked
Frequently *before* posting!
: What I'm trying to do is capitalize the first word in a
: sentence..
Perl FAQ, part
"How do I capitalize all the words on one line?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 01 Feb 1999 05:10:37 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Need Tutorial
Message-Id: <m1emoai81e.fsf@halfdome.holdit.com>
>>>>> "the" == the Tupper's <ktupper1@maine.rr.com> writes:
the> Can any good programmers out there tell me what they used to
the> learn perl. If you used any tutorials off the net just post the
the> address. I don't really want to buy a $70 book so don't bother
the> giving me titles to books unless it is absolutely the best thing
the> you could ever get.
Last time I looked, "Learning Perl" was less than half of that. :)
print "Just another Perl [book] hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 01 Feb 1999 09:05:06 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Need Tutorial
Message-Id: <comdog-ya02408000R0102990905060001@news.panix.com>
In article <m1emoai81e.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) posted:
> >>>>> "the" == the Tupper's <ktupper1@maine.rr.com> writes:
>
> the> Can any good programmers out there tell me what they used to
> the> learn perl. If you used any tutorials off the net just post the
> the> address. I don't really want to buy a $70 book so don't bother
> the> giving me titles to books unless it is absolutely the best thing
> the> you could ever get.
>
> Last time I looked, "Learning Perl" was less than half of that. :)
and it's absolutely the best thing you could ever get.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 01 Feb 1999 13:50:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Need Tutorial
Message-Id: <36bcb0ae.23142868@news.skynet.be>
Randal L. Schwartz wrote:
>the> I don't really want to buy a $70 book so don't bother
>the> giving me titles to books unless it is absolutely the best thing
>the> you could ever get.
>
>Last time I looked, "Learning Perl" was less than half of that. :)
It depends on where you are. *Sniff*. Computer books and magazines are
about twice as expensive here in Europe, than they are in the USA.
Bart.
------------------------------
Date: 1 Feb 1999 12:27:33 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7bb7dl.par.dformosa@godzilla.zeta.org.au>
In article <793ibn$8mq$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <slrn7b2rg5.fpl.dformosa@godzilla.zeta.org.au>,
> dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
[...]
>> But if there useable as boolean short cuts then they will be used as
>> condistionals.
>
>
>Its tougher to do if a language has strict boolean types.
I used to do it in my pascal days, which have strict boolean types.
On the other hand my binary tree structure was a work of pure
something. I used an array with a boolean range so a search was
(pydocode)
while (node->key != target)
node = node->child[node->key > target]
endwhile
To avoid the use of an ifthen stament and needless repeatition of code.
[...]
>Further, many languages must have an assigment statement
>in order to have a boolean expression:
>
> something = this or that;
>
>They would not allow for:
>
> this or that;
>
>as a single statement. Thus, it does not save keystrokes
>over a good 'if' design.
s=
is quicker then creating a whole ifthen block.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
------------------------------
Date: Mon, 1 Feb 1999 07:59:50 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regexp problem [possible]
Message-Id: <m0c497.5l.ln@magna.metronet.com>
hdiwan@diwanh.stu.rpi.edu wrote:
: I have undertaken developing an intranet search engine. To map out the files, I
: have chosen to use a series of perl scripts. The format of the file is:
: Interesting ports on resnet-####.dynamic.rpi.edu (128.113.1##.###)
: Port State Protocol Service
: 139 filtered tcp netbios-ssn
: I would like to extract the IP address
# all untested
print "$1\n" if /(\d+\.\d+\.\d+\.\d+)/; # "looks like" an IP
or
print "$1\n" if /(\d{3}\.\d{3}\.\d{3}\.\d{3})/; # "looks even
# more like" an IP
or
print "$1\n" if /\(([^)]+)\)/; # is in parens
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 1 Feb 1999 04:23:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Soft reference question
Message-Id: <MPG.111f3caf180f140c9899ec@nntp.hpl.hp.com>
In article <36b582b6.4439589@news.jet.es> on Mon, 01 Feb 1999 10:35:07
GMT, Louie <louie@visca.com> says...
...
+ #!/usr/local/bin/perl -w
+ use CGI;
+ my $q = new CGI;
+
+ my $upload = $q->param('upload');
+ my $upload_dir = '/www/test';
+ (my $filename = $upload) =~ s/^.*?([^\\\/]+)$/$1/;
+ my $updir = "$upload_dir/$filename";
+
+ open (UPLOAD, ">$updir") or die $!;
+ my ($Buffer);
+ while (read($upload,$Buffer,8192)) {
Your error is in the line above. The first argument to 'read' is
supposed to be the filehandle for the file you are reading. But you
have not opened such a file. $upload is a string, not a filehandle.
+ print UPLOAD $Buffer;
+ }
+ close UPLOAD or die $!;
+
+ print "Content-type: text/html\n\n";
+ print qq~Upload successfully concluded.~;
+
+ If I try to use strict with this script, I get an error saying soft
+ references aren't allowed with strict on. I've read the perlref man
+ pages and chapter 4 in Programming Perl (also the refs to soft
+ references in Effective Perl Programming), but I still don't
+ understand where my soft reference is in this script. (The error
+ message says "line 20", which is the "close UPLOAD or die $!;" line.)
Well, no, it isn't -- not if the code you posted (which has only 18
lines by my count, or 19 if you add in the 'use strict;' line) is the
same as the code you ran.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 01 Feb 1999 15:13:32 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: louie@visca.com
Subject: Re: Soft reference question
Message-Id: <m33e4qyzxv.fsf@joshua.panix.com>
louie@visca.com (Louie) writes:
> open (UPLOAD, ">$updir") or die $!;
> my ($Buffer);
> while (read($upload,$Buffer,8192)) {
> If I try to use strict with this script, I get an error saying soft
> references aren't allowed with strict on.
read() takes a FILEHANDLE as its first argument. Since $upload is not
a filehandle, Perl treats it as the *name* of a filehandle. Try
read(UPLOAD, ...
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 01 Feb 1999 13:33:53 GMT
From: droby@copyright.com
Subject: Re: Stopping a foreach loop
Message-Id: <794ag1$rkn$1@nnrp1.dejanews.com>
In article <78ss5h$1e5$1@pegasus.csx.cam.ac.uk>,
mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
> In article <78sp56$p9k$1@nnrp1.dejanews.com>, <droby@copyright.com> wrote:
> >
> >system("kill -KILL $$");
>
> That's an inappropriate use of "system".
>
> kill 'KILL', $$;
>
> is *much* more efficient. :-)
>
> Mike Guy
>
Learn something new every day. I hadn't dealt with kill yet. Now I know,
I suspect these methods of stopping loops aren't real portable though.
;-)
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 01 Feb 1999 13:10:10 +0100
From: "Bas A. Schulte" <bas@yournews.nl>
Subject: Re: Sys::Syslog trouble...
Message-Id: <36B599A2.D48F44E8@yournews.nl>
Wyatt,
> The program executed without any
> problems, but no output was sent to syslog
This one got me too. This is probably the same problem; your syslogd
isn't set up to handle syslog messages over a tcp/ip socket. You can do
two things:
1. start syslogd with -r (this way, it will accept syslog messages over
a tcp/ip socket);
or
2. Do this somewhere at the start of your program:
Sys::Syslog::setlogsock("unix");
This way, a unix socket will be used instead of a tcp/ip socket.
Regards,
Bas.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4796
**************************************