fork download
  1. use strict;
  2. use warnings;
  3.  
  4. my ($x, $y) = (0, 0);
  5.  
  6. sub get_random : lvalue {
  7. int(rand(2)) ? $x : $y;
  8. }
  9.  
  10. for (1..5) {
  11. print "$x $y\n";
  12. ++get_random();
  13. }
  14.  
Success #stdin #stdout 0s 3740KB
stdin
Standard input is empty
stdout
0 0
0 1
1 1
1 2
1 3