in reply to Re: What is your Perl dialect?
in thread What is your Perl dialect?

* When writing recursive routines I usually use a named wrapper and then an anonymous sub to do the recursion
<plug>Why, what a perfect situation for Sub::Lexical</plug>
* I often use pack, as well as s///e
What situations do you find yourself using s///e? I can't say I've ever used it anything outside golf and obfu so where does it fit into your day-to-day coding?

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Re: What is your Perl dialect?
by demerphq (Chancellor) on Feb 14, 2003 at 16:35 UTC

    <plug>Why, what a perfect situation for Sub::Lexical</plug>

    *Blush* I have meaning to check that out for a while... Ill have looksee when i get a minute. :-)

    What situations do you find yourself using s///e? I can't say I've ever used it anything outside golf and obfu so where does it fit into your day-to-day coding?

    I do a lot of data transformation type tasks. So it comes in useful quite regularly. Having said that I can't remember exactly where I used it last, but I do recall that I used it fairly recently.

    ---
    demerphq


    • Update:  
    Heres an (untested) simplified example of where s///e comes in useful

    $date=~s/^(\d+)-(\d+)-(\d+)$/sprintf('%04d/%02d/%02d',$1,$2,$3)/e or die "Failed to normalize date...";