in reply to How would you rewrite this?

I think you're all missing the boat.
>perl -wMstrict -le "my ($chosen_day) = (map { (my $s = $_) =~ s/\s{2}/ /; $s } ('April 1, 2009'))[-1]; print $chosen_day; " April 1, 2009
...is much better. Or else follow JavaFan's suggestion and just write it with one space to begin with!

Replies are listed 'Best First'.
Re^2: How would you rewrite this?
by AnomalousMonk (Archbishop) on Aug 31, 2009 at 05:40 UTC
    Or better yet:
    >perl -wMstrict -le "my $chosen_day = join '', grep /\S/ .. /\s/, split //, 'April 1, 200 +9'; print $chosen_day; " April 1, 2009