[Melbourne-pm] Postfix conditionals and creating lexicals

Sam Watkins sam at nipl.net
Thu Jul 12 22:38:52 PDT 2012


Mathew Robertson wrote:
> and dont forget 'unless'.

I daresay postfix for(each), while, until, may also be troublesome.
Any others?

sub foo {
	my $foo = "elephant" while rand() < 0.5;
	$foo .= " poop";
	print "$foo\n";
}

foo for 1..10;

=>

 poop
 poop poop
 poop
 poop
 poop
 poop poop
 poop
 poop poop
 poop poop poop
 poop



More information about the Melbourne-pm mailing list