News for hackers. Stuff that matters.
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)}";

There are no comments on this comment yet.