in reply to Re^2: Is it ever legitimate to override $^O ? -- Cwd and File::Spec
in thread Is it ever legitimate to override $^O ?

Ah!

..and Cwd that my spider sense supposed the first to be charged?

while your fakOS.pl behaves the same way for me.. the following Cwd version acts in the opposite way

C:>cat fakeOS.pl BEGIN { $^O = 'Unix'; } use strict; use warnings; use Cwd 'abs_path'; my $abs_path = abs_path('.'); print $abs_path; C:>perl fakeOS.pl C:\EX_D\ulisseDUE C:>perl -MTest::Harness fakeOS.pl C:/EX_D/ulisseDUE

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^4: Is it ever legitimate to override $^O ? -- Cwd
by syphilis (Archbishop) on Aug 03, 2022 at 13:54 UTC
    the following Cwd version acts in the opposite way

    Heh ... that's pretty flakey, too. (I see the same.)

    What I'd like to find is some code where the behaviour changes between perl-5.32 and perl-5.34.
    Apart from t/01-basic.t, everything I've tested (including your fakeOS.pl) is doing the same thing on both of those versions of perl.

    If I take your fakeOS.pl, change $^O = 'Unix'; to $^O = 'MSWin32' and run it on Ubuntu-20.04, I get:
    $ perl fakeOS.pl Use of uninitialized value $abs_path in concatenation (.) or string at + fakeOS.pl line 10.
    and
    $ perl -MTest::Harness fakeOS.pl /home/sisyphus/pscrpt
    Again, however, it's the same behaviour on perl-5.32 and perl-5.34.
    Interestingly, that error message when run without loading Test::Harness hints at being perhaps connected to the failure that t/01-basic.t is triggering on perl-5.34 and later.

    Dunno ... I think I just need to find the time to make one or two bug reports and let the experts sort it out.

    Cheers,
    Rob