[9394] in Perl-Users-Digest
Perl-Users Digest, Issue: 2989 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 26 01:08:20 1998
Date: Thu, 25 Jun 98 22:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 25 Jun 1998 Volume: 8 Number: 2989
Today's topics:
A new Perl keyword: MSPH [Was: What a Crappy World (oh, <mpersico@erols.com>
Re: Can someone explain the arrow operator ? (Mark-Jason Dominus)
Checking if a file does NOT exist <ryan@steelplan.com.au>
Re: Checking if a file does NOT exist <rra@stanford.edu>
Re: Flames.... (Leslie Mikesell)
Re: Flames.... (Leslie Mikesell)
Re: Flames.... <rra@stanford.edu>
Re: help! : Arrays in Perl <quentin@shaddam.amd.com>
Re: Hiding the Perl source luong@my-dejanews.com
Re: how do I parse a certain structured text? <warwickf@geocities.com>
Re: how to read a binary file containing C structures <quentin@shaddam.amd.com>
Re: MacPerl and odd filenames (Ronald J Kimball)
Re: mastering regular expressions (Abigail)
Null List, (), Considered Unitialized? james.p.williams@usahq.unitedspacealliance.com
Re: opening a file on other domain <ebohlman@netcom.com>
Re: Perl, is it threaded? (Abigail)
Re: Searching through a file <ebohlman@netcom.com>
Re: Searching through a file (Ronald J Kimball)
Re: What a Crappy World (oh, yes!) <pdw@plutonium.not>
Re: What a Crappy World (Thomas Wernitz)
Re: What a Crappy World <pdw@plutonium.not>
Re: What module to download a gif? <ebohlman@netcom.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 26 Jun 1998 00:23:04 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: A new Perl keyword: MSPH [Was: What a Crappy World (oh, yes!)]
Message-Id: <35932228.96870B1E@erols.com>
My $0.02:
1) Too much energy is put into flames. It is so much easier to write,
"This is an FAQ question" and leave it at that than to write a diss'ing
dissertion, that one has to question the motivations and character of
the Mean-Spirited-Perl-Hackers (MSPHs).
2) I'd like to see how far any of the MSPHs would get if Usenet were
conducted in person. It's kind of like road-rage, protection by
separation. How brave are you in person? Wanna try that attitude in a
NYC subway car?
------------------------------
Date: 26 Jun 1998 00:03:05 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <6mv6hp$p3n$1@monet.op.net>
Keywords: coma pewter southeast transition
In article <slrn6p4uvp.a16.mike@mike.local.net>,
Mike Mckinney <mikem@wans.net> wrote:
>I'm hoping to find out about the -> operator.
Arrow operator 1: It dereferences a reference:
Suppose %h is a hash, and $hr is a reference to %h, as $hr = \%h.
Then the following are equivalent:
$h{foo}
${$hr}{foo}
$hr->{foo}
Suppose @a is an array, and $ar is a reference to @a, as $ar = \@a.
Then the following are equivalent:
$a[119]
${$ar}[119]
$ar->[119]
Suppose &f is a function, and $fr is a reference to &f, as $fr = \&f.
Then the following are equivalent:
&f(@args);
&{$fr}(@args);
$fr->(@args);
Arrow operator 2: It invokes methods. None of this is going to make
any sense unless you already know how Perl handles object-oriented
programming constructs, but I include it for completeness.
Suppose you have a package P, and $o is an object of class P.
That means that $o is a reference to a datum that has been `blessed'
into package P, for example with:
bless $o, P;
Then
$o->foo(@args);
is the same as
P::foo($o, @args);
except that if there is no P::foo function, Perl will do inheritance
to look for a different `foo' function to use instead. If there is no
P::foo, it will look for Q::foo, for every Q that is named in @P::ISA.
If there isn't any Q::foo where Q is in @P::ISA, it'll look for
P::AUTOLOAD or some Q::AUTOLOAD where Q is in @P::ISA. If there isn't
an AUTOLOAD, it'll try UNIVERSAL::foo and finally UNIVERSAL::AUTOLOAD.
If $c contains a string rather than a reference to ablessed datum,
then it is treated as if it were blessed into the package named in $c.
For example if ($c = 'P'), then
$c->foo(@args)
is the same as
P::foo($c, @args)
except that if there is no P::foo, Perl looks for a different `foo'
function as above.
>I had thought that => was another form of the , operator..Is there a
>difference ?
=> is a little different from the comma operator. See `perlop' for a
complete description.
=> has nothing at all to do with ->.
<= is the less-than-or-equal-to operator.
There is no <- operator; nor will there ever be.
($x<-8 would break.)
The only language I know of with more arrows than Perl is APL.
ML gets honorable mention here.
------------------------------
Date: Fri, 26 Jun 1998 11:34:28 +0800
From: Ryan Snowden <ryan@steelplan.com.au>
Subject: Checking if a file does NOT exist
Message-Id: <359316C4.1912397F@steelplan.com.au>
--------------909057F689C3792BE2F4E384
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I want the following to happen:
if ($file exits || has a 0 byte size) {
print <<HTML;
# insert JavaScript alert("$file doesnt exist or has 0 byte size!
doh!");
HTML
}
if ... # continue on with program
Perl allows you to check if a file DOES exist & has a 0 byte size like:
if (-e $file || -z $file) {
# stuff
}
This isn't what I'm after though. I want to check if the file DOESN'T
exist.
Replies to ryan@steelplan.com.au.
Thanks
Ryan.
--------------909057F689C3792BE2F4E384
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<FONT FACE="Courier New,Courier">I want the following to happen:</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><B><FONT FACE="Courier New,Courier">if ($file exits || has a 0 byte
size) {</FONT></B>
<BR><B><FONT FACE="Courier New,Courier"> print <<HTML;</FONT></B>
<BR><B><FONT FACE="Courier New,Courier"> # insert JavaScript alert("$file
doesnt exist or has 0 byte size! doh!");</FONT></B>
<BR><B><FONT FACE="Courier New,Courier">HTML</FONT></B>
<BR><B><FONT FACE="Courier New,Courier">}</FONT></B>
<BR><B><FONT FACE="Courier New,Courier">if ... # continue on with program</FONT></B><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">Perl allows you to check if a file
DOES exist & has a 0 byte size like:</FONT><B><FONT FACE="Courier New,Courier"></FONT></B>
<P><B><FONT FACE="Courier New,Courier">if (-e $file || -z $file) {</FONT></B>
<BR><B><FONT FACE="Courier New,Courier"> # stuff</FONT></B>
<BR><B><FONT FACE="Courier New,Courier">}</FONT></B><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">This isn't what I'm after though.
I want to check if the file DOESN'T exist.</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">Replies to ryan@steelplan.com.au.</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">Thanks</FONT>
<BR><FONT FACE="Courier New,Courier">Ryan.</FONT>
<BR><FONT FACE="Courier New,Courier"></FONT> </HTML>
--------------909057F689C3792BE2F4E384--
------------------------------
Date: 25 Jun 1998 21:26:23 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Checking if a file does NOT exist
Message-Id: <m3pvfwdc0g.fsf@windlord.Stanford.EDU>
Ryan Snowden <ryan@steelplan.com.au> writes:
> Perl allows you to check if a file DOES exist & has a 0 byte size like:
> if (-e $file || -z $file) {
> # stuff
> }
> This isn't what I'm after though. I want to check if the file DOESN'T
> exist.
if (!-e $file || -z _) {
will do what you want. Just negate the test that's returning the opposite
of what you want to check.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 25 Jun 1998 23:10:37 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mv6vt$p1q$1@Venus.mcs.net>
In article <6mv46f$chb$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, les@MCS.COM (Leslie Mikesell) writes:
>:How do you grep the documentation for all the CPAN modules without
>:downloading and building everything first?
>
>This is a wonderful question, and one which I have been
>thikning upon for some time.
>
>But I'm not convinced that it's that critical that the
>CPAN modules be greppable like that.
I have trouble reconciling the idea that you should be able
to find something you don't know by grepping with the idea
that you don't need to grep the module documentation. I don't
know what it all says - how should I find out?
I'm not sure it would be very useful without access to the full
text but a hotbot/altavista style search where you get a paragraph
or so for each search match and can click to get the full document
would eliminate the need for most of the simple questions that
everyone complains about on c.p.l.m, and posting the search
query that would yield the answer would be useful, quick and easy.
There are several problems with the perl documentation that this
would solve. There are too many parts, in too many places and
(currently) no single tool to find something you don't already
know. Also, what you usually want to know is whether a particular
problem has already been solved or a tool already written, and the
correct answer to this changes daily. You can't find this in
a book because they are always out of date.
It won't solve all the problems: the breadth of perl syntax is
just enormous, especially if you don't already know the dozens
of other languages whose concepts it inherits. A hyperlinked
glossery might help but I doubt it. And then there are the
little things that are just plain magic.
Les Mikesell
les@mcs.com
------------------------------
Date: 25 Jun 1998 23:24:19 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Flames....
Message-Id: <6mv7pj$p6s$1@Venus.mcs.net>
In article <m3vhpode0z.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>Leslie Mikesell <les@MCS.COM> writes:
>
>> In my earlier post I questioned why CGI related topics were often
>> roasted as inappropriate for c.l.p.m, yet they are clearly going to be a
>> large part of the perl conference.
>
>CGI-related topics are not appropriate on this newsgroup because there is
>a more appropriate newsgroup for CGI programming, even if that programming
>is being done in Perl.
If someone wants perl syntax (or more likely to find existing code)
why is the function of the program relevant at all? If you post
a programming question in the CGI group the answers will be to use
the MS server and asp.
>A conference has a completely different categorization and topicality
>schema than a newsgroup.
I really don't understand. Why would something be a reasonable
topic at a perl conference and unreasonable in perl.misc?
Les Mikesell
les@mcs.com
------------------------------
Date: 25 Jun 1998 21:33:49 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Flames....
Message-Id: <m3n2b0dbo2.fsf@windlord.Stanford.EDU>
Leslie Mikesell <les@MCS.COM> writes:
> Russ Allbery <rra@stanford.edu> wrote:
>> CGI-related topics are not appropriate on this newsgroup because there
>> is a more appropriate newsgroup for CGI programming, even if that
>> programming is being done in Perl.
> If someone wants perl syntax (or more likely to find existing code) why
> is the function of the program relevant at all?
If someone asks a question Perl syntax, then the question isn't about CGI.
I would have thought that this was reasonably obvious from what I said,
but maybe it wasn't.
Questions about how to redirect a person's browser depending on their
operating system, like the one I partially answered and partially
redirected here earlier, are the sorts of things that aren't really
on-topic here.
> If you post a programming question in the CGI group the answers will be
> to use the MS server and asp.
Then it sounds like that group needs more experienced readers. But I
personally have no interest in CGI programming whatsoever, which is why I
don't read that group but do read this one.
>> A conference has a completely different categorization and topicality
>> schema than a newsgroup.
> I really don't understand. Why would something be a reasonable topic at
> a perl conference and unreasonable in perl.misc?
Because the scope of the conference is broader than the scope of this
newsgroup, perhaps?
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 25 Jun 1998 23:28:31 -0500
From: Quentin Fennessy <quentin@shaddam.amd.com>
Subject: Re: help! : Arrays in Perl
Message-Id: <xim1zscyefk.fsf@shaddam.amd.com>
>>>>> "JV" == Justin Voshell <vosheljh@jmu.edu> writes:
JV> Hi all, I am pretty new with Perl an can't seem to find a
JV> function that will tell me the length of an array. Is there
JV> such a thing [there must be]?
Justin, when you evaluate an array in scalar context you
get the number of elements in that array.
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: Fri, 26 Jun 1998 04:41:47 GMT
From: luong@my-dejanews.com
Subject: Re: Hiding the Perl source
Message-Id: <6mv8qb$j3l$1@nnrp1.dejanews.com>
In article <6muia5$9au$5@client3.news.psi.net>,
abigail@fnx.com wrote:
Hi,
I think that I have asked a very perl-related question, is it
too much to expect for a proper perl-related answer? I am
a little bit supprized and get upset when reading some of
the answers.
Some of you concentrate on judjing and commenting my motive,
but what I need is your experience. If you don't have any
exprience on this issue, why didn't you simply ignore my
message.
I've been programming perl for years, happilly sharing my
works with my colleagues. But in some case, I don't want to
reveal my work just to prevent the unjust people from taking
a look inside my program, see how it works and then find the
way to break it. Unless you develope perl like an amateurish
programmer, you will some time in the life think that it will
be more comfortable and rational if the code you developed is
used by the way you want, whether to give away freely or to be
kept in secret.
I found about ShroudIt! from Perl FAQ, downloaded perl to C alpha
3 version from www.perl.com. They are very official and orthodox
perl information source, aren't they.
Still, I'm looking for an useful response
Pham Thuc Truong Luong
>
> Larry Rosler (lr@hpl.hp.com) wrote on MDCCLIX September MCMXCIII in
> <URL: news:MPG.ffc3c67baf10b899896d2@nntp.hpl.hp.com>:
> ++ In article <6mu2mu$6m2$3@client3.news.psi.net>, Abigail <abigail@fnx.com>
> ++ says...
> ++ ...
> ++ > I really dislike the attitude of "what I need to develop stuff should
> ++ > be free, but what I develop should not". It's anti-social.
> ++
> ++ I fear another flame war about to begin.
> ++
> ++ Your statement is very offensive, and more fitting for Stallman to use
> ++ (as he repeatedly does).
> ++
> ++ The Perl code I write has economic value to my company, and they pay me
> ++ to produce it. If I use a 'free' tool, that is irrelevant to the value
> ++ of the work product. (In fact, for Windows I use a perl port for which
> ++ my company pays MKS as part of their Toolkit, but that really doesn't
> ++ change the issue -- I use free perl on Unix.)
> ++
> ++ This use for commercial purposes is explicitly permitted by the
> ++ License(s), which my company would not violate. It is *not* anti-social
> ++ for me not to share my code freely -- it is anti-having-a-job.
>
> I did not say it was anti-social not to share your code.
>
> I said it was anti-social to expect the tools you are developing
> with to be free, yet the things you are developing shouldn't be.
>
> (And I mean free here mainly in the sense of 'open').
>
> ++ That doesn't prevent me from sharing my ideas here, presumably on my own
> ++ time.
>
> Abigail
> --
> perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 26 Jun 1998 14:06:58 +1000
From: Warwick Foster <warwickf@geocities.com>
Subject: Re: how do I parse a certain structured text?
Message-Id: <35931E62.CDD32282@geocities.com>
How would you the say:
Find SID_NAME when inside SID_DESC if this is not always the case.
I have this need what I want to ask is
Find this token and tell me what tokens are already open.
from a structureal point of view.
a
{
b
{
f
}
}
}
at token f : token a and b are open.
thanks
Warwick Foster
Dataset Technologoies Pty Ltd.
Sydney, Australia.
---------------------------------------------------------------------
Patrick Timmins wrote:
> In article <6muae3$1if$1@news.ml.com>,
> mwang@tech.cicg.ml.com (Michael Wang) wrote:
> >
> > Suppose I want to get
> > SID_NAME and ORACLE_HOME
> > from the following construct, how should I do it. Please note
> > the text can be arranged differently.
> >
> > SID_LIST_CICGPROD-DS2-P_LISTENER =
> > (SID_LIST =
> > (SID_DESC =
> > (SID_NAME = CICGNYP1)
> > (ORACLE_HOME = /ds2-export/apps/oracle/product/7.3.4)
> > )
> > (SID_DESC =
> > (SID_NAME = CICGNYP2)
> > (ORACLE_HOME = /ds2-export/apps/oracle/product/7.3.4)
> > )
> > )
> >
>
> $sidname = $1 if (/\(SID_NAME = ([^)]*?)\)/);
> $oraclehome = $1 if (/\(ORACLE_HOME = ([^)]*?)\)/);
>
> Hope that helps,
>
> Patrick Timmins
> U. Nebraska Medical Center
> ww.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 25 Jun 1998 23:23:45 -0500
From: Quentin Fennessy <quentin@shaddam.amd.com>
Subject: Re: how to read a binary file containing C structures
Message-Id: <xim3ecsyeni.fsf@shaddam.amd.com>
>>>>> "AN" == Aravind Nallan <anallan@siac.com> writes:
AN> Hi, I have a binary file produced by a C program which
AN> contains C structures written using fwrite. Do we have any way
AN> of reading them in perl and writing out into Ascii?
I suggest you read up on unpack. unpack will let you read in the
bytes and interpret them exactly as you want to.
: qf@shaddam; perldoc -f unpack
=item unpack TEMPLATE,EXPR
Unpack does the reverse of pack: it takes a string representing a
structure and expands it out into a list value, returning the array
value. (In a scalar context, it returns merely the first value
produced.) The TEMPLATE has the same format as in the pack function.
Here's a subroutine that does substring:
sub substr {
local($what,$where,$howmuch) = @_;
unpack("x$where a$howmuch", $what);
}
[...]
Review the pack function for hwo to specify the template.
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: Fri, 26 Jun 1998 00:42:49 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: MacPerl and odd filenames
Message-Id: <1db7evh.pmqh1bfzvm72N@bay1-271.quincy.ziplink.net>
[posted and mailed]
Bob MacDowell <bobmacd+cmp@netcom.com> wrote:
> Opening -:<RE>QuickMail problems\ - <--Error! Can't open!! [...]
>
> Notice the trailing blanks. It wasn't the "/" after all. Now, I think
> blanks are perfectly legitimate parts of a filename, even trailing ones.
> But obviously MacPerl didn't.
>From perlfunc:
open FILEHANDLE,EXPR
open FILEHANDLE
[...]
The filename that is passed to open will have leading and trailing
whitespace deleted. To open a file with arbitrary weird characters
in it, it's necessary to protect any leading and trailing whitespace
thusly:
$file =~ s#^(\s)#./$1#;
open(FOO, "< $file\0");
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 26 Jun 1998 04:16:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: mastering regular expressions
Message-Id: <6mv7a2$d6s$3@client3.news.psi.net>
Amanda Silver (aks@cs.brown.edu) wrote on MDCCLIX September MCMXCIII in
<URL: news:6muge1$bho@cocoa.brown.edu>:
++
++ i also was wondering if the Mastering Regular Expressions book by o'reilly
++ really is the best book and if it will help me alot, can anyone here provide a review?
"The best book" ? For which values of best would that be?
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Fri, 26 Jun 1998 04:39:27 GMT
From: james.p.williams@usahq.unitedspacealliance.com
Subject: Null List, (), Considered Unitialized?
Message-Id: <6mv8lv$ip8$1@nnrp1.dejanews.com>
The following program generates a couple of strange warnings from -w.
#!/usr/bin/perl -w
use strict;
my(@a)=();
print scalar(@a),"\n";
print scalar(()),"\n"; #warning - () is uninitialized
print scalar(&func(0)),"\n";
print scalar(&func(1)),"\n"; #warning - () is uninitialized
sub func
{
my($arg)=shift;
my(@null)=();
$arg ? @null : ();
}
Each pair of print statements seems to be doing the same thing, neither
using an uninitialized value. Not only does -w complain about () being
uninitialized, but it complains only when the null array appears
literally. Do I have to declare a variable to hold a null array just
in case I'm being called in a scalar or Boolean context? I know I can
use wantarray in such cases, but the warnings seem unnecessary and
inconsistent.
TIA,
Jim Williams
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 26 Jun 1998 04:37:26 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: opening a file on other domain
Message-Id: <ebohlmanEv566E.JMF@netcom.com>
Negev <negev@anr.co.il> wrote:
: How can i open file for reading on other domain??
: I can only open files on my own server, and i even need the real path
: (not the domain path) to open it.
: I know i can do it cause lots of sites (web site garage, gifwizard, and
: ofcourse, all search engine spiders) have done it.
This may sound a little nitpicky to you, but it isn't. It involves a
distinction that you really need to understand if you want to do any
Web-related programming.
Those sites you mentioned don't actually "open files" on other servers.
They "request and accept resources, identified by URLs." In Perl, or any
other programming language, opening a file is a totally different
activity from connecting to an HTTP server and asking it for a resource,
and thus you have to do it in a totally different way, namely opening a
socket to the remote server, sending the appropriate request down the
socket, and reading the response from the socket. Fortunately, this is
such a common activity that people have written freely-available,
well-tested code to do it. The LWP module, available on CPAN, includes
such code, as well as a cookbook-style manual.
BTW, there is no law that the URL for a resource has to bear *any*
resemblance to the filename of that resource on an HTTP server. For that
matter, there's no law that a URL even has to refer to a file on the
server; there are plenty of applications where the server sees a URL,
invokes a process that pulls data out of a bunch of databases, sticks
some HTML glue around it, and sends it out. The main thing to remember
is that URLs are *not* filenames, even though they may look like them.
It would probably be a good idea for you to go over to
comp.infosystems.www.authoring.cgi and read the FAQs there. They'll give
you a good idea of how the HTTP protocol works, and make a lot of things
clearer to you.
------------------------------
Date: 26 Jun 1998 04:06:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl, is it threaded?
Message-Id: <6mv6os$d6s$2@client3.news.psi.net>
Robert Garskof (robert.garskof@nospam.snet.com) wrote on MDCCLIX
September MCMXCIII in <URL: news:3592C54A.7160D48B@nospam.snet.com>:
++ I have heard that perl can be threaded, as in you can write threaded
++ applications in perl. Is this correct?
++
Well, yes and no. The latest official version of perl (5.004_04)
does not have threads; at least not in the way most people think
of threads. Tom will probably point to the fact you have 'fork'
and you can be happy with that.
5.005 will have *experimental* threads. Support for threads will then
be available, but because it is labelled as experimental, the perl
developers allow themselves to make incompatible changes for perl 5.006.
You can get the latest developers version of perl (5.004_68) and build
a threaded version of perl. But be aware you'll take a performance hit.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Fri, 26 Jun 1998 04:17:32 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Searching through a file
Message-Id: <ebohlmanEv5598.ILG@netcom.com>
HU <hurban@snet.net> wrote:
: I regret leaving the chomp in. It was there to clean up the output for
: debugging. I think I can clarify the question though. Is there a way
: to NOT read a line at a time and still use pattern matching? I really
: want to look for a potentially multi line pattern and write this out to
: a file with a semi colon at the end (c header file). All the examples I
: see are line oriented.
Perl provides plenty of methods for dealing with input in non-line-sized
chunks. The discussion of $/ in perlvar should be quite enlightening.
Perl also allows pattern-matching in strings that include multiple lines;
the details are all in perlre, where you can learn about the /s and /m
modifiers to pattern-matches (you'll probably have to read that section a
couple times, since it's easy to confuse the two).
------------------------------
Date: Fri, 26 Jun 1998 00:42:52 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Searching through a file
Message-Id: <1db7fgv.1jzmaa78xz1s0N@bay1-271.quincy.ziplink.net>
HU <hurban@snet.net> wrote:
> I regret leaving the chomp in. It was there to clean up the output for
> debugging. I think I can clarify the question though. Is there a way
> to NOT read a line at a time and still use pattern matching?
You can use the pattern matching operators on any string, regardless of
how many newlines it contains. Depending on the regex, it may be
appropriate to use /m or /s modifier.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 26 Jun 1998 04:23:11 +0000
From: pd wilson <pdw@plutonium.not>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <3593222F.E969CED5@plutonium.not>
Olga, I'm going to put this as simply as possible.
You don't own this newsgroup. You don't contribute to this newsgroup.
If you don't like it, GET THE FUCK OUT.
Tom Christiansen is a living god. Deal with it.
Olga wrote:
>
> Wow, that was insightfull, I don't think it's a very good public service
> to tell people they are stupid just because they are trying to learn and
> make themselves smarter.
> So you've never asked a "stupid" question?
> I don't think insulting people is much of a public service
> Olga
>
> On 24 Jun 1998, Stuart McDow wrote:
>
> > Olga <katzman@students.uiuc.edu> writes:
> > >
> > > I just do not see the need to especially take the time to inform
> > > people how stupid they are.
> >
> > Consider it a public service.
> >
> > If at some points in my life someone hadn't told me I was being
> > stupid, I'd probably still be stupid. To be stupid while thinking
> > s/he's not makes for a pretty crappy world.
> >
> > --
> > Stuart McDow Applied Research Laboratories
> > smcdow@arlut.utexas.edu The University of Texas at Austin
> > "Look for beauty in roughness, unpolishedness"
> >
> >
--
/* if my email addres says 'not' instead if 'net',
you'll need to fix it in order to send me mail... */
the center for alien studies <http://home.plutonium.net/~pdw/>
------------------------------
Date: Fri, 26 Jun 98 03:11:06 GMT
From: NOSPAM.thomas_wernitz@tait.co.nz (Thomas Wernitz)
Subject: Re: What a Crappy World
Message-Id: <6mv76p$3b1$1@wolfman.xtra.co.nz>
In article <ltbtrgalcs.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
>I agree, as well. I respect and appreciate those who are sharing
>their technical knowledge here, and my appreciation goes even further
>towards those who have spent so much time writing such an excellent
>set of FAQ's, docs, and modules ... and Perl itself.
>
>I just don't consider the gratuitous insults that a few (not all by
>any means) of these people give out to be contributions that are in
>any way commensurate with their technical accomplishements, nor with
>the fact that they are all adults. I'm separating the insulting
>behavior from everything else wonderful that these people have
>contributed and continue to contribute.
Could we please shut up this fealy-touchy-talk here. This is a programmer news
group. You come here to get answers to technical questions. If some of the
grumpy old men here get tough because they are annoyed, well let them rant. I
wonder how somebody can be insulted by a posting? :-| Do you think my blood
pressure rises if somebody here calls my question stupid? 8| Just get on with
it, try to become acceptable (not that hard really) and don't take things
personal. Next time Tom C. will give you a good answer because he can't
possibly have an automatic kill list for all the morons out there! No offence!
;)
HTH,
Thomas
"most people would die sooner than think -- in fact, they do so."
-- Bertrand Russell
------------------------------
Date: Fri, 26 Jun 1998 04:20:47 +0000
From: pd wilson <pdw@plutonium.not>
Subject: Re: What a Crappy World
Message-Id: <3593219F.89ACDCE4@plutonium.not>
Fred Riley <f.h.riley@NOSPAMselc.hull.ac.uk> wrote:
>
> ... I've got news for you, pal. IT might have been the exclusive
> preserve of the technical priesthood five years ago, but now everyone
> and their uncle's got a computer so us riff-raff are taking over and
> there's sod-all you can do about it.
>
hmm, I've heard some rumors to that effect, in the media, etc, but if
what you say is true, what are you doing here? There is in fact some
thing they can do about it, they can quit answering dumbass questions by
any joe-blow who picked up a PC ay the local discount outlet. They can
quit giving away first rate software (like Perl) to idiots who can't
appreciate it. They can flame newbies out of the newsgroups so people
who are actually trying to accomplish something can get some use out of
them.
Without the work of Tom Christianson, and people like him, your shiny PC
is an expensive paperweight or an ineffective boat anchor.
--
/* if my email addres says 'not' instead if 'net',
you'll need to fix it in order to send me mail... */
the center for alien studies <http://home.plutonium.net/~pdw/>
------------------------------
Date: Fri, 26 Jun 1998 04:10:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: What module to download a gif?
Message-Id: <ebohlmanEv54x8.I8A@netcom.com>
- <root.noharvest.\@not_even\here.com> wrote:
: If you are NOT using a microsoft OS, you can just use lynx, like this
: in perl:
: $data = `lynx -source http://www.someurl.com/some/url.gif`;
In fact, you can do this even if you ARE using a Microsoft OS, since Lynx
has been ported to all of them.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2989
**************************************