[19337] in Perl-Users-Digest
Perl-Users Digest, Issue: 1532 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 15 14:10:40 2001
Date: Wed, 15 Aug 2001 11:10:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997899014-v10-i1532@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 15 Aug 2001 Volume: 10 Number: 1532
Today's topics:
Re: Learning Perl, 2nd Edition <james@zephyr.org.uk>
Re: Need Perl module or regexp to slurp specific XML re (Yves Orton)
Re: Need Perl module or regexp to slurp specific XML re <godzilla@stomp.stomp.tokyo>
Re: OT: Why is there so much white space in perl docume <miscellaneousemail@yahoo.com>
Re: OT: Why is there so much white space in perl docume <jurgenex@hotmail.com>
Re: OT: Why is there so much white space in perl docume <godzilla@stomp.stomp.tokyo>
Re: OT: Why is there so much white space in perl docume <miscellaneousemail@yahoo.com>
Re: OT: Why is there so much white space in perl docume (Yves Orton)
Re: perldoc is like Greek to a beginner?? (Anno Siegel)
Re: regex question... <ren@tivoli.com>
Re: regexp help please! <leary@foad.NOSPAM.org>
Re: screen resolution detection <jurgenex@hotmail.com>
Re: Sorting Hash of Arrays (Helgi Briem)
Re: Sorting Hash of Arrays <a@b.c>
Re: substitution - Linux v Win32 <gnarinn@hotmail.com>
Re: Why is there so much white space in perl documentat <ilya@martynov.org>
Re: Why is there so much white space in perl documentat (Tad McClellan)
Re: Why is there so much white space in perl documentat <ilya@martynov.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Aug 2001 17:26:16 +0100
From: James Coupe <james@zephyr.org.uk>
Subject: Re: Learning Perl, 2nd Edition
Message-Id: <ffcH6gjoKqe7EwGB@gratiano.zephyr.org.uk>
In message <m1d76142cj.fsf@halfdome.holdit.com>, Randal L. Schwartz
<merlyn@stonehenge.com> writes
>Most people will probably only notice the syntax
>of references and array/hash elements changing, and some would say for
>the better and more DWIMmier.
(Slightly late follow-up, sorry.)
Having read some of the stuff on www.perl.com about Larry's State of the
Onion regarding Perl6, the concatenation "." becoming "~" is likely to
be fairly noticeable for most (all?) people, I should've thought.
Having to watch out for putting spaces in regexes could also be
troublesome, if the intended /x by default behaviour is adopted.
Not that either of these are likely to be insurmountable, but they are
likely to be noticed.
--
James Coupe PGP Key: 0x5D623D5D
EBD690ECD7A1F
You scumbag, you maggot, you cheap lousy faggot B457CA213D7E6
Happy Christmas your arse, I pray God it's our last 68C3695D623D5D
------------------------------
Date: 15 Aug 2001 10:52:19 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Need Perl module or regexp to slurp specific XML records
Message-Id: <74f348f7.0108150952.324ba78e@posting.google.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message news:<3B7A0147.B9FD03DF@stomp.stomp.tokyo>...
> M.L. wrote:
<SNIP>
> > And I'd like to assign each record to a hash where:
>
> I do not support use of a slow inefficient hash where
> a quick efficient associative array can be used. Are
> you a Perl 5 Cargo Cultist?
Two questions. Could you direct me to to the man pages that explain
the difference between 'a slow inefficient hash' and 'a quick
efficient associative array' Everything that I have read indicates
that a hash _IS_A_ quick efficient associative array.
Also did it occur to you that the OP might, just might, want to do
something more sophisticated to the data than just print it out?
To the OP-> You can probably skip the rest of this article as it is
an analysis of just how bad a solution the geko gave you. Basically
her code is so fragile that if you breath on it it wil crash. Listen
to the advice given by Eric, as he knows his shit, and, unlike the
frog, posts only to help not to inflate his ego into the upper
atmosphere.
<SNIP>
> Research and read about the $/ default record separator
> along with the powerful and efficient local () function.
Interesting approach that is worthy of consideration. Too bad you
didn't test your code (or at least didnt test anything but the
simplest of cases), otherwise you would notice that it doesnt work.
Hmmm. Come to think of it arent you the same Lizard that endlessly
berates people for not testing their code? Eat your own dog food
lizard.
Also a further point onlong these lines... You didnt read the spec
either. He said if the STATE was some value, not the PHONE number.
Please before you post your rantings at least _READ_ the OP!
> You Perl 5 Cargo Cultists dictate local () is worthless
> and should be removed from perl core? This is a classic
> example of Perl 5 Cargo Cultists not having an ability
> to think for themselves. You truly are Borg.
Nobody was arguing with you yet you seem fit to bitch at them anyway.
Poor OP asks a question and you snakebite the guy.
Now on to the code. While the approach is interesting (as I said
before) the code doesnt work (as I also said before.) Replace your
data block with the code following my signature, execute your code and
you get the output specified. Notice that 'Record id="ID 0128: '
Ooops, Lizard, did you make a fool out of yourself again???
And now in the spirit of not abusing anyone whose code I cant fix, I
present the following analysis of your code: (unlike you I can PROVE
that your code is bad, AND I can fix it. Well, insofar as such an
erroneous approach can be fixed.)
> #!perl
>
> print "Content-type: text/plain\n\n";
Useless. Waste of keystrokes and disk space.
>
> $user_parameter = "ou812";
>
> &Localize;
And for what reason are you including the & symbol? Its not wrong but
ultimately it IS a waste of time etc...
>
> sub Localize
I suppose you have created this sub in the spirit that other subs
might be added. Fair enough. But in this case it is a further waste
of disk space.
> {
> local ($/) = "<record id=\"";
Interesting approach. Too bad it doesnt work. Replace with:
local ($/) = "</record>";
>
> while (<DATA>)
> {
> if (/$user_parameter/i)
This is plain and simple bad logic. For instance what happens if the
OP has some moron (a lizard perhaps) that changed their NAME to
'ou812'. You would still/output process the record wouldnt you?
Dohh!! Come to think of it, you arent even checking a given field,
you are checking the whole record. Wow think of what would happen if
SQL did that!
So to fit with the OP's spec it would have to be:
if (/<state>\s*$user_parameter\s*<\/state>/i)
I put in the \s* because I believe that it is worthwhile to employ
defensive measures in my code. (Which incidentally means that I would
_never_ use this (meaning the overall program) approach in anything
but the most mundane of circumstances. Just consider the number of
minor changes in the data set/spec that would completely screw your
code.) Really there should be further measures taken, but my point is
made.
> {
> s/(\d+)">/ID $1:/;
Obviously this line has to be removed (See above). Replace it with:
s/<record id="(\d+)">/ID $1:/;
> s/<\/.*>(\n)/$1/g;
This one doesnt do the job either! Also it is ineficient to capture
constant data. So replace it with
s/<\/.*>\n?/\n/g;
> tr/>/:/;
> s/:/: /g;
Oh wow! Talk about redundant code! (and buggy, what happens if the
content of the fields contains a '>') These two get merged into
something marginally less wasteful (but no less bugggy, sigh, parsing
XML with regexes is just not smart):
s/>/: /g;
> s/<([a-z])/\u$1/g;
> s/\n+$//;
> print;
> }
> }
> }
And now the code should work as advertised. Oh yes, one little piece
of advice lizard darling, but if you make the changes that I have
indicated here you might also want to change $user_parameter to
something that resembles a two digit state code, otherwise you might
worry your little brain about why nothing is being output.(besides
your stupid content line)
Yves
--
The Friendly Troll ~ I am not, nor have ever been, anyone else.
#The following is a replacement DATA block for the lizards earlier
submission
#to this thread.
__DATA__
<record id="0127">
<name>Kiralynne Schilitubi</name>
<address>Oh My Big Butt Blvd.</address>
<city>Riverside</city>
<state>CA</state>
<phone>(800) ou812</phone>
<zip>12345</zip>
<email>godzilla@stomp.stomp.tokyo</email>
</record>
<record id="0128">
<name>Billyray</name>
<address>Nine Inch Blvd.</address>
<city>Riverside</city>
<state>CA</state>
<phone>(800) ou812</phone>
<zip>12345</zip>
<email>clydesdale@my.boyfriend.com</email>
</record>
<record id="0129">
<name>Lizard</name>
<address>Loser Lane</address>
<city>SnakeBite City</city>
<state>CA</state>
<phone>(800) ou812</phone>
<zip>98412</zip>
<email>lizards.are.tasty@muskrat.com</email>
</record>
PRINTED RESULTS (after replacing the data block):
________________
Content-type: text/plain
ID 0127:
Name: Kiralynne Schilitubi
Address: Oh My Big Butt Blvd.
City: Riverside
State: CA
Phone: (800) ou812
Zip: 12345
Email: godzilla@stomp.stomp.tokyo
Record id="ID 0128:
Name: Billyray
Address: Nine Inch Blvd.
City: Riverside
State: CA
Phone: (800) ou812
Zip: 12345
Email: clydesdale@my.boyfriend.com
Record id="ID 0129:
Name: Lizard
Address: Loser Lane
City: SnakeBite City
State: CA
Phone: (800) ou812
Zip: 98412
Email: lizards.are.tasty@muskrat.com
------------------------------
Date: Wed, 15 Aug 2001 11:05:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Need Perl module or regexp to slurp specific XML records
Message-Id: <3B7ABA05.91A07032@stomp.stomp.tokyo>
Yves Orton wrote:
> Godzilla! wrote:
> > M.L. aka Yves Orton aka The CLPM Troll aka Ad Nauseam wrote:
(snipped stereotypical CLPM Troll anal retentive hissy fit)
You are such comedy and such an easy mark.
Godzilla! Queen Of Markers.
------------------------------
Date: Wed, 15 Aug 2001 16:22:56 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <MPG.15e44f973c943d05989753@news.edmonton.telusplanet.net>
In article <3B7A7894.E230EC20@home.com>, Michael Carman at
mjcarman@home.com says...
> > > On my Windows 98 the pod files look absolutely terrible from
> > > the DOS prompt. I feel like I am looking into a black hole
> > > with little white letters in it =:).
>
> You can change the color scheme, you know...
>
Pray tell how do I change the color scheme of a DOS prompt box (window)?
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so although you are
welcomed to visit and take a look, trying to subscribe will only be a
frustration for you as your data will not be saved at this time.
------------------------------
Date: Wed, 15 Aug 2001 10:20:11 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <3b7aaf4c$1@news.microsoft.com>
"Carlos C. Gonzalez" <miscellaneousemail@yahoo.com> wrote in message
news:MPG.15e44f973c943d05989753@news.edmonton.telusplanet.net...
> In article <3B7A7894.E230EC20@home.com>, Michael Carman at
> mjcarman@home.com says...
> > > > On my Windows 98 the pod files look absolutely terrible from
> > > > the DOS prompt. I feel like I am looking into a black hole
> > > > with little white letters in it =:).
> > You can change the color scheme, you know...
> Pray tell how do I change the color scheme of a DOS prompt box (window)?
Well, what about a right-click on the title bar of the DOS box, select
"Properties", select "Colors"? If this doesn't give you enough options then
I don't know what would.
BTW: this has nothing to do with Perl.
jue
------------------------------
Date: Wed, 15 Aug 2001 10:57:36 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <3B7AB810.EBCD407F@stomp.stomp.tokyo>
"Jürgen Exner" wrote:
> Carlos C. Gonzalez wrote:
> > Michael Carman wrote:
> > Pray tell how do I change the color scheme of a DOS prompt box (window)?
> Well, what about a right-click on the title bar of the DOS box, select
> "Properties", select "Colors"? If this doesn't give you enough options then
> I don't know what would.
Win 98 is not equipped with colors option for DOS. This
can only be done by loading the ansi.sys device along
with addition of menucolor choices via a config.sys
file or, by manually setting colors at a DOS prompt
after the ansi.sys is loaded during boot. Another
choice is to write custom DOS programs to allow
on-the-fly colorful changes at a DOS prompt.
Research DOS screensavers for interesting techniques.
http://www.bookcase.com/library/software/msdos.util.system.html
These will provide a decent background knowledge for ansi.sys:
ftp://ftp.simtel.net/pub/simtelnet/msdos/sysutl/ansi_sys.zip
ftp://ftp.simtel.net/pub/simtelnet/msdos/sysutl/ansiset.zip
For a typical Win98 machine, ansi.sys is found,
c:\windows\command\ansi.sys
config.sys ...
DEVICE=C:\WINDOWS\HIMEM.SYS
DEVICE=C:\WINDOWS\EMM386.EXE
DEVICEHIGH=c:\windows\command\ansi.sys
DEVICE=c:\windows\setver.exe
Godzilla!
--
print "PROMPT $e[34;47;7m";
------------------------------
Date: Wed, 15 Aug 2001 17:56:53 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <MPG.15e465c9c08994e0989756@news.edmonton.telusplanet.net>
In article <3b7aaf4c$1@news.microsoft.com>, Jürgen Exner at
jurgenex@hotmail.com says...
> Well, what about a right-click on the title bar of the DOS box, select
> "Properties", select "Colors"? If this doesn't give you enough options then
> I don't know what would.
>
Nope. Can't do it Jurgen. There is no "Colors" in my DOS prompt
properties.
> BTW: this has nothing to do with Perl.
Well....I was just pointing out that reading perldocs on Windows through
a call to perldoc at the DOS command prompt is very archaic and primitive
for my tastes. I guess we can leave it at that.
Thanks.
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so although you are
welcomed to visit and take a look, trying to subscribe will only be a
frustration for you as your data will not be saved at this time.
------------------------------
Date: 15 Aug 2001 11:04:29 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: OT: Why is there so much white space in perl documentation??
Message-Id: <74f348f7.0108151004.140ec64b@posting.google.com>
Michael Carman <mjcarman@home.com> wrote in message news:<3B7A7894.E230EC20@home.com>...
> Yves Orton wrote:
> >
> > Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
>
> > If your on a *nix box then do thing the *nix way, if your on MS box
> > then do it the MS way. TMTOWTDI)
>
> What if you're on a Win* box with an Xterm session running on *nix? :)
Ohhh. I never thought of bisexuals... :-)
I guess you get the best (or worst) of both worlds then? :-)
SNIP
> > Netscape at one time was the best browser out there. Then for whatever
> > reason (I am no serious fan of MS) they got left behind. Far behind.
> > IE is a MUCH better browser than NetSucks. period.
>
> Not to fuel any holy wars here, but fortunately for those of us who are
> old Netscape users this isn't true. (It *was* true until very recently,
> though.) CNET's review of 6.1 at
>
> http://home.cnet.com/software/0-3227883-8-6804817-1.html
>
> basically says that NS 6.1 and IE 5.5 are pretty even. Having run both,
> I'd have to agree.
Well, I have to say that my experience of failing to DL 6.0 when it
first came out lead me to investigate other things, and quite frankly
I never went back. Thats the effect of bad service for you. Have you
tried Opera? How does it compare?
But the benefits of IE include other things, such as the tricks
suggested in the thread about self searchable docs.
I will consult the review and the latest and perhaps have my opinion
changed.
Yves
------------------------------
Date: 15 Aug 2001 15:12:08 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perldoc is like Greek to a beginner??
Message-Id: <9le3g8$scc$1@mamenchi.zrz.TU-Berlin.DE>
According to Bernie Cosell <bernie@fantasyfarm.com>:
> tadmc@augustmail.com (Tad McClellan) wrote:
>
> } >(Come to
> } >think of it, I am sure i have seen something somewhere (maybe a faq)
> } >that says that perl syntax in general is not propperly speaking
> } >regular either.)
> }
> }
> } Most programming languages are "Context Free Grammars" the
> } next step up in Chomsky's hierarchy from "Regular Grammars".
>
> Actually, I think that very very few programming languages manage to be
> context-free. That's just too restrictive for normal/effective use, and so
> while most languages use CF expressions and many CF programming constructs,
> there'll almost always inevitably be *some* little corner of the language
> that ends up having to be context sensitive.
There must be a tradeoff for a language designer between compiler-
and user-friendliness. The lower a language is in the Chomsky hierarchy
the easier it is to parse, and hence to compile, but that severely
limits expressiveness. So a wimpy designer keeps the core of his
language context-free (and would make it regular if he could), and
allows only a few context-sensitive constructs. Perl's designer seems
to have thrown all caution to the winds :)
Oh, BTW, "context" here doesn't refer to scalar/list context, which
is a run-time issue. It isn't that what makes Perl context-sensitive,
but other constructs (I'd look among the operators that don't have
a prototype) may be hard or impossible to parse context-free.
Anno
------------------------------
Date: 15 Aug 2001 11:01:38 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: regex question...
Message-Id: <m3u1z948il.fsf@dhcp9-161.support.tivoli.com>
On Wed, 15 Aug 2001, strawSPAM_BEGONEman@plexi.com wrote:
> Ren Maddox wrote:
>
>> $_ = "the original string\n";
>> s/(.*)(?<=orig)/\U$1/;
>> print;
>> s/(.*)(?=ORIG)/\L$1/;
>> print;
>> __END__
>> THE ORIGinal string
>> the ORIGinal string
>
> Rats. I thought I knew what was going on.
>
> The second one seems clear. $MATCH would be 'THE ORIG' but (?=ORIG)
> has $MATCH not include 'ORIG'. Look ahead. Zero-width. Right???
It's not that (?=ORIG) has $1 not include "ORIG", it's just that
"ORIG" must still match after $1 matches, or the entire match fails.
To begin with, the "(.*)" is going to match the entire string. Then,
the look-ahead is going to look and see if what comes next matches
"ORIG". Obviously, it doesn't, so the match fails and has to start
back-tracking. Eventually, the "(.*)" portion will have back-tracked
to the point where the look-ahead can succeed. At that point, the
"(.*)" portion is matching "THE ".
Notably, if the string were "the original original string" then the
results would have been:
THE ORIGINAL ORIGinal string
the original ORIGinal string
> Now the first one is not so clear. (.*) would match the entire sring
> of course. Do you mean to say (?<=orig) looks from the end of the
> match for 'orig'? Having found 'orig' what happens next? In this
> example $MATCH is 'the orig'. How did 'orig' become a part of
> $MATCH?
This is really the same as the second example above. "(.*)" matches
the entire string and then starts back-tracking until the look-behind
can succeed. That only happens when that match position is
immediately after "orig" after "(.*)" matches. Therefore, "(.*)"
includes (and ends with) "orig".
Clear?
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 15 Aug 2001 10:19:54 -0500
From: "Leary" <leary@foad.NOSPAM.org>
Subject: Re: regexp help please!
Message-Id: <dKwe7.691$0M1.9303@e3500-atl1.usenetserver.com>
"Tad McClellan" <tadmc@augustmail.com> wrote in message;
> JB Lewis <jblewisoh@yahoo.com> wrote:
>
> >From the Win32::EventLog module I can extract this typical {Strings}
> >value for an event.
> >
> >domname\cwilliam COM6 06/01/2001 11:51am 06/01/2001 11:56am 5 6 21965
> >3826 16800 user request
> >
> >Using s/^domname\\// I can easily trim off the domain name, but what I
> >want is the username, the COM port, the first date, the first time,
> >and then the two numbers after the second time (the elapsed minutes
> >and seconds)
>
>
> Sounds like you basically want several of the space-separated fields.
>
>
> >Can the regexps be combined to collect each of the values with a
> >single regexp (not including the s/// I mentioned above)?
>
>
> Yes, Bart already showed that.
>
> But seems to me you can easily get it done without pattern matching.
>
>
> ---------------------------------
> #!/usr/bin/perl -w
> use strict;
>
> $_ = 'cwilliam COM6 06/01/2001 11:51am 06/01/2001 11:56am 5 6 21965 3826
16800 user request';
>
> my($user, $port, $date, $time, undef, undef, $minutes, $seconds) = split;
>
> print "$user, $port, on $date at $time for $minutes:$seconds\n";
> ---------------------------------
Say for instance you needed to strip the zero's out of the date (non-sense,
I know, but just an example) could regex be used within the split to
accomplish this or should that data be massaged after the split?
------------------------------
Date: Wed, 15 Aug 2001 09:05:02 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: screen resolution detection
Message-Id: <3b7a9daf$1@news.microsoft.com>
"MrMean" <lukehall@ace-net.com.au> wrote in message
news:3b79ece7@nap-ns1.netconnect.net.au...
> I'm trying to resize erverthing on my site to allow for users who are
> browsing in 640x480, 800x600, 1024x768.
>
> I've built the site on 800x600.
>
> Anyone know how to detect the screen resolution?
You may want to ask in a NG that deals with webauthoring.
jue
------------------------------
Date: Wed, 15 Aug 2001 16:52:28 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Sorting Hash of Arrays
Message-Id: <3b7aa6bc.2016892728@news.isholf.is>
On Wed, 15 Aug 2001 13:14:08 GMT, Drew Myers
<nospam@newsranger.com> wrote:
>In article <3B798A7B.36D0E05F@stomp.stomp.tokyo>, Godzilla! says...
>I don't know what a "Perl 5 Cargo Cultist" is. I would deduce that it is
>someone who's jumped on the proverbial bandwagon. I'm just trying to learn
>Perl, and to be incinerated like this is quite discouraging. I've been on the
>fringes of this newsgroup for long enough to know that if I post something, I
>should ensure I've researched my question before I post anything. I did, as I
>mention in the opening paragraph of my original post. Pardon me if my research,
>or my understanding of said research is not on the same par as yours.
A Cargo Cultist is someone who cuts and pastes code
without knowing what it is for or understanding it.
Godzilla maintains that using modules that experts
have written before you to make your code better and
more robust is cargo cultism. This is probably the
stupidest idea in the history of stupid ideas.
>Please don't misunderstand me. I appreciate you taking your time to look at my
>code (and yes, to criticize). This is how I will learn. I just think the
>"attack-like" nature of some of the responses was unnecessary.
Don't listen to a word that Kira, a.k.a. Godzilla says.
Listen to Tad, Uri, Randal, Ilya, Brent, Ren and other
skilled and helpful people instead. Kira is neither
skilled nor helpful. She is here only to piss people off
and make them angry (this is also called trolling).
This is her only interest in Perl of which she knows only
the raw basics (and badly at that). Ignore her.
Regards,
Helgi Briem
------------------------------
Date: Wed, 15 Aug 2001 10:16:08 -0700
From: BCC <a@b.c>
Subject: Re: Sorting Hash of Arrays
Message-Id: <3B7AAE58.9E06C4E2@b.c>
Lesson of the day for CLPM:
Don't even DREAM of posting a question until you have scoured ALL
documentation in existence and are 1000% sure that your question cannot
be solved in any length of time by deduction or inference from said
documentation if it is not specifically addressed therein.
Else be ROASTED!
Seriously though, even though the above statement is an exaggeration of
the truth, you should always do as much research as possible to solve
your problem. I find that CLPM is a last resort resource after you have
exhausted all other resources.
As a beginner in perl one of the most difficult yet most important tools
is to learn how to find the information you are looking for. The better
you get, the easier it is for you to find this information (for the most
part).
Unfortunately, you asked a question with a solution that was deemed
obvious (it was in the faq and in the book it would seem) and received
one of the colorful replys that CPLM has built its reputation on.
But look on the bright side! You had many extremely helpful replys
(even the one you took offense to had some useful info) and learned more
than you ever thought you would about sorting. Take that information
and leave the rest.
Cheers,
BCC
> I'm just trying to learn
> Perl, and to be incinerated like this is quite discouraging. I've been on the
> fringes of this newsgroup for long enough to know that if I post something, I
> should ensure I've researched my question before I post anything. I did, as I
> mention in the opening paragraph of my original post. Pardon me if my research,
> or my understanding of said research is not on the same par as yours.
------------------------------
Date: Wed, 15 Aug 2001 17:28:50 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: substitution - Linux v Win32
Message-Id: <997896530.55457221576944.gnarinn@hotmail.com>
In article <nfne7.73$1T.191471@wa.nnrp.telstra.net>,
Wyzelli <wyzelli@yahoo.com> wrote:
>
>
>I have a squid log file on my Linux server, which I want to copy onto my
>local drive (win2k) before processing.
>
>Naturally if I copy the file from the Samba share, I have the \r\n v \n
>problem which I can easily fix by doing:
>
>perl -p -i*.bak -e "s/\r\n/\n/g" filename
maybe i am missing something, but i understood that you want to
move a unix test file to win for processing there.
unix text files have \012 (LF), and win files have \015\012 (CRLF)
so you want co convert LF to CRLF, not the other way around
if you are converting on the unix, you can use s/\n/\r\n/g
but if you do it on the win, i would use s/\010/\015\010/g
>I thought, to make life easier (laziness part of things?) I would cp the
>file via a cron job, and I may as well run the substitution there as well,
>that way the file is all ready for me in the morning.
>
>But alas, running the same command on the Linux box via telnet (s/"/'/) does
>not affect the original file at all, though the .bak is created quite
>happily.
no \r\n to convert
gnari
------------------------------
Date: 15 Aug 2001 19:23:01 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Why is there so much white space in perl documentation??
Message-Id: <87elqd5ove.fsf@abra.ru>
TM> You can't grep perldoc.com. You can't make your own "indexes".
TM> grep ^= perlfaq[1-9].pod >faq.heads
TM> Now I can search any way I like:
TM> grep -i list faq.heads | grep -i array
I'm curious why you can't just do 'perldoc -q array'?
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Wed, 15 Aug 2001 10:54:20 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Why is there so much white space in perl documentation??
Message-Id: <slrn9nl38s.1dq.tadmc@tadmc26.august.net>
Ilya Martynov <ilya@martynov.org> wrote:
>
>TM> You can't grep perldoc.com. You can't make your own "indexes".
>
>TM> grep ^= perlfaq[1-9].pod >faq.heads
>
>TM> Now I can search any way I like:
>
>TM> grep -i list faq.heads | grep -i array
>
>I'm curious why you can't just do 'perldoc -q array'?
I can, but it does not do the same thing that my grep(1)s do.
I want to find FAQs that mention _both_ terms.
Can you get perldoc to do this:
grep Slice *.pod
??
I never really _use_ perldoc, other than as a shorthand for
pointing out to folks the applicable documentation.
I want more power than perldoc makes available to me.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Aug 2001 19:55:09 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Why is there so much white space in perl documentation??
Message-Id: <874rr95ndu.fsf@abra.ru>
>> I'm curious why you can't just do 'perldoc -q array'?
TM> I can, but it does not do the same thing that my grep(1)s do.
TM> I want to find FAQs that mention _both_ terms.
You are right. grep is more powerful.
TM> Can you get perldoc to do this:
TM> grep Slice *.pod
TM> ??
Of course I can't but anyway my question was about 'indexes' for
perlfaq.
TM> I never really _use_ perldoc, other than as a shorthand for
TM> pointing out to folks the applicable documentation.
TM> I want more power than perldoc makes available to me.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1532
***************************************