Narcissist: Difference between revisions
→{{header|Perl 6}}: avoiding single quotes so we don't need shell escape + using actual proposal in comment
m (→{{header|Perl 6}}: A note about non-cheating.) |
(→{{header|Perl 6}}: avoiding single quotes so we don't need shell escape + using actual proposal in comment) |
||
Line 137:
=={{header|Perl 6}}==
For the narcissist to work you must be very careful with whitespace. The
Note how the code takes advantage of Perl 6's ability to nest quoting delimiters.
<lang perl6>eval my $self = q{say slurp() eq
{{out}}
<pre>$ narcissist='eval my $self = q{say slurp() eq q[eval my $self = q{]~$self~q[}]~10.chr ?? q{Beautiful!} !! q{Not my type.}}'
Beautiful!
$
Not my type.
</pre>
|