Posts tagged perl

Regexp Kung-fu

There are two answers guaranteed to show up on nearly every PHP question on Stack Overflow - use the mysqli/PDO extension instead of the deprecated mysql one (to avoid SQL injection), and that you can't parse HTML with regular expressions.

With that in mind, my favorite two answers:

  • [How PDO is still vulnerable to SQL injection attacks](http://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injection/12202218#12202218) by Anthony Ferrara
  • [Parsing HTML with regular expressions](http://stackoverflow.com/questions/4231382/regular-expression-pattern-not-matching-anywhere-in-string/4234491#4234491) by Tom Christiansen

The silver searcher is basically ack, rewritten in C to be crazy fast. If you're regularly using grep to search a codebase, this is probably a much better idea.

9th November, 4:49 pm

it's now over 8 years old, but the 12 views of mjd is still good reading

14th April, 3:58 pm

just added a quick little hack over on my code site for finding out which imap folders are using up your quota

25th August, 12:13 pm

the cpan testers matrix is a really good tool (especially for a cpan tool) - an at-a-glance report of how well your various modules are testing (and motivating me to fix the failing ones)

19th July, 10:43 am

i didn't realize there'd be so much movement on rakudo. it's looking pretty snazzy

4th April, 12:15 pm

kellan points out this interesting old TPJ article on problems with localization and gettext. the solution isn't really any good, but the problem is real

9th November, 5:54 am

aside from the final calculation being highly dubious, the perl module dependancy viewer is pretty neat

23rd October, 11:04 am

remotely set the 'ready' message on networked HP printer using some perl. been playing with this in the office to nice effect

15th August, 3:56 pm

ack is awesome [via asc]

26th March, 1:43 pm

get it while it's hot - the perl color ascii art library

15th January, 12:44 am

i need to take a look at the gnupod module to see if i can hook up ipod play counts to lastfm for better stat tracking

21st November, 3:12 pm

higher-order javascript is a nice digression from mjd's higher-order perl [via aaron]

4th November, 8:12 pm

aaron points out the Acme::DRM module. read the method descriptions carefully - brilliant.

10th October, 1:16 pm

annopan is an annotation engine for cpan. part of me is thankful for the service, but i mostly wish search/rt/anno/testers/forum/backpan/ratings were a single product.

2nd July, 12:40 pm

mike b pointed me to this bizarre article from IBM's daniel sabbah describes lamp as "going to have to grow up at some point". err, right. because lamp clearly doesn't scale. it's not like the biggest websites in the world use it. ryan tomayko's response is on the mark.

17th June, 12:05 am

wow. i totally have a debian package. in STABLE ffs.

13th June, 11:50 am

those scamps at oreilly are publishing a perl style guide by sir conway - must be required reading.

9th June, 12:19 pm

schwern's post about JSAN is pretty interesting. especially the loading-direct-from-repos stuff. mmmmm

1st June, 1:09 pm

i'm currently rewriting the X:P:L:T:X module using the CADT model, but i have an excuse. as it, it can't really toke properly and gets too confused. a new tokener is done and seems to be working. just need to tree it and evaluate it.

17th May, 7:08 pm

aaron spotted this little gem of perl wisdom. crazy stuff.

14th May, 5:22 pm

Acme::JavaTrace might actually be a useful acme perl module. oops

28th April, 6:39 pm

i present a short lession in turning RFC BNF into perl regular expressions: Parsing Email Adresses in PHP

6th April, 9:50 am

excellent news - nick clark has started work on ponie again, and there's a detailed roadmap

28th March, 11:05 pm

an excellent slide from autrijus' perl 6 talk at yapc::taipei. i'm going to keep that one in mind for future presentations.

14th March, 3:41 pm

in hammerseley's etcon talk at the moment - he's recommendeing Lip::Pod for documentation love.

1st March, 3:17 pm

aaron points out that cpan search has maintainer independant urls for modules, for even better linkage than version independant ones.

25th February, 4:43 pm

tom insam does good presentation slides. i will bear these in my if i get round to doing slides for etcon.

15th February, 1:18 pm

php in perl. excellent. now to make the flickr core even more confusing ^_^.

4th February, 4:07 pm

a while ago jimmy o'regan wrote a nice article for linux gazette about using flickr with my perl api module.

3rd February, 9:42 am

the porter stemming algorithm in perl - bookmarked for later programming fun.

24th November, 7:46 pm

damien popped up on p6l to talk about parsing of perl6 and gave this excellent one liner:

$parse_tree = ( $source_text ~~ m:keepall/ <Perl.prog> / );

which is very nice - a full adaptive parse tree including comments, whitespace, etc.

15th November, 9:35 am

'it'd be nice if stock Perl 6 ran blazingly with perfectly consistent and flexible semantics, but it's also important to have a knob you can turn up that says "Damn the torpedoes, full speed ahead!"'. larry talks about speed vs features for perl 6.

11th October, 6:50 pm

the flickr mt plugin is pretty awesome, using not only Flickr::API, but also my XML::Parser::Lite::Tree and XPath modules. code resuse strikes again!

6th October, 9:59 am

Inline::Parrot looks like fun. not on cpan yet, but probably will be soon i expect.

27th September, 9:56 am

sean o'rourke points out a nice way to get a perl shell. now why isn't there a Perl::Shell module to do the same thing without all the line noise? a CPAN-esque "perl -MPerl -e shell" would be nice.

20th September, 6:13 pm

a vaguely interesting perl5 oo syntax filter module (though no standard build/install process, which sucks ass). i prefer luke's Class::Closure.

15th September, 12:25 am

a new version of perl6 synopsis 5 (regexps) is out. must read it.

14th September, 3:26 pm

i didnt realise that mjd's perl newbie rants were a segment of yapc 2002 the movie

9th September, 10:05 am

scary goings on in th p6i world - jospeh ryan explains how to inline prolog in perl 6 using macros and the cross-language eval statement.

6th September, 11:40 pm

PAR looks really good. it's a JAR-like packaging system for perl apps. must investigate tomorrow.

1st September, 5:02 pm

a new perl module: XML::Parser::Lite::Tree::XPath . my first foray into xpath backends. docs are here. should reach cpan later today.

26th August, 5:41 pm

playboy run a cpan mirror. bizarre

20th August, 1:58 pm

steve fink is documenting his quest to write a regexp compiler in parrot. the three days logged so far make for interesting reading.

18th August, 1:26 pm

there's a discussion happening on p61 at the moment about multimethod dispatch on return continuations. this sounds like pretty crazy at first, with fungeoid implications, but could lead to some very nice debugging hook oppertunities.

9th August, 12:00 pm

nick clark pointed out acme::intraweb. both a beautiful name and a beautiful implementation. top marks.

22nd July, 10:00 am

pointed out on p6l - xquery uses smilie faces for it's comment delimiters. the current suggestion is that p6 should do the same. even if it doesn't, one could write the grammar for it easily.

19th July, 1:47 pm

the ever-lucid MJD has some advice for newbies in this short video.

29th June, 4:57 pm

a very nice explanation of continuations and saving state: say you're in the kitchen in front of the refrigerator, thinking about a sandwitch. you take a continuation right there and stick it in your pocket. then you get some turkey and bread out of the refrigerator and make yourself a sandwitch, which is now sitting on the counter. you invoke the continuation in your pocket, and you find yourself standing in front of the refrigerator again, thinking about a sandwitch. but fortunately, there's a sandwitch on the counter, and all the materials used to make it are gone. so you eat it. :-) by luke palmer (i'm turning a bit fanboyish)

27th June, 3:35 pm

Class::Closure is a piece of genius from the indispensable luke palmer. it let's you quickly define classes in perl5 using a regular OO syntax, including inheritance, constructors, destructors, properties (private, read only, simple, get/set), methods and autoloading.

About

This is the personal website of Cal Henderson, Slack co-founder & CTO.

I give occasional talks, write code and sometimes articles.

» About Cal

Recent Tags

aws books bools cheese code doge emoji food games havana ibm japan language maps memes minecraft php programming reading regex slack technology via-matts wiring

Popular Tags

apple awesome bacon code coding comics design flickr food games javascript lego maps movie music perl php programming software tech tv video visualization web

Archives

2024: Jan Feb Mar
2023: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2022: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2021: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2020: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2019: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2018: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2016: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2015: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2014: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2013: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2012: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2011: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2010: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2009: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2008: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2007: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2006: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2005: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2004: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2003: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2002: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2001: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2000: Jun Jul Aug Sep Oct Nov Dec