in reply to Trouble Chaining map function

You can always replace a foreach with a map by putting the complete loop body (including print and other maps) into the map and the list after.

But your test for uniqueness is overly complicated and buggy in edge cases.

Better just take simply the keys if %h and sort them.

But if I were you I'd hardcode the weekdays into an array anyway.

Cheers Rolf

(addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^2: Trouble Chaining map function
by jaypal (Beadle) on Jun 15, 2014 at 00:42 UTC

    Thanks Rolf, I will play around with your suggestions and update you if I come up with something interesting.