KBD

Keith Devens .com

Friday, August 29, 2008 Flag waving
Ever wish you could freeze frame a moment in your day, and look at it and say "this is not... – Daniel (Mrs. Doubtfire)
← EvolutionPython rocks, yet again →

Daily link icon Thursday, June 12, 2003

Perl is difficult to program correctly in

While Perl has a lot of stuff built in to make a programmer's job easier (such as automatic memory management, etc.), for some reason I find it extremely hard to program correctly in Perl. It seems like, for me, it's much harder to get things right in Perl than in PHP or Python.

God, and I'm having to cut and paste large sections of code just so I can replace braces {} with brackets [] because Perl's syntax changes based upon the type of a variable, which is just wrong.

Well, it seems that judicious use of references can alleviate that particular problem...

← EvolutionPython rocks, yet again →

Comments XML gif

steve (http://radio.weblogs.com/0125938/) wrote:

With .net supporting Perl 5 style regex, I wonder why we still need Perl. Do we?

∴ steve | 13-Jun-2003 4:38pm est | http://radio.weblogs.com/0125938/ | #2179

Keith (http://www.keithdevens.com/) wrote:

Well, I'm really looking forward to Perl 6.

For some things, Perl can't be beat. It's great for hacking a quick script together - it fits everywhere and runs on everything, and has a whole bunch of libraries available. But, for anything more than like 20-40 lines, Perl would not be my choice Smiley

However, I must make a disclaimer: I'm not a Perl expert. If I programmed in it all day every day for a month maybe I'd learn ways around all the crap in it. But, I don't think so, and from hearing what people often say who have done a lot of Perl programming, they have completely the opposite reaction - the longer you use it, the more its warts weigh on you.

Oh, by the way, Perl 6 "regexes" are going to rule.

Hmm... one more comment. It's not that .NET has good regexes now so you should always use that over Perl. Just use whatever's most appropriate for the job, and what you're most comfortable with.

Keith | 13-Jun-2003 5:08pm est | http://www.keithdevens.com/ | #2180

raptor wrote:

steve,
well some of us don't use Windows u know :"), and the new Perl6 "rules" will rule over all the implementations of regexes as u know it..

And it is written compatible which I havent tried to be sure they are really compatible... what I mostly mean is that they will probably not implement the advanced features like lookahead, lookbehind etc...

http://www.perl.com/pub/a/2003/07/01/regexps.html

And my favorite recursive regex :") from
http://www.perl.com/pub/a/2003/06/06/regexps.html

$paren = qr/
\(
(
[^()]+ # Not parens
|
$paren # Another balanced group
)*
\)
/x;

it your turn :")

∴ raptor | 12-Jul-2003 9:50am est | #2409

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

August 2008
SunMonTueWedThuFriSat
 12
3456789
10111213141516
17181920212223
24252627282930
31 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

new⇒Johnny Walker Blue Label

Wow, thanks for the scotch review​:D

Lagavulin and Laphroaig are​some of...

Keith: Aug 29, 3:35pm

Girls, please don't get breast implants

Wow, After all this time, the​comments on this page continue to​grow. It wa...

Ajeet: Aug 25, 2:36am

Generated in about 0.138s.

(Used 8 db queries)

mobile phone