Wednesday, November 17, 2004

New blog template

I've change blog template to Minima (developed by Stopdesign by Douglas Bowman), overall 'cause this template is fairly more similar to general web site look... well I least I think so.

Tuesday, November 16, 2004

I like Perl

There's only one way to learn a language, practise it!. For sure one thing it's to know syntax and a distinct thing it's know logical beside all that stuff...An example, I've review one of my first perl scripts and there I found something like this:

if ( $zone == 1) {
$zone = "01" ;
}

if ( $zone == 2) {
$zone = "02" ;
...
and son on until 9 was converted to 09. As soon as I show code I decide to improve it, I know what I wanna do but I don't know how, then I remenber something like join.

Few minutes later here you got it:

if ( $zone =~/^\d$/ ) {
$new_zone = join '', 0,$zone;
}

I specially like regular expressions 'cause they're very useful, you may use them with perl [perlre: stands for perl+re where re means regular expression], with Vi, inside pure bash shell, by using sed or by commands like grep with -E flag...