[29097] in Perl-Users-Digest
Perl-Users Digest, Issue: 341 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 15 09:10:09 2007
Date: Sun, 15 Apr 2007 06:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 15 Apr 2007 Volume: 11 Number: 341
Today's topics:
Re: Absolute Path errors <hjp-usenet2@hjp.at>
Re: ActiveState vs. "C:\Program Files\" and "C:\Progra~ <sisyphus1@nomail.afraid.org>
Re: ActiveState vs. "C:\Program Files\" and "C:\Progra~ <bik.mido@tiscalinet.it>
Re: How to transparently download multiple files? <purlgurl@purlgurl.net>
Re: How to transparently download multiple files? <cwilbur@chromatico.net>
looking for some size optimization (Marc Espie)
Re: My script to download YouTube videos (critique want <hjp-usenet2@hjp.at>
Re: Need help understanding an Array push <hjp-usenet2@hjp.at>
Re: Need help understanding an Array push <hjp-usenet2@hjp.at>
Re: Regular expression <hjp-usenet2@hjp.at>
Re: Running perl scripts on the fly <paduille.4061.mumia.w+nospam@earthlink.net>
Re: Script to know who clicked a link? <hjp-usenet2@hjp.at>
Re: Top Turds of comp.lang.perl.misc (2007) <cwilbur@chromatico.net>
Re: Top Turds of comp.lang.perl.misc (2007) <cwilbur@chromatico.net>
Re: Top Turds of comp.lang.perl.misc (2007) <hjp-usenet2@hjp.at>
Re: What does 'grep -M' do? <bik.mido@tiscalinet.it>
Re: Where did cgi-bin go? <cwilbur@chromatico.net>
Re: XML::Parse dies hard maxwells@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 15 Apr 2007 11:48:25 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Absolute Path errors
Message-Id: <slrnf23t79.dfm.hjp-usenet2@zeno.hjp.at>
On 2007-04-12 09:56, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> In particular the URL you expect for it does NOT make any sense, for
> http://index.pl is not a reasonable URL in any way.
Oh, it's perfectly reasonable - for a specific server in Poland :-).
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 18:09:24 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: ActiveState vs. "C:\Program Files\" and "C:\Progra~1\"
Message-Id: <4621dd9f$0$16554$afc38c87@news.optusnet.com.au>
"pt" <mnemotronic@gmail.com> wrote in message
news:1176619812.713068.276460@y80g2000hsf.googlegroups.com...
> note: this post started off as a question, but turned into a blog and
> eventually became an answer. I just hate to have anyone else go
> through all this nonsense, so I figured I'd post it as an example of
> "when in doubt, google it out".
>
>
> I successfully installed ActiveState 5.8.8 (after uninstalling
> 5.6.something) on an XP laptop. I installed it to "C:\Program FIles
> \Activestate.com\Perl".
The advice usually offered is to simply not install perl into any directory
containing white space. (There's no need to place perl in any particular
location.)
You're free, of course, to ignore that advice - in which case you can come
up against the issues you have encountered. But if you installed ActivePerl
into, eg, C:\Perl (so that the path to the perl executable is simply
C:\Perl\bin) things should work fine.
> After the install, I changed the "Program
> files" part of the ActiveState dirs in my PATH env var from long DOS
> format to 8.3 format:
> "C:\Program Files\ActiveState.com\Perl\site\bin"
> to
> "C:\Progra~1\ActiveState.com\Perl\site\bin"
Does that location actually exist ? I've never known ActivePerl to create a
perl\site\bin folder.
> and
> "C:\Program Files\ActiveState.com\Perl\bin"
> to
> "C:\Progra~1\ActiveState.com\Perl\bin"
>
> Now, when I attempt to build a CPAN module (BitTorrent), I get:
> <pre>
> C:\blah... \BitTorrent>perl makefile.pl
> Have C:\Progra~1\ActiveState.com\Perl\lib\Config.pm expected C:
> \Program Files\ActiveState.com\Perl\lib\Config.pm
> Your perl and your Config.pm seem to have different ideas about the
> architecture they are running on.
> Perl thinks: [lib]
> Config says: [MSWin32-x86-multi-thread]
> This may or may not cause problems. Please check your installation of
> perl
> if you have problems building this extension.
> Writing Makefile for BitTorrent
> </pre>
>
>
> It *looks* like Perl is just unhappy about the directory rename. I
> changed the PATH back to the original install dir and the new message
> is:
>
> C:\blahblah...\BitTorrent>perl -c Makefile.PL
> Makefile.PL syntax OK
>
> C:\blahblah...\BitTorrent>perl Makefile.PL
> Unable to find a perl 5 (by these names:
> C:\Program Files\ActiveState.com\Perl\bin\perl.exe
> perl.exe perl5.exe perl5.8.8.exe miniperl.exe, in these dirs:
> .
> c:\Program Files\rubyforge.org\ruby\bin
> c:\usr\local\wbin
> C:\Program Files\ActiveState.com\Perl\site\bin
> C:\Program Files\ActiveState.com\Perl\bin
> C:\WINDOWS\system32 C:\WINDOWS
> C:\WINDOWS\System32\Wbem
> c:\progra~1\utils
> C:\Progra~1\apachefriends.org\xampp\MySQL\bin
> C:\Program Files\Perforce
> C:\Program Files\QuickTime\QTSystem\
> C:\PVCS\NT
> c:\progra~1\vslick\win
> C:\Progra~1\nmap \bin
> C:\Progra~1\airsnort\bin
> C:\progra
> .... etc....
>
> So that fixed the one problem, and brough up another. I dug up this
> suggestion:
> http://aspn.activestate.com/ASPN/Mail/Message/activeperl/556006
> and added the PERL line to the Makefile.pl
It has been a long time since I've seen the need to apply that fix ....
probably more than 2 years.
Are you using the latest build (820) of ActivePerl :
perl -e "print $ActivePerl::VERSION"
> That allowed the Makefile to be generated without errors, but running
> it had problems:
> C:\blahblah...\Convert-Bencode-1.03>nmake -f Makefile
>
> Microsoft (R) Program Maintenance Utility Version 1.50
> Copyright (c) Microsoft Corp 1988-94. All rights reserved.
>
> NMAKE : fatal error U1073: don't know how to make 'C:\Program'
> Stop.
>
That's a fairly old version of nmake. There are problems with it, though I'm
not sure that this is one of those problems.
More recent versions of nmake are freely available from Microsoft, but I
don't have a link. You should try to get a more recent version.
(If that's your real email address, you might find a more recent version
turns up in your inbox.)
>
> I modified all instances of "Program files" in the Makefile to
> "Progra~1" and the makefile worked ("test" and "install"). I think
> the next step is to uninstall 5.8.8 and re-install it but specifying
> an install dir of "C:\Progra~1\...etc". I guess this new-fangled
> "Windows" operating system with the pesky ASCII "space" char in files
> and paths is just too much for some people to understand.
>
My understanding is that the "space" shouldn't be posing much of a problem
these days - but I still recommend avoiding directories with spaces, just to
be safe.
You might consider to switching to 'dmake' and the MinGW compiler - both of
which are freely available and work fine with ActivePerl.
Then again ... you could alternatively install Strawberry Perl (
http://vanillaperl.com/ ) - which is a Win32 build of perl that already has
'dmake' and the MinGW compiler bundled with it.
Cheers,
Rob
------------------------------
Date: Sun, 15 Apr 2007 11:45:29 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: ActiveState vs. "C:\Program Files\" and "C:\Progra~1\"
Message-Id: <h4r323d5fhb7m34kpcs8r6qu7kb2ftamcp@4ax.com>
On 14 Apr 2007 23:50:12 -0700, "pt" <mnemotronic@gmail.com> wrote:
>note: this post started off as a question, but turned into a blog and
>eventually became an answer. I just hate to have anyone else go
>through all this nonsense, so I figured I'd post it as an example of
>"when in doubt, google it out".
[snip]
>I successfully installed ActiveState 5.8.8 (after uninstalling
>5.6.something) on an XP laptop. I installed it to "C:\Program FIles
>\Activestate.com\Perl". After the install, I changed the "Program
>files" part of the ActiveState dirs in my PATH env var from long DOS
>format to 8.3 format:
In <http://perlmonks.org/?node_id=583586> the author describes a way
to obtain what are in fact hard links on a ntfs by means of
"Junctions", that may be useful in your case. (Although that node,
that also deals with module installation, mentions it wrt something
else.)
>an install dir of "C:\Progra~1\...etc". I guess this new-fangled
>"Windows" operating system with the pesky ASCII "space" char in files
>and paths is just too much for some people to understand.
Well I'm not that much a big fan of sw made in Redmond, but there's
that little thing called backwards compatibility that tends to hinder
progress. All in all if you take that into account, they've done a
good job. Of course UNIX did it better from start. OTOH, it's somewhat
funny how there you can put any byte but two in a filename, and people
tend not to abuse that, whereas they do under Windows.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 15 Apr 2007 00:14:36 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: How to transparently download multiple files?
Message-Id: <DoqdnQOKXeV8TbzbnZ2dnUVZ_uygnZ2d@giganews.com>
Ed Jay wrote:
> Purl Gurl scribed:
>> Ed Jay wrote:
>>> foo bar baz qux wrote:
>>>> Ed Jay wrote:
(snipped a lot - read thread for context)
>>> For the record, I've asked for help on two or three occasions. On each
>>> occasion I walked away offended by several responses I received (with no
>>> help), except for hints and direction from Purl Gurl that led to both
>>> solutions to my programming issues, and to my better understanding of Perl.
>> The boy is trolling. This "foo bar baz qux" nym shifts then
>> appears for no reason other than to troll. I am his only
>> target of abuse. The boy has some personality disorders.
> I don't think he's the only one trolling. Wink wink.
Many develop a nervous eye twitch upon learning more about me.
> He's also not the only one guilty of nym shifts.
I'll say. There are some here, over the years, who have appeared
as twenty to thirty different people. This is truly a trollfest
discussion group. These boys here take turns nym shifting then
trolling each other.
> Out of pure boredom I searched your posting history on google groups. You've
> been on a couple of interesting paths. Amazing...simply amazing.
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I --
I took the one less traveled by,
And that has made all the difference.
(from The Road Not Taken, Robert Frost)
> Perl the religion, e.g., don't use 'strict.' I can especially understand it
> when you laugh and play your fiddle and they get caught up in your bait.
Perl the cult, Jim Jones style; Kool-Aid drinkers, one and all.
Actually, I am a professional cellist.
For trivia, the strict module is a broken module. Strict usually
causes more than problems than solved. Worst module is Stein's
CGI.pm module. You will learn of how screwed up is Perl as you
move into more advanced studies. Do not expect any of these
self-proclaimed gods of Perl around here to clue you on they
and others like them performed anal intercourse upon Perl.
> BTW, I'll say one thing for your oftentimes verbose posts, you're an
> excellent writer. :-)
I am an English professor. My specialty is Creative Writing.
I am also a Choctaw translator and a Choctaw language teacher.
Life blessed me with being born American Indian for which I
am forever grateful. Of interest, Choctaw is my native tongue.
These boys around here, pffttt... I write Perl program circles
around their pointy little sissified geek heads. Here is an
article from long ago which provides a good hint about the
type of people are these gods of Perl.
http://groups.google.com/group/comp.infosystems.www.authoring.cgi/msg/bbe090cbc5d4c42e?dmode=source&hl=en
If you would like a matching set of eye twitches, read me over
in the alt.usage.english discussion group.
Purl Gurl
------------------------------
Date: 15 Apr 2007 07:06:20 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: How to transparently download multiple files?
Message-Id: <87ps656gnn.fsf@mithril.chromatico.net>
>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
EJ> BTW, I'll say one thing for your oftentimes verbose posts,
EJ> you're an excellent writer. :-)
Logorrhea should not be mistaken for excellence.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Sun, 15 Apr 2007 12:22:17 +0000 (UTC)
From: espie@lain.home (Marc Espie)
Subject: looking for some size optimization
Message-Id: <evt5dp$24ar$1@biggoron.nerim.net>
I'm looking at a script that handles a huge amount of data... basically,
the filenames from +4000 packages in order to recognize conflicts.
Currently, it builds a big hash through a loop that constructs
$all_conflict like this:
my $file= File::Spec->canonpath($self->fullname());
push ${$all_conflict->{$file}}, $pkgname;
I end up with a hash of 250M.
I can't really use Devel::Size with any benefit, since all the data
is one single chunk (all the other data in the program amount to <2~3M)
I expect the $pkgname strings to be shared. In fact, I tried replacing
$pkgname with \$pkgname, with negative size results (+20M).
I've tried splitting the path along `frequent' directories, with inconclusive
gains (most of the files live under /usr/local, /etc, or /var/www):
-20M at most.
I'm looking for bright ideas to try and reduce the size used... without
being too detrimental in terms of speed...
------------------------------
Date: Sun, 15 Apr 2007 12:42:55 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: My script to download YouTube videos (critique wanted)
Message-Id: <slrnf240df.dfm.hjp-usenet2@zeno.hjp.at>
On 2007-04-11 20:00, usenet@DavidFilmer.com <usenet@DavidFilmer.com> wrote:
> On Apr 11, 12:23 pm, Purl Gurl <purlg...@purlgurl.net> wrote:
>> [snip a bunch of stupid inane benchmarking crap]
>
> So if you gotta do something TEN MILLION times and really, really need
> to shave ONE OR TWO SECONDS off that process then, sure, skip the
> my().
If you have a loop that does so little that creating and destroying a
variable inside the loop makes a noticable difference, you can move the
my() outside of the loop without harming the readability (much). Or you
could use $_ as a "scratch buffer" which is even a bit faster in Purl
Gurls example (although I don't understand why and I won't claim that
this is generally the case).
> In fact, why use Perl at all, if time is such a critical
> consideration? C++ would be faster, and assembler would be faster
> still.
Yep.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 11:02:49 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Need help understanding an Array push
Message-Id: <slrnf23qhp.dc3.hjp-usenet2@zeno.hjp.at>
On 2007-04-10 16:14, J. Gleixner <glex_no-spam@qwest-spam-no.invalid> wrote:
> Paul wrote:
>> Need help understanding what this section of Perl code does:
>>
>> 1: foreach(@list) {
>> 2: ($filenm,$fld_type,$content) = (split /\"/)[1,3,5];
>> 5: push(@{$listcontent{"$filenm\{\{\{$fld_type"}},$content) if
>> ($fld_type);
>> 6: }
>> [snip]
>> 7: foreach(sort keys %listcontent) {
>> 8: ($newfilename, $fld_type) = split /\{\{\{/;
>> [...]
>>
>> new arrangement of the data pulled out of the other array. I don't
>> get what the open curly braces are doing.
> No idea. It's the key to the hash, but why someone chose that format
> is only known to you and the person who wrote it, based on this
> small piece of code, it's not needed.
>
> push(@{$listcontent{"$filenm:fld_type"}},$content) if $fld_type;
I think you omitted a $ before fld_type here.
> then later..
>
> my ($newfilename, $fld_type) = split /:/;
What if there is a ":" in a file name?
> No idea why you'd have "\{\{\{" in there either. Poor choice of
> separator, IMHO.
The programmer of the script probably thought that "{{{" was very
unlikely to appear in a filename, whereas simpler separators like ":"
might appear. He also seems not to have been aware of real or pseudo
multidimensional hashes. I would have written that as:
push(@{ $listcontent{$filenm}{$fld_type} }, $content) if $fld_type;
and if I've had a good reason to "flatten" the hash (e.g., memory
consumption) then I'd have used a pseudo multidimensional hash:
push(@{ $listcontent{$filenm, $fld_type} }, $content) if $fld_type;
This is also just joins $filenm and $fld_type with a separator, but
that separator ($; (or $SUBSEP if you "use English;"), by default
"\034") is even less probable in a filename and it's already there for
that purpose so the reader doesn't have to think why "{{{" was chosen.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 11:07:17 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Need help understanding an Array push
Message-Id: <slrnf23qq5.dc3.hjp-usenet2@zeno.hjp.at>
On 2007-04-10 16:30, John W. Krahn <someone@example.com> wrote:
> Paul wrote:
>> Hello there. I'm new to Perl and am trying to maintain a large
>> complex script that generates some reports based on some text input
>> files.
[...]
>> Need help understanding what this section of Perl code does:
>>
>> 1: foreach(@list) {
>
> Why are you reading in the whole file into an array? Is it really
> required?
Just a bit of stylistic nitpicking:
I think Paul made it rather clear that he didn't write the script but is
trying to understand a script written by someone else. So asking "Why
are YOU reading ..." seems a bit inappropriate here.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 12:05:41 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Regular expression
Message-Id: <slrnf23u7l.dfm.hjp-usenet2@zeno.hjp.at>
On 2007-04-10 21:17, guillaume.carbonneau@gmail.com <guillaume.carbonneau@gmail.com> wrote:
> On Apr 10, 4:43 pm, 4i4ko Trevi4ko <4i4ko_trevi...@hui.de> wrote:
>> On Tue, 10 Apr 2007 15:41:25 -0500, J. Gleixner wrote:
>> > sk wrote:
>> >> I m trying to add a extra keyword on a specific word in a html
>> >> document In the following document I want to put "My" in front of
>> >> all the words"computer" excluding the id for the stylesheet and
>> >> name of image files.
>>
>> >> <html>
>> >> <head>
>> >> <title>hello</titile>
>> >> </head>
>> >> <body>
>> >> <div id="computer"> This is computer</div>
>> >> <img src="images/computer.jpg" >Computer
>> >> </body>
>> >> </html>
>>
>> > s/\scomputer/ My computer/;
>>
>> will not work on:
>> <img src="images/computer.jpg" >Computer
>
> I got it through 2 regular expressions. Maybe someone can help me
> merge them together...
>
> $string =~ s/(>.*)(computer)(.*<)/\1my \2\3/igms;
That will match
$1: From the first ">" to the ">" in the img tag in line 7.
$2: "Computer" in line 7
$3: From the newline after "Computer" to the opening "<" in
"</html".
In other words it will only replace the last "Computer" in the file.
The "g" is ineffective, since there can be only one last "computer".
The "m" doesn't seem to have any effect either.
> $string =~ s/(>.*)(computer)(.*<)/\1my \2\3/ig;
This will replace any "computer" after a ">" and before a "<" on the
same line. In the example file there is only one "computer" left which
matches that criterion, but that doesn't seem guaranteed.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 07:33:12 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: Running perl scripts on the fly
Message-Id: <YykUh.3597$3P3.1987@newsread3.news.pas.earthlink.net>
On 04/14/2007 05:42 PM, jrosik@gmail.com wrote:
> Hi all,
>
> I would like to run perl scripts as in the following scenario:
>
> 1. I open a text editor - for example Notepad, Wordpad, Word.
> 2. I paste some text into this text editor.
> 3. I press a magic key - let's say I double press the Shift key.
> 4. A magic window appears and I enter the following script:
> while (<>) {
> s/you/You/;
> print;
> }
> 5. I execute the script.
> 6. Now there are two text editor windows - one with the source text
> and another with the output text.
>
> Is this possible?
>
> One note: I have not saved any document during my scenario!
>
> Regards,
> Jiri Rosicky
>
It sounds like you want an IDE (Integrated Development Environment) for
Perl. Do a yahoo search for it.
However, the Perl debugger might suffice for some of your needs, e.g:
C:\> perl -de 42
Read the "perldebug" document:
Start->Run->"perldoc perldebug"
HTH
--
Count the YOYOs:
http://home.earthlink.net/~mumia.w.18.spam/games_fever/
------------------------------
Date: Sun, 15 Apr 2007 13:04:02 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Script to know who clicked a link?
Message-Id: <slrnf241l2.dfm.hjp-usenet2@zeno.hjp.at>
On 2007-04-11 22:13, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On 11 Apr 2007 12:44:51 -0700, "PGPS" <premgrps@gmail.com> wrote:
>>Assume that I know how to extract this name from the page.
>>
>>When he clicks on this link (javascript probably), it appends his name
>>to the link and sends a query like what you stated in your message
>>http://www.example.com/cgi-bin/stuff.cgi?name=DavidFilmer
>>
>>
>>Any ideas?
>
> Yes: it depends on the actual forum. And yes: you probably want to do
> this in JS if the site permits that
Which forum would allow that (I mean intentionally - of course lots of
forums don't sanitize their input properly)? I'd certainly give such a
site a wide berth.
> - it's obvious that this must be done on the client of the person who
> clicks the link!
Or on the server where the link resides. Doing something like
print a({-href => ("$url?name=" . remote_user)}, click here)
is easy. But of course you can do that only on your own server(s).
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: 15 Apr 2007 06:52:23 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Top Turds of comp.lang.perl.misc (2007)
Message-Id: <87y7kt6haw.fsf@mithril.chromatico.net>
>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
EJ> As a struggling Perl newbie, I derive little encouragement to
EJ> pursue my education from your statements. Perhaps it's time
EJ> for me to go down a different programming path while I'm still
EJ> embryonic.
If you take Purl Gurl seriously, you ought to be encouraged to go down
a different career path altogether.
EJ> Perl isn't offered in the BSc/CS curriculum? That speaks
EJ> loudly to me. I tried to take a course in Perl at my local
EJ> junior college, but it's not offered.
That's because the educational curriculum focuses on tools that
attempt to inculcate good programming habits or that demonstrate
particular techniques. Perl does neither.
Your goal in acquiring an education (which is what a BS is) ought to
be to acquire a solid grounding in the theory underlying your
profession. If you want vocational training in particular languages
-- which is not what a BS is about -- there are a number of excellent
consultancies that will teach you, whether the language in question is
Perl or Java.
EJ> How profoundly rude, indeed! Having lurked here for a couple
EJ> of months, the offensive response was expected from the NG
EJ> regular. As are set of similar comments, by many of the people
EJ> in the OP's list. Look at the blatant hypocrisy in the
EJ> above. Does anyone really think that this type of response
EJ> provides assistance or fosters a desire to further participate
EJ> in this forum? Or, to learn and perpetuate this programming
EJ> language?
I recommend, first, that you pay attention to the Posting Guidelines,
and pay attention to how many people who follow the Posting Guidelines
get flamed and treated rudely compared to how many people who do not
follow them. There's a reason they exist.
I recommend, second, that if you intend to continue in any technical
field, that you develop the skill to learn by yourself by studying the
documentation. If you develop that skill, you are responsible for
your own success; if you fail to develop that skill, you make yourself
permanently dependent on the benevolence and donated time of others.
In situations where neither is available in sufficient quantity --
such as this newsgroup -- you lose out.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: 15 Apr 2007 07:00:35 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Top Turds of comp.lang.perl.misc (2007)
Message-Id: <87tzvh6gx8.fsf@mithril.chromatico.net>
>>>>> "UG" == Uri Guttman <uri@stemsystems.com> writes:
UG> oh, i don't hate moronzilla. i hate what it stands for. i am
UG> appalled that my chosen profession is so easy to enter with so
UG> little actual skill. you wouldn't hire a doctor or lawyer with
UG> the level of skills you see in newbies or moronzilla. and too
UG> many of them work and screw things up and i am brought it to
UG> help clean up the mess. better to hire someone who knows what
UG> they are doing to begin with than cheap kiddies who are always
UG> over their heads. that is what i despise.
It's hardly surprising.
To call yourself a doctor, you need several years of education,
professional certification, and a current license. If you act as a
doctor without all of these things, you go to jail. If you do the
wrong thing as a doctor when you should have known otherwise, you pay
considerable money as damages.
To call yourself a lawyer, you need several years of education,
professional certifiation, and membership in a professional legal
association. If you act as a lawyer without all of these things, you
are heavily fined, or you go to jail. If you do the wrong thing as a
lawyer when you should have known otherwise, you are heavily fined, or
you go to jail.
To call yourself a computer programmer, you don't even need to be able
to operate the computer. You can get hired and paid as a computer
programmer with no qualification whatsoever, and you can continue in
the job regardless of skill. If you do the wrong thing as a computer
scientist when you should have known otherwise, you get promoted to
management and given a bigger budget.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Sun, 15 Apr 2007 14:58:41 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Top Turds of comp.lang.perl.misc (2007)
Message-Id: <slrnf248c1.dtb.hjp-usenet2@zeno.hjp.at>
On 2007-04-14 07:34, Ed Jay <edMbj@aes-intl.com> wrote:
> On 16 Mar, "The Count" wrote:
>>Im a BSc4 Maths/Computer Science student and would like to find out
>>the best way to learn programming in perl.Perl is not offered in my
>>course but I find that it is a very popular language.I can program in
>>Pascal,Delphi and C++...
>
> Perl isn't offered in the BSc/CS curriculum? That speaks loudly to me.
Doesn't speak at all to me. When I was at the university, there wasn't
a single course in the curriculum which was touted as a "language
course". Of course you learned Modula II in the "introduction to
programming" course and you learned C in the "systems programming"
course for the simple reason that these were the languages which you
had to use for the exercises, but that wasn't the actual goal of the
course, and the choice of language certainly wasn't that the language
should be in wide-spread use in "the industry". I don't think Modula was
much used outside of academia at the time, while (Turbo) Pascal or Basic
were quite popular (and I don't think there was a Basic course on the
whole university. The electrical engineers used Pascal for their
programming 101 course). The only language which we were "strongly
encouraged" to learn because we "would need it" was COBOL. Never needed
that again :-).
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Apr 2007 11:11:04 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: What does 'grep -M' do?
Message-Id: <afq3235e9dbkvtqakhmc0ntlrl46e31tst@4ax.com>
On 14 Apr 2007 17:42:08 -0700, "grocery_stocker" <cdalten@gmail.com>
wrote:
>Subject: What does 'grep -M' do?
I was about to point out that Perl's grep() is not the command line
grep(1) utility...
># get files older than three days
>my @files = grep -M > 3, readdir $dh;
But then I see you actually meant Perl's grep().
>What does grep -M do?
You're just confused, it's NOT
grep -M
It's
grep EXPR, LIST;
where EXPR happens to be
-M > 3
-M is a function with a somewhat exotic name. As others have put it,
more concisely, look it up in
perldoc -f -X
>Is this a perl option for grep?
Nope. As you can see, if you considered it an "option", then you would
be left with an unbalanced '> 3'. (Of course, if it were a shell, then
you may have interpreted it as a redirection. But this is NOT a
shell.)
Perl 5 does not have "options" of this kind. Perl 6 does, in the form
of adverbs, but they have a different syntax.
>I don't see this
>option when I look up grep on the unix man pages. I tried searching
So, you DID actually confuse the two things: you're not finding it
there. The grep(1) utility documented in the man pages is NOT Perl's
grep. For info about the latter, you have to fire up
perldoc -f grep
>google and found nothing.
Not surprising. You have two othogonal things: a function, and
another, unrelated function. You can mix them together, just like you
can mix sin() and abs() together in
my $thingy=sin abs $angle;
But I doubt you will find specific information about 'sin abs'.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 15 Apr 2007 06:38:49 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Where did cgi-bin go?
Message-Id: <873b317why.fsf@mithril.chromatico.net>
>>>>> "M" == Milagro <Milagro> writes:
M> Yes, I do realize that cgi-bin was not magic. I'm just curious
M> as to why we don't see it anymore in URLs. This is indeed NOT a
M> perl question and I apologize. I'm also posting to an apache
M> newsgroup.
In the early days of the web, putting executable files in a cgi-bin
directory on a shared host was a way of having webmasters review them
before publication. There was a clear distinction between static
pages and scripts, and scripts went in the cgi-bin directory in order
to mark them as executable rather than static. Sites on which the
admins trusted the users might allow executable content anywhere,
marking it by a particular extension such as .php or .cgi.
More recently, with the advent of templating systems, it has become
likely that *every* page has dynamic content; and with better web
servers and better administrative tools, there's little advantage to
isolating all the dynamic content in one directory.
Your principal mistake is confusing cgi-bin directories with Perl content.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: 15 Apr 2007 02:33:30 -0700
From: maxwells@gmail.com
Subject: Re: XML::Parse dies hard
Message-Id: <1176629610.752430.213370@y5g2000hsa.googlegroups.com>
Thanks, Brian.
I got it to work thus:
use XML::Parser;
my $checker = new XML::Parser ( Handlers => { } );
my $stream = "<foo id=\"me\"Hello World</foo>";
eval { $checker->parse($stream); };
if ($@) { print "uh oh";
die; }
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 341
**************************************