4 ms·
The sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.
by thecoffman 14y ago
The sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.
- raiph 14y agoI am not especially enamored of variable interpolation, but for those that are, Perl 6 does a much cleaner job than Perl 5 imo.
- draegtun 14y agoYou can avoid using temporary variables with the @{[...]} and ${\...} idioms: my $x = 1; say "$x + 1 = @{[ $x + 1 ]}"; sub plus1 { $_[0] + 1 } say "$x + 1 = ${\plus1($x)}";
- hobbified 14y agoWell... arguably they make it easier in the half-dozen simplest cases. Which just happen to be what's needed 90% of the time.