in reply to Interesting line which I read from Monk's snippets
If I am calling the script from far away (for example in windows: C:\perl\bin\eraseme.pl) , then $0 has also the path attached to the name... ($0 eq 'C:\perl\bin\eraseme.pl'). So, it would not work as expected.
I should first, get rid of the path...
UPDATE: see a better way with liverpole's comment.$0=~s/^.*[\\\/]//;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Interesting line which I read from Monk's snippets
by liverpole (Monsignor) on Feb 03, 2006 at 12:30 UTC |