in reply to Perl 6 strings, interpolation and templates?
say "Hello @{[ join(', ', @names) ]} how are you?";
There's no security issue because it's not say that causes the interpolation, it's the string literal. And it's no more possible for someone to provide a string literal as they could provide a for loop.
use strict; use warnings; use 5.010; my @names = qw( ikegami ); say "Hello @{[ join(', ', @names) ]} how are you?"; my $user_input = q{Hello @{[ join(', ', @names) ]} how are you?}; say $user_input;
Hello ikegami how are you? Hello @{[ join(', ', @names) ]} how are you?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl 6 strings, interpolation and templates?
by BerntB (Deacon) on Mar 15, 2009 at 00:46 UTC | |
by almut (Canon) on Mar 15, 2009 at 01:03 UTC | |
by BerntB (Deacon) on Mar 15, 2009 at 01:08 UTC |