in reply to Re^2: get current script as text
in thread get current script as text
mmh... Your code don't show nothing in my computer (?)
My code should work fine anywhere. Post the exact code you are using that is failing.
open (my $foo, $0); print $foo; close $foo; What I'm doing wrong?
You are never reading from the file you opened.
You are printing the filehandle you opened.
Perhaps you meant:
open (my $foo, $0); print <$foo>; close $foo;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: get current script as text
by pvaldes (Chaplain) on Apr 24, 2012 at 15:46 UTC |