line noise

gav on 2003-02-10T23:02:26

I had to confess to writing this:

if (s/^\((.+)\)$/$1/) {
    s/\\\|:/ /g; 
    s/[:|\\]//g; 
}
It kind of makes my eyes hurt a bit. Who says Perl looks like line noise? :)


A bit cleaner (and probably faster ;-)

belg4mit on 2003-02-11T02:11:54


if( /^\(/ && /\)$/ ){
    $_ = substr($_,1,-1);
    s/\\\|:/ /g;
    y/:|\\//d;
}

Re:A bit cleaner (and probably faster ;-)

belg4mit on 2003-02-11T02:14:53

Damn, the buttons are in a different order
than the monastery. The if statement could
arguable be cleaner with use of index and
rindex.

Button, button, whose got the button?

Ovid on 2003-02-13T00:48:27

Damn, the buttons are in a different order than the monastery.

I've been bitten by that one more than one occassion :)