in reply to Localized weekday names

Are you sure it's ever worked? As far as I remember the weekday has always been ignored.

In my version of strftime, negative month day is ok, so the fix is easy: just subtract the week day from the month day:

#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use POSIX qw( locale_h strftime ); setlocale( LC_TIME, 'fr_FR' ); my @date = localtime; $date[3] -= $date[6]; my @wd = map { $date[3]++; strftime '%A', @date } 0 .. 6; print "@wd\n";

Note that a single array element is written $date[6], without the at-sign.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Localized weekday names
by Sec (Monk) on Nov 03, 2017 at 15:08 UTC
    Hi,

    I know it worked at one point several years ago. It might've been an older version of FreeBSD having a different strftime implementation.

    And yes, you are completely right calling out the @date[6] mistake. I should know better - to my defense, that code is really old :)

    And yes, your "hack" works great. This enabled me to "fix" it with minimal changes.

    Thanks!