Narcissist: Difference between revisions

m
→‎{{header|Raku}}: Fix code and comment: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix code and comment: Perl 6 --> Raku)
Line 449:
For the narcissist to work you must be very careful with whitespace. The following version works if it is given to standard input as exactly one line terminated by a newline character.
 
Note how the code takes advantage of Perl 6Raku's ability to nest quoting delimiters.
 
<lang perl6>EVAL my $self = q{say slurp() eq q[EVAL my $self = q{]~$self~q[}]~10.chr ?? q{Beautiful!} !! q{Not my type.}}</lang>
Line 455:
{{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.}}'
$ perl6raku -e "$narcissist" <<<"$narcissist"
Beautiful!
$ perl6raku -e "$narcissist" <<<"$narcissist # a comment ruining it all"
Not my type.
</pre>
2,392

edits