Withigo has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
Several times I've found myself wishing I could indent the string that terminates a HEREDOC in order to align the entire HEREDOC with its containing sub/block(and also for nefarious-but-inspiring obfuscation & japh purposes).
i.e.,
Thanks!
Several times I've found myself wishing I could indent the string that terminates a HEREDOC in order to align the entire HEREDOC with its containing sub/block(and also for nefarious-but-inspiring obfuscation & japh purposes).
i.e.,
Is this trivial enough to be capable of being added to perl5? Hopefully it'll be an option in Perl 6. But in the mean time, does anyone know if there's a source filter that accomplishes this?if ($foo) { print <<STRING; foo is $foo. STRING }
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Indented HEREDOC?
by Ovid (Cardinal) on May 26, 2006 at 07:46 UTC | |
by reasonablekeith (Deacon) on May 26, 2006 at 08:41 UTC | |
by Ovid (Cardinal) on May 26, 2006 at 23:27 UTC | |
Re: Indented HEREDOC?
by kudra (Vicar) on May 26, 2006 at 07:10 UTC | |
Re: Indented HEREDOC?
by LanX (Saint) on Mar 20, 2018 at 17:51 UTC | |
Re: Indented HEREDOC?
by lidden (Curate) on May 26, 2006 at 07:07 UTC | |
Re: Indented HEREDOC?
by mantadin (Beadle) on May 26, 2006 at 09:24 UTC | |
Re: Indented HEREDOC?
by vek (Prior) on May 26, 2006 at 17:44 UTC | |
Re: Indented HEREDOC?
by YuckFoo (Abbot) on May 26, 2006 at 22:43 UTC |
Back to
Seekers of Perl Wisdom