exercise: PhoneNumber version: 3 plan: 16 subs: clean_number tests: |- foreach my $subcases (@{$C_DATA->{cases}}) { is $subs{clean_number}->($_->{input}{phrase}), $_->{expected}, $_->{description} foreach @{$subcases->{cases}}; } example: | sub clean_number { my ($number) = @_; $number =~ s/\D//g; return $number =~ /^ 1? ( (?: [2-9] \d{2} ){2} \d{4} ) $/x ? $1 : undef; }