in reply to Different behavior when parsing $0 on Solaris and Win32
Works for me with
This is perl, v5.8.4 built for i86pc-solaris-64int (with 32 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall
But note that you are not really taking the script name, you are also potentially taking the whole path to the script name. And you are not replacing the end of the script name by .log but you are replacing the complete part after the first dot in the script path and replace it by .log. I would do it this way:
(my $logname = $0) =~ /\.pl$/.log/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Different behavior when parsing $0 on Solaris and Win32
by toolic (Bishop) on Sep 28, 2011 at 12:53 UTC | |
by dirac (Beadle) on Sep 28, 2011 at 13:23 UTC | |
|
Re^2: Different behavior when parsing $0 on Solaris and Win32
by dirac (Beadle) on Sep 28, 2011 at 13:35 UTC |