Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zoffixznet/9f5010d69b6ccc41024c9a4eb50e75b0 to your computer and use it in GitHub Desktop.
Save zoffixznet/9f5010d69b6ccc41024c9a4eb50e75b0 to your computer and use it in GitHub Desktop.
zoffix@VirtualBox:~$ perl -MData::Dumper -wlE 'sub f { state $x; for (0..9) { state $y; say Dumper [$x++, $y++]; last if $_ > 1 } }; f;f;f;f;'
$VAR1 = [
0,
0
];
$VAR1 = [
1,
1
];
$VAR1 = [
2,
2
];
$VAR1 = [
3,
3
];
$VAR1 = [
4,
4
];
$VAR1 = [
5,
5
];
$VAR1 = [
6,
6
];
$VAR1 = [
7,
7
];
$VAR1 = [
8,
8
];
$VAR1 = [
9,
9
];
$VAR1 = [
10,
10
];
$VAR1 = [
11,
11
];
zoffix@VirtualBox:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment