[12940] in Perl-Users-Digest
Perl-Users Digest, Issue: 350 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 13:17:28 1999
Date: Tue, 3 Aug 1999 10:05:16 -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 Tue, 3 Aug 1999 Volume: 9 Number: 350
Today's topics:
Re: $/ for cross platform text files? rlw_ctx@my-deja.com
*Yet another* Net::FTP question <ralawrence@my-deja.com>
Re: [offtopic]RE:Quot St and the Jeop Gm llornkcor@my-deja.com
Re: [offtopic]RE:Quot St and the Jeop Gm llornkcor@my-deja.com
Re: [offtopic]RE:Quot St and the Jeop Gm (Anno Siegel)
anyone have a copy of SWIG <jcetek@ezzi.net>
Re: anyone have a copy of SWIG (Cameron Laird)
Re: Escaping out of prompts.. <aqumsieh@matrox.com>
Getting Date from HTTP::Response maxime69@my-deja.com
Re: Help Please <chris.wilkinson@jacobsrimell.com>
Re: Help Please <marshalc@americasm01.nt.com>
Re: Help Please (Jon Bell)
Re: Help Please (Randal L. Schwartz)
Re: Help Please <sariq@texas.net>
How can I trap/block a kill -9 signal <fungs@logica.com>
Re: How can I trap/block a kill -9 signal (Malcolm Ray)
Re: How can I trap/block a kill -9 signal (Mike Bristow)
How? <rho@hns.com>
Re: How? (Mike Bristow)
Re: How? <sariq@texas.net>
Re: Kinda FORK (Kai Henningsen)
Lazy people [Was: Re: [was]Re: reg expression] <dankogai@dan.co.jp>
Re: Quoting Strategies and the Jeopardy Game (Jon Bell)
Re: Quoting Strategies and the Jeopardy Game <tchrist@mox.perl.com>
Re: Reading group of files as One ? (Anno Siegel)
Re: reg.expressions: replace a substring ??? (Bart Lateur)
Re: reg.expressions: replace a substring ??? (Larry Rosler)
Re: to Andreas <gellyfish@gellyfish.com>
UDP sockets question mmohr@my-deja.com
Re: Use of uninitialized value .... (Laura Bello)
Re: using __PACKAGE__ (Bart Lateur)
Re: What's a good database module to use? (Jon Bell)
Re: Why no Perl books at Fry's? (Brent A Ellingson)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 03 Aug 1999 16:18:57 GMT
From: rlw_ctx@my-deja.com
To: rolf@parallax.co.uk
Subject: Re: $/ for cross platform text files?
Message-Id: <7o74p4$n08$1@nnrp1.deja.com>
In article <37A16DE2.978D363A@parallax.co.uk>,
Rolf Howarth <rolf@parallax.co.uk> wrote:
> What's the easiest way to process a text file a line at a time if you
> don't know in advance whether it's DOS (\r\n), Unix (\n) or Macintosh
> (\r) format?
Assuming that line lengths are reasonable (you have to
decide what's reasonable), and given that you imply
that the files are large-to-huge, the most efficient
way to read the files would be to read a buffer full
(say 2 times the expected "reasonable" line length)
and look for the line terminators. Once identified,
set $/ accordingly.
In theory, some kind of mode flag and some extra logic
could be added to Perl's read line internal routine to
automatically handle \n vs \r vs \r\n - something like:
if (input_record_separator < 0) {
/* "magic" IRS handling */
if (buf[buf_pos] == '\015') {
buf_pos++;
if (buf[buf_pos] == '\012') {
buf_pos++;
}
user_buf[user_pos] = 0;
return(user_pos);
} else if (buf[buf_pos] == '\012') {
user_buf[user_pos] = 0;
return(user_pos);
}
} else {
/* standard Perl IRS handling */
}
--
Ron Wilson
Connectex, LLC
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 03 Aug 1999 15:58:06 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: *Yet another* Net::FTP question
Message-Id: <7o73i7$m29$1@nnrp1.deja.com>
Hello there!
I'm trying to use Net::FTP to download a file automatically and so far
everything is working fine. Problem is that some of the sites are on a
different port number so I need to get the code to cope with this. In
the documentation it says:
new (HOST [,OPTIONS])
This is the constructor for a new Net::FTP object. HOST is the name of
the remote host to which a FTP connection is required. OPTIONS are
passed in a hash like fashion, using key and value pairs. Possible
options are: Firewall, Port, Timeout, Debug and Passive.
So I tried this:
#!/usr/bin/perl -w
use strict;
use Net::FTP;
my @options;
$options{"Port"} = 99;
my $ftp = Net::FTP->new("somewhere.org", @options);
$ftp->login("anonymous","me\@here.there");
$ftp->cwd("/pub");
$ftp->get("intercom");
$ftp->quit;
assuming that it would fail becase the server i'm testing it on doesn't
run FTP on port 99. Well it still worked so I can only assume that I'm
not setting the port thing correctly.
Can anyone point me in the right direction for setting this and hence I
can also then set the timeout option?
Thanks
Rich
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 03 Aug 1999 16:24:58 GMT
From: llornkcor@my-deja.com
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <7o754c$nc8$1@nnrp1.deja.com>
All I am trying to do, is to get those *perl-programmers* to have some
compassion when replying. I could care LESS who wrote WHAT book. Get
off your high horses. Please
In article <37A6F4C9.F2E04A92@texas.net>,
Tom Briles <sariq@texas.net> wrote:
> llornkcor@my-deja.com wrote:
> >
> [various whining about being told the rules]
>
> The reason that you will get very few responses to this message is
that
> everyone who is anyone (in the Perl world) has killfiled you.
>
> That means:
> If you ever ask a Perl question through this forum, the answer will be
> *very* suspect.
>
> It never ceases to amaze me how clueless newbies (yes, we were all
> newbies at one time, but some were not clueless) alienate the very
> people who could be of most benefit to them.
>
> Do you know to whom you replied? Are you at all familiar with
> Programming Perl, The Perl Cookbook, etc.?
>
> TomC is not out to get you...he's just trying to keep this forum in
some
> semblance of order.
>
> So grow up.
>
> *plonk*
>
> - Tom (with an uppercase T)
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 03 Aug 1999 16:26:04 GMT
From: llornkcor@my-deja.com
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <7o756d$ne4$1@nnrp1.deja.com>
oh, I did read it..
In article <N6Bp3.169$%25.936@news1.online.no>,
"Trond Michelsen" <mike@crusaders.no> wrote:
>
> > In article <37a633ad@cs.colorado.edu>,
> > tchrist@mox.perl.com (Tom Christiansen) wrote:
> > > The following message will be posted periodically until observed
> > > clue-levels in these parts improve, or until the heat death of the
> > > Universe arrives.
>
> <llornkcor@my-deja.com> wrote in message news:7o5ure$s99
$1@nnrp1.deja.com...
> > From Webster's Revised Unabridged Dictionary (1913) (web1913)
> > >>>>***This is the important part, Tom...***<<<<
> > NOTE: Often used ironically, implying an assumption of
superiority.
>
> uhm - the message may very well have been condescending, but you
should've
> read it.
>
> --
> Trond Michelsen
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 3 Aug 1999 16:41:12 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <7o7638$ajl$1@lublin.zrz.tu-berlin.de>
<llornkcor@my-deja.com> wrote in comp.lang.perl.misc:
>All I am trying to do, is to get those *perl-programmers* to have some
>compassion when replying. I could care LESS who wrote WHAT book. Get
>off your high horses. Please
*plonk*
------------------------------
Date: Tue, 3 Aug 1999 11:30:09 -0400
From: "ezzi" <jcetek@ezzi.net>
Subject: anyone have a copy of SWIG
Message-Id: <7UDp3.231$Bl2.25519@typ12.nn.bcandid.com>
hi
do's anyone have a copy of Dave Beazley's SWIG.
http://www.cs.utah.edu/~beazley/SWIG do's not work.
------------------------------
Date: 3 Aug 1999 15:56:38 GMT
From: claird@starbase.neosoft.com (Cameron Laird)
Subject: Re: anyone have a copy of SWIG
Message-Id: <C744FF749979F74B.1B28B1DEEDAA876F.1BA94E53D866F6DF@lp.airnews.net>
In article <7UDp3.231$Bl2.25519@typ12.nn.bcandid.com>,
ezzi <jcetek@ezzi.net> wrote:
>hi
>do's anyone have a copy of Dave Beazley's SWIG.
>http://www.cs.utah.edu/~beazley/SWIG do's not work.
>
>
Start with <URL:http://www.swig.org/>.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Tue, 3 Aug 1999 10:56:55 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Escaping out of prompts..
Message-Id: <x3y672wewuh.fsf@tigre.matrox.com>
Mitch <portboy@home.com> writes:
> How can I setup CTRL-D (or some other hotkey) to kill out of these
> prompts, and return back to my scripts prompt?
Check out the documentation on %SIG in perlvar. I would go with
$SIG{INT}, which traps CTRL-C events ..
HTH,
Ala
------------------------------
Date: Tue, 03 Aug 1999 15:55:13 GMT
From: maxime69@my-deja.com
Subject: Getting Date from HTTP::Response
Message-Id: <7o73cr$m0s$1@nnrp1.deja.com>
In order to get Date value of HTTP::Response I do
$request = new HTTP::Request 'GET', 'http//.....';
$header = new HTTP::Headers;
$response = $UserAgent->request($request, $header);
print "Date is ", $header->date(time), "\n";
Here I have use of uninitialized value
Someone of you knows the mistake ?
Thank you in advance
Max
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 03 Aug 1999 16:14:02 +0100
From: Chris Wilkinson <chris.wilkinson@jacobsrimell.com>
Subject: Re: Help Please
Message-Id: <37A7073A.47E5DF74@jacobsrimell.com>
Andreas Fehr wrote:
>
>
> Not very patient, 2.75 hours and no response. During this two hours I
> went out, bought a book on Perl and read about STDIN and STDOUT.
> Now, I could give you some answer :) (but it sill might be wrong, so
> try to find something about STDIN and STDOUT in your documentation).
>
I have just discovered this thanks to someone e-mailing me, and I now have it
working, the only other problem is that the password when entered is visble
rather than a series of ******. I think my main problem is that I am not and
never will be a programmer.
> <snip about newsgroup>
>
> There have been several threads about this.
>
> Andreas
My that is a surprise ;-)
Chris
------------------------------
Date: Tue, 03 Aug 1999 10:24:24 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Help Please
Message-Id: <37A709A8.E87498EF@americasm01.nt.com>
Chris Wilkinson wrote:
> print GETF "set ssuser=cwilkinson\n";
> print GETF "set sspwd=cwilkinson\n";
>
> This is the username and password for an application where the scripts
> needs to get some data from. Now what I want to do is to be able to
> prompt for a username and then a password instead of having it hardcoded
> into the script
>
This is really easier than you think! =) All you really need to do is
something like:
print "Username: ";
chop($user=<STDIN>);
print "Password: ";
chop($pw=<STDIN>);
print GETF "set ssuser=$user\n";
print GETF set sspwd=$pw\n";
That prompts for Username and Password (waits for the enter key), sorry for
the delayed post, it's been a bad morning.
~Marshall
--
sub _{pack('c',hex(@_->[0]))};print x4a->main::_.x75->main::_.x73->main::_.x74->main::_.x20->main::_.x41->main::_.x6e->main::_.x6f->main::_.x74->main::_.x68->main::_.x65->main::_.x72->main::_.x20->main::_.x50->main::_.x65->main::_.x72->main::_.x6c->main::_.x20->main::_.x48->main::_.x61->main::_.x63->main::_.x6b->main::_.x65->main::_.x72->main::_."\n"
------------------------------
Date: Tue, 3 Aug 1999 15:07:56 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Help Please
Message-Id: <FFwA18.C7K@presby.edu>
Chris Wilkinson <chris.wilkinson@jacobsrimell.com> wrote:
>Before anyone starts getting annoyed at me for replying to my own post, I
>may be new to Perl but im not new to Usenet and know that some people get
>rather anal about it all.
>Seeing no-one has answered my request for help I will presume that my
>problem is too trivial for people to bother about.
No, it's probably because you waited only TWO HOURS AND FORTY-FIVE MINUTES
for an answer. Usenet isn't instantaneous, as you should know since
you're not new to Usenet. Sheez...
--
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: 03 Aug 1999 09:00:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Help Please
Message-Id: <m1672w26ro.fsf@halfdome.holdit.com>
>>>>> "Chris" == Chris Wilkinson <chris.wilkinson@jacobsrimell.com> writes:
Chris> Before anyone starts getting annoyed at me for replying to my
Chris> own post, I may be new to Perl but im not new to Usenet and
Chris> know that some people get rather anal about it all.
Chris> Seeing no-one has answered my request for help I will presume
Chris> that my problem is too trivial for people to bother about.
You expect an answer to a Usenet posting within two hours?
Perhaps your understanding of Usenet needs to be adjusted. Get thee
to news.announce.newusers and read. You say you're not new to Usenet...
I now question that. :)
Now, the answer to your Perl question is that you need a basic text on
Perl, and then to start reading it. I'd recommend a basic text, but
some people would probably think I'm biased because I had something to
do with the writing of it. :)
Newbies *are* welcome here. We do expect the newbies to *not* treat
this as a 1-800 HelpDesk though, but to have come here having at least
read the basic documentation, or be willing to be told where to go
back into the basic documentation. And to respect that each question
posted consumes the time of the volunteers that come here to share
experience.
Don't think of it as a Help Desk, but more of a User Group meeting.
Most people wouldn't dare ask the kind of basic questions at a User
Group meeting. Imagine going into a "honda owners club" meeting and
asking "hey, how do I make the thing turn left?". That's what it
sounds like to us sometime. For that, you need driving school or a
basic manual.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 03 Aug 1999 11:26:51 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Help Please
Message-Id: <37A7184B.96123E0D@texas.net>
Randal L. Schwartz wrote:
>
> >>>>> "Chris" == Chris Wilkinson <chris.wilkinson@jacobsrimell.com> writes:
>
> Chris> Seeing no-one has answered my request for help I will presume
> Chris> that my problem is too trivial for people to bother about.
>
> Now, the answer to your Perl question is that you need a basic text on
> Perl, and then to start reading it. I'd recommend a basic text, but
> some people would probably think I'm biased because I had something to
> do with the writing of it. :)
From someone with objectivity...
_Learning Perl_ by (surprise) Randal L. Schwartz
Buy it, read it, live it.
Then move on to:
_Programming Perl_ by Larry Wall, Tom Christiansen, & (surprise) Randal
L. Schwartz
Buy it, read it, read it again, keep it close.
- Tom
------------------------------
Date: Tue, 3 Aug 1999 10:30:01 +0100
From: "Ming" <fungs@logica.com>
Subject: How can I trap/block a kill -9 signal
Message-Id: <7o6cqr$k3b@romeo.logica.co.uk>
Hello all
Does anyone out there know how to trap/ignore a 'kill -9' signal for a Perl
process.
Cheers
------------------------------
Date: 3 Aug 1999 16:21:46 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: How can I trap/block a kill -9 signal
Message-Id: <slrn7qe5oq.vkm.M.Ray@carlova.ulcc.ac.uk>
On Tue, 3 Aug 1999 10:30:01 +0100, Ming <fungs@logica.com> wrote:
>Hello all
>
>Does anyone out there know how to trap/ignore a 'kill -9' signal for a Perl
>process.
>
>Cheers
If you're talking about Unix, or a system with Unix-like signal
semantics, you can't. SIGKILL is uncatchable (this is not a limitation
of the language, it's a kernel matter). This is generally regarded
as a Good Thing.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Tue, 03 Aug 1999 16:33:18 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: How can I trap/block a kill -9 signal
Message-Id: <slrn7qe6ee.bft.mike@lindt.fat.dotat.at>
On Tue, 3 Aug 1999 10:30:01 +0100, Ming <fungs@logica.com> wrote:
>Hello all
>
>Does anyone out there know how to trap/ignore a 'kill -9' signal for a Perl
>process.
``-9'' is unportable; signals have a name for a reason.
Assuming you mean SIGKILL (which is what -9 is on Solaris, Linux, Irix,
and freebeard) then: you can't, in any language.
--
Mike Bristow, Geek-At-Large. GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!
------------------------------
Date: Tue, 03 Aug 1999 12:18:32 -0400
From: Robert Ho <rho@hns.com>
Subject: How?
Message-Id: <37A71658.C3C00073@hns.com>
I have a file which contains expressions: "(contents", and
"(contents)"
I want to substitute "(contents)" with a blank space but I'm finding
it's not
so easy due to the parentheses. Can someone help me with a perl trick?
--
Robert Ho rho@hns.com
------------------------------
Date: Tue, 03 Aug 1999 16:37:48 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: How?
Message-Id: <slrn7qe6ms.bft.mike@lindt.fat.dotat.at>
On Tue, 03 Aug 1999 12:18:32 -0400, Robert Ho <rho@hns.com> wrote:
>I have a file which contains expressions: "(contents", and
>"(contents)"
>
>I want to substitute "(contents)" with a blank space but I'm finding
>it's not
>so easy due to the parentheses. Can someone help me with a perl trick?
Look at the perlre manpage; in particular the ``Regular Expressions''
section.
If you don't understand the man page - which is writ better than wot
I can do - please get back to us with the code that doesn't work,
explaining why you thought it would do what you wanted and why you
think it didn't.
--
Mike Bristow, Geek-At-Large. GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!
------------------------------
Date: Tue, 03 Aug 1999 11:48:03 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: How?
Message-Id: <37A71D43.78A111C1@texas.net>
Robert Ho wrote:
>
> I want to substitute "(contents)" with a blank space but I'm finding
> it's not
> so easy due to the parentheses.
> --
> Robert Ho rho@hns.com
If I understand your problem,
perlfaq4:
How do I find matching/nesting anything?
- Tom
------------------------------
Date: 03 Aug 1999 15:01:00 +0200
From: kaih=7MBlOOjHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Kinda FORK
Message-Id: <7MBlOOjHw-B@khms.westfalen.de>
mail@netron.de (Mike Eiringhaus) wrote on 21.07.99 in <37961406.DE155986@netron.de>:
> } elsif ($! =~ /No more process/) {
Only do that if you expect to never, ever hit a locale.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Wed, 04 Aug 1999 01:37:42 +0900
From: Dan Kogai <dankogai@dan.co.jp>
Subject: Lazy people [Was: Re: [was]Re: reg expression]
Message-Id: <37A71AD4.6F6F62C4@dan.co.jp>
Abigail wrote:
> .... I don't care for lusers, gimme gimme
> people, script kiddies, lazy people, people who can't even figure out the
> appropriate group to ask their question in, and people who are just plain
> stupid. If you don't like that, RTFM of your newsreader and killfile me.
Agreed except for "lazy people". Isn't laziness one of (and maybe the
foremost of) three virtues? Those who post here w/o checking FAQ are
NOT LAZY because it's much lazier to check'em via perldoc and other ways.
(Well, lazy or not, they definitely lack hubris).
Now the question is; which is lazier way to go? Just ignore
"diligent"
people or tell them to RTF(M|FAQ) ?
Dan the Lazy Camel Rider
------------------------------
Date: Tue, 3 Aug 1999 15:00:42 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Quoting Strategies and the Jeopardy Game
Message-Id: <FFw9p6.BLF@presby.edu>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>I've moved up the cronjob to daily.
Careful... that will send the BI over 20 and subject that posting to the
spamcancelbots.
--
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: 3 Aug 1999 09:36:49 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Quoting Strategies and the Jeopardy Game
Message-Id: <37a70c91@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
jtbell@presby.edu (Jon Bell) writes:
: Tom Christiansen <tchrist@mox.perl.com> wrote:
:>I've moved up the cronjob to daily.
:
:Careful... that will send the BI over 20 and subject that posting to the
:spamcancelbots.
Sigh. Ok, thrice weekly is remains then.
--tom
--
"GUIs normally make it simple to accomplish simple actions and impossible
to accomplish complex actions." --Doug Gwyn (22/Jun/91 in comp.unix.wizards)
------------------------------
Date: 3 Aug 1999 17:04:18 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Reading group of files as One ?
Message-Id: <7o77ei$alb$1@lublin.zrz.tu-berlin.de>
Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
>Steve (itc@cloudnet.com) wrote on MMCLXIII September MCMXCIII in
><URL:news:nxup3.70$H_3.7861@ptah.visi.com>:
>## I tried
>##
>## open(RES, " *.res") or die "Can't open results: $!/n";
>##
>## to read all files ending with .res
>## Obviously this did not work.
>##
>## Is there anyway I can avoid hardcoding the file names in the
>## program and also avoid manually cycling through each
>## file ?
>
>
>glob
...and @ARGV
Anno
------------------------------
Date: Tue, 03 Aug 1999 15:27:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: reg.expressions: replace a substring ???
Message-Id: <37a80981.1955384@news.skynet.be>
Larry Rosler wrote:
> s/repl_me.+?delim/xxxdelim/g;
You can even do
s/repl_me.*?(?=delim)/xxx/g;
I'm not sure why you didi ".+?" instead of ".*?".
Bart.
------------------------------
Date: Tue, 3 Aug 1999 09:38:24 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reg.expressions: replace a substring ???
Message-Id: <MPG.1210badee90d321d989da4@nntp.hpl.hp.com>
In article <37a80981.1955384@news.skynet.be> on Tue, 03 Aug 1999
15:27:27 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Larry Rosler wrote:
>
> > s/repl_me.+?delim/xxxdelim/g;
>
> You can even do
>
> s/repl_me.*?(?=delim)/xxx/g;
Yes -- that has to be better, because of error-free maintainability, if
nothing else.
> I'm not sure why you didi ".+?" instead of ".*?".
You cut that part of my response out:
> ... use '.*?' if 'repl_medelim' should become 'xxxdelim' also.
It depends on the problem specification.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 3 Aug 1999 16:35:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: to Andreas
Message-Id: <37a70c3a_1@newsread3.dircon.co.uk>
Steve <itc@cloudnet.com> wrote:
> Andreas Fehr <backwards.saerdna@srm.hc> wrote in message
> news:37a6dcf2.24729358@news.uniplus.ch...
>> On Tue, 3 Aug 1999 06:55:35 -0500, "Steve" <itc@cloudnet.com> wrote:
>>
>> >
>> >@result = glob("*.*");
>> >while (<*.*>) { statements };
>> >@result = glob("$dir\*.*");
>> >@result = glob("$dir/*.*");
>> >
>> >
>> >--- Bad command or file name
>> >
>>
>> What line gave you the above error message??
>>
>> What do you get if you run:
>> while (<*.*>) { print $_, "\n";}
>>
>> Andreas
>
>
> Hi Andreas,
> I get the message
> "bad command or file name"
> when I run the code you specified.
>
> Any ideas what I'm doing wrong ?
>
You are running an old pre-Activeperl version of Perl on Win32 and for
some reason the glob.exe is missing. Download and install the most
recent from <http://www.activestate.com/activeperl/
Oh and sort out the order that you put your quoted material.
/J\
--
"I'm about to say a naughty word so if you're easily offended you can
fuck off now" - Daisy Donovan, The 11 O'Clock Show
------------------------------
Date: Tue, 03 Aug 1999 15:59:00 GMT
From: mmohr@my-deja.com
Subject: UDP sockets question
Message-Id: <7o73jt$m2i$1@nnrp1.deja.com>
I am trying to develop a server using UDP sockets. The following is the
server code:
#!/usr/bin/perl -w
use strict;
use IO::Socket;
# Variable
declaration and initializationmy $HOST = "colorado";
my $PORT = 9248;
my
$PROTO = "udp";my $sock = "";
my $new_sock = "";
my $buf = "";
$sock =
new IO::Socket::INET ( Proto => $PROTO, LocalAddr => "$HOST:$PORT",
Listen => 1, Reuse => 1
);
die "Socket create failed for host $HOST,
port $PORT: reason: $! " unless $sock;
while ($new_sock = $sock->accept())
{
while (defined ($buf = <$new_sock>)) {
chop($buf); chop($buf);
print
"Received: <$buf>\n"; }
}
close ($sock);
The error message I get when I
run this program is:
IO::Socket::INET: Operation not supported on transport
endpoint at batchman line 14
Any help would be appreciated.
thanks,
mike
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 03 Aug 1999 07:33:00 -0700
From: lrb@aimnet.com (Laura Bello)
Subject: Re: Use of uninitialized value ....
Message-Id: <lrb-0308990733000001@oak-alg-gw4-24.ncal.verio.com>
In article <slrn7qd7ik.vd.asher@localhost.localdomain>,
asher@localhost.localdomain (Asher) wrote:
> >I would get it twice, once each for two files I know don't have a date in
> >the actual document.
> [snip]
> >#--------------------------------------------------------------------
> ># DATE_HTML - extract date from html files
> >#--------------------------------------------------------------------
> >sub date_html {
> > my (@f) = @_;
> > my ($date, $tmp);
> > ($tmp) = grep { /<TD.*>.*, \d{4}/i } @f;
> > if ( defined $tmp ) {
> > ($tmp) = ($tmp =~ m#<TD.*>\s*(.*?, \d{4})#i); # Extract just the date
> > ($date = $tmp) =~ s/<[^>]*>//gs; # Kill any other tags
> > } else {
> > $date = &mod_date("$memdir/$memo");
> Where are $memdir and $memo defined?
At the very beginning of the program. The mod_date sub does successfully
return the correct modification date of "$memdir/$memo".
--
Laura Bello
<mailto:lrb@aimnet.com>
------------------------------
Date: Tue, 03 Aug 1999 15:19:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: using __PACKAGE__
Message-Id: <37a70743.1381308@news.skynet.be>
jschueler@tqis.com wrote:
>Can't use string ("foobar::hello") as a SCALAR ref while "strict refs"
>in use at
> /tmp/hi line 9.
>
>Am I doing something wrong?
Do
no strict refs;
in the block where you use that code.
> print ${__PACKAGE__ . '::hello'};
You may inspect standard Perl modules, and look how they do the import
of variables and subs. Unless they use Exporter. Huh... actually, look
at Exporter.pm, e.g. in the neighbourhood of line 160. It's pretty
interesting. And yes, it is indeed a kludge. :-)
Bart.
------------------------------
Date: Tue, 3 Aug 1999 14:58:15 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: What's a good database module to use?
Message-Id: <FFw9L3.BCt@presby.edu>
Greg Miller <gmiller@iglou.com> wrote:
> My ISP doesn't allow telnet access and doesn't have a C
>compiler installed (or at least I don't have access to it). So
>obviously mSQL and MySQL are out.
And presumably your ISP refuses to install those packages?
> So what packages are availalble which don't require telnet to
>install them, and don't require C compilation?
None. Switch to another ISP that *does* have those packages already
installed, or is willing to install them for you, or is willing to give
you shell (telnet) access so you can install "private" copies under your
account.
--
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: 3 Aug 1999 15:09:01 GMT
From: bellings@badlands.NoDak.edu (Brent A Ellingson)
Subject: Re: Why no Perl books at Fry's?
Message-Id: <7o70md$c85$1@news.ndsu.nodak.edu>
Abigail (abigail@delanet.com) wrote:
: Try to
: find a real important book, like "The Art of Computer Programming" or
: something from the grey wall.
This has me curious. What are you calling "the grey wall?" In my
mind, "the grey wall" == "VMS manuals," and I have a hard time putting
those in the same catagory as Knuth.
[Well, actually I could probably draw some disturbing similarities
between TeX and Perl, or Perl and VMS. But I won't.]
[And I also remember a "long orange shelf" of older VMS manuals,
which were much nicer to read than the grey ones...]
--
Brent Ellingson (bellings@badlands.NoDak.edu)
"It is amazing how complete is the delusion that beauty is goodness."
-- Leo Tolstoy
------------------------------
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 350
*************************************