fork(1) download
  1. use overload;
  2. BEGIN {
  3. overload::constant ( integer => sub {
  4. return inf if($_[1]==3);
  5. $_[1];
  6. } );
  7. }
  8.  
  9. for ($x=0; $x<3; ++$x) { print "$x,"; last if($x>10);}
  10.  
Success #stdin #stdout 0s 6188KB
stdin
Standard input is empty
stdout
0,1,2,3,4,5,6,7,8,9,10,11,