Too much perl, the irony

Posted on Tue 24 June 2008 by alex in geek

I got my current job based on my experience with C/C++ and GTK. So far most of the code I've been writing has been perl and Java. Some times I think I'm writing too much perl:

# Quick and dirty match  for IP (but without the tedious address  # verification)    my $ip_match=qr#([\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3})#i;

The tedious address verification is what I laboured through on one of my Google phone interviews. I'm still not convinced by the argument of doing within the regex, and it will make it the regex so much more ugly and hard to follow. I skipped it here because the data is already verified and all I really need to differentiate from is [d]*.