in reply to Re^4: object version does not match
in thread object version does not match

I don't know why but on macOS you can type perldoc data::dumper and it will work, but on Linux you must spell it Data::Dumper

Or simply use the -i flag as intended:

$ perl -E 'say $^O' linux $ perldoc -i data::dumper | head NAME Data::Dumper - stringified perl data structures, suitable for both printing and "eval" SYNOPSIS use Data::Dumper; # simple procedural interface print Dumper($foo, $bar); $

🦛

Replies are listed 'Best First'.
Re^6: object version does not match
by Anonymous Monk on May 10, 2024 at 20:02 UTC
    >> I don't know why but on macOS you can type perldoc data::dumper and it will work, but on Linux you must spell it Data::Dumper

    > Or simply use the -i flag as intended

    You can do that but the point of my demonstration is that perl seems kinda buggy on a case insensitive file system because there are no warnings nor failures due to mis-capitalized module names.

      Perl did what you told it to by saying use data::dumper:
      • find in @INC a data/dumper.pm (the OS showed one exists)
      • load it (worked)
      • import from that namespace (didn't work because that file doesn't define exactly that namespace and Perl isn't case-forgiving)
      It's a problem inherent to case-insensitive (Windows as far as I know) and case-forgiving (MacOS as far as I know) OSes.
        Thanks for breaking it down. Maybe perldoc was a bad example. What seems mysterious (buggy) to me is how my module breaks at the command line, because "use lib" points to a folder with the wrong version of B at b.pm, but somehow it still works with the morbo http server. Is it possible that Mojo::Server::Morbo uses the correct version of B and that overrides my "use lib" and the bogus b.pm it puts in @INC?