in reply to Re: Different behavior when parsing $0 on Solaris and Win32
in thread Different behavior when parsing $0 on Solaris and Win32

you are replacing the complete part after the first dot in the script path and replace it by .log
Good point. And here is one way of calling the script to reproduce the OP's result:
$ ./my_script_name.pl .log
Perhaps the OP has invoked the script differently on the 2 OS's.

Replies are listed 'Best First'.
Re^3: Different behavior when parsing $0 on Solaris and Win32
by dirac (Beadle) on Sep 28, 2011 at 13:23 UTC

    yes, this is exactly what happens, even setting PATH with the current dir and invoking with:

    $ my_script_name.pl

    The value of $0 is still the same:

    ./my_script_name.pl