perlpal has asked for the wisdom of the Perl Monks concerning the following question:
Recently i came across code which looks like this
my $code = << 'ET'; { --- Some lines of code --- } ET test($code);
From what i can make out is the variable $code holds the code snippet terminating at ET. Am i correct ?
What is the use case/advantage of this implementation ?
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Assigning Perl code snippet to a variable
by ungalnanban (Pilgrim) on Mar 02, 2010 at 06:27 UTC | |
|
Re: Assigning Perl code snippet to a variable
by Anonymous Monk on Mar 02, 2010 at 08:59 UTC |