Yada Yada Operator
Three dots. That's it:The yada yada operator. Perl's way of saying "I haven't written this part yet."...
It's a placeholder that actually works. Sort of.
Part 1: THE PLACEHOLDER
This compiles. This runs. And when you call calculate_tax(), it dies with:sub calculate_tax { ... }
Perfect for stubbing out code you'll write later.Unimplemented at script.pl line 3.
Part 2: WHY NOT JUST die?
You could write:But ... is:sub calculate_tax { die "Not implemented"; }
When someone sees ..., they know it's a stub. When they see die, they might think it's error handling.- Shorter - More obvious - Industry standard (other languages do this too) - Self-documenting
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
Part 3: STATEMENT VS EXPRESSION
Important: ... is a STATEMENT, not an expression.For expression context, use die directly:# Works (statement context) if ($cond) { ... } # Doesn't work (expression context) my $x = ...; # Syntax error! my $y = $cond ? ... : 0; # Nope!
my $x = die "Unimplemented";
Part 4: SKELETON MODULES
Great for sketching out a class:All methods exist. All methods die if called. The structure is clear.package Calculator; sub new { my $class = shift; return bless {}, $class; } sub add { ... } sub subtract { ... } sub multiply { ... } sub divide { ... } 1;
Part 5: SKELETON SCRIPTS
Map out your program logic:Run it. See which function dies first. Implement that one. Repeat.#!/usr/bin/env perl use v5.14; sub parse_args { ... } sub validate_input { ... } sub process_data { ... } sub generate_report { ... } my $args = parse_args(); validate_input($args); my $data = process_data($args); generate_report($data);
Part 6: TEST SCAFFOLDING
Stub out tests you plan to write:The test file runs. Empty subtests die. You know what's left to do.use Test::More; subtest 'basic operations' => sub { ok(add(2, 2) == 4, 'addition works'); ... # More tests coming }; subtest 'edge cases' => sub { ... # Haven't written these yet }; subtest 'error handling' => sub { ... }; done_testing;
Part 7: SWITCH FALLTHROUGH
Mark unhandled cases:Clear signal: these cases need implementation.given ($type) { when ('text') { process_text($_) } when ('image') { process_image($_) } when ('video') { process_video($_) } when ('audio') { ... } # TODO default { ... } # Unknown type }
Part 8: THE VERSION REQUIREMENT
Yada yada requires Perl 5.12+:On older Perl, you get a syntax error. The three dots look like the range operator to the parser.use v5.12; # Enables ... sub future_feature { ... }
Part 9: DON'T CONFUSE WITH RANGE
Three dots also means something else in scalar context:The difference:while (<DATA>) { print if /START/ ... /END/; # Flip-flop operator! }
Context matters. As always in Perl.... # Statement by itself: yada yada /START/ ... /END/ # Between expressions: flip-flop
Part 10: THE ERROR MESSAGE
When ... executes:Short. Clear. Points to the exact line.Unimplemented at script.pl line 42.
If you want a custom message, use die:
But for generic "I'll get to this later," ... is perfect.sub calculate_tax { die "Tax calculation not yet implemented"; }
Part 11: IN OTHER LANGUAGES
Perl isn't alone:Perl's ... is closest to Python's idea, but with runtime checking.Python: pass (but doesn't die) Ruby: raise NotImplementedError Java: throw new UnsupportedOperationException()
Part 12: REAL WORKFLOW
Day 1 - Sketch:Day 2 - First pass:sub download_file { ... } sub parse_content { ... } sub store_results { ... }
Day 3 - Getting there:sub download_file { my $url = shift; # TODO: actual download return "dummy content"; } sub parse_content { ... } sub store_results { ... }
Day 4 - Done:sub download_file { ... } # Actual implementation sub parse_content { ... } # Actual implementation sub store_results { ... } # TODO still
The yada yada markers disappear as you implement.# No more ... in the file
Part 13: THE NAME
Yada yada yada. As in "blah blah blah" or "and so on."From Seinfeld, where characters would skip boring details by saying "yada yada yada."
The ... in Perl is the same: "this is where code goes, yada yada, you get the idea.""I went to the store, yada yada yada, now I have a cat."
Also called the "triple dot operator" or "ellipsis operator" if you want to be formal. But yada yada is funnier.
... . . . . . . . . . . ... Unimplemented since Perl 5.12
Created By: Wildcard Wizard. Copyright 2026