SHARE
TWEET

Untitled

a guest Aug 13th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. use feature 'say';
  6.  
  7. sub foo
  8. {
  9.         my $count = 0;
  10.         return (
  11.                 sub
  12.                 {
  13.                         return $count++;
  14.                 },
  15.                 sub
  16.                 {
  17.                         return $count++;
  18.                 }
  19.         );
  20. }
  21.  
  22. my ($a, $b) = foo;
  23. say $a->();
  24. say $b->();
  25. say $a->();
RAW Paste Data
Top