Does Perl need a no-op function?

With the addition of "no bare literals", it makes constructs like

1 while some_func();

an error. I propose creating a no-op function "nothing" that can be used here or anywhere else you specifically wish to do nothing at all.

 given $this {
   when Even  { nothing };
   when Prime { ... };
   default    { ... };
 }


As a side question, I assume that there's a predicate form of "when", but it's not mentioned.


 given $this {
   nothing when Even;

   when Prime { ... };

   default    { ... };
 }


-- Rod Adams

Reply via email to