Perl v5.12 adds a placeholder operator, ...
, called the yada yada operator, after an episode of Seinfeld where the interesting parts of the story are replaced with “yada yada yada”.
You can replace whole statements with ...
and Perl will compile it. You can check that everything else compiles without having to fill in the bits you have deferred.
Here’s a simple program that compiles:
# yada.pl use v5.12; ...
When you check the syntax, everything is fine:
$ perl5.12 -c yada.pl yada.pl syntax OK
At runtime, the ...
dies with the message Unimplemented
:
$ perl5.12 yada.pl Unimplemented at yada.pl line 3.
Before this feature, you might have inserted comments to mark the places you needed to return to:
# yada.pl use v5.12; # XXX: do that thing we talked about right here
Being comments, these do compile, but being comments, they let the program continue past them like it worked despite part of it missing. The ...
stops the program to remind you that you aren’t done yet.
The ...
doesn’t work as a placeholder for terms or partial statements:
# yada_term.pl use v5.12; ... + ...
Those don’t compile:
$ perl5.12 -c yada_term.pl syntax error at yada_term.pl line 3, near "... +" yada_term.pl had compilation errors.
You can make these into statements though by enclosing then in do
:
# yada_term.pl use v5.12; do{...} + do{...}