http://qs321.pair.com?node_id=712678


in reply to ISO 8601 week number

Or the really easy way...

use DateTime; print DateTime->now->week_number,"\n";

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^2: ISO 8601 week number
by larryk (Friar) on Mar 28, 2014 at 11:15 UTC
    And nowadays the same thing with a core module

    perl -MTime::Piece -e "print localtime->week"

       larryk                                          
    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
    
Re^2: ISO 8601 week number
by wol (Hermit) on Sep 21, 2008 at 11:14 UTC
    I'll vote for that.

    Sigh. I don't know how long I looked for a simple solution before I gave up and wrote one, but somehow I never saw the DateTime option. Still, I think it's worth publishing the algorithm, even if it's only a benefit for people who need to implement it in something other than perl...

    I might simplify some code next week.

    PS - I wonder why I can see the module on CPAN, but not via PPM in any of Active's repositories