Re:Why Did I Choose Perl When Building Crowdtilt?
by thecoffman on Friday August 31, 2012 @07:20PM
(#4462112)
The sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.
[ Parent
| on HN ]
Re:Why Did I Choose Perl When Building Crowdtilt?
by draegtun on Saturday September 01, 2012 @07:04AM
(#4463366)
You 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)}";