things that look different

Michael Stillwell mjs at beebo.org
Tue Oct 7 09:28:07 CDT 2003


On the topic of things that look different but do (almost?) the same 
thing, is there ever any reason to prefer one of these over the other:

my $v1 = do {
   1;
};

my $v2 = sub {
   1;
}->();

?

(The sub approach lets you do an actual return, which does suit the 
construction, but the "}->();" bit sure is ugly...)




--M.

-- 
http://beebo.org






-- 
http://beebo.org




More information about the Melbourne-pm mailing list