in reply to get current script as text
The following snippet will put the code of the current top-level script into a variable:
my $codeAsText = do{ local( @ARGV, $/ ) = $0; <>; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: get current script as text
by pvaldes (Chaplain) on Apr 24, 2012 at 14:45 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2012 at 14:51 UTC | |
by pvaldes (Chaplain) on Apr 24, 2012 at 15:46 UTC | |
|
Re^2: get current script as text
by vlad_tepesch (Acolyte) on Apr 24, 2012 at 14:13 UTC | |
|
Re^2: get current script as text
by BillKSmith (Monsignor) on Apr 24, 2012 at 23:01 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2012 at 23:42 UTC |