in reply to Re^2: The date last monday
in thread The date last monday

Sorry I missed the drift of your OP. No, you are not asking too much at all. You need to transform the array slice using a map, like this

perl -e 'printf qq{%4d%02d%02d\n},map{$_->[0]+1900,$_->[1]+1,$_->[2]}[ +((localtime(time-((1-(localtime(time))[6])* -86400)))[5,4,3])];'

Note that the slice is passed into the map as an anonymus list.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^4: The date last monday
by Scarborough (Hermit) on Oct 03, 2006 at 11:56 UTC
    Thanks for the help, I finally understand map the missing link for me.

    Glad I felt like a challange this morning.
Re^4: The date last monday
by davorg (Chancellor) on Oct 03, 2006 at 11:54 UTC
    Note that the slice is passed into the map as an anonymus list.

    <pedant>You mean an anonymous array.<pedant>

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      That's always confused me, thanks for pointing me at the relevant document. I had the mistaken idea that the distinction was whether the array held similar things like (1, 3, 4) or the list held different sorts of thing like ("fred", 27, "male"). By that standard calling it an anonymous list was still wrong, doh!

      Cheers,

      JohnGG