Skip to content

Commit 47e2f57

Browse files
authored
Merge pull request #56 from manwar/complete-function-interpolate
Added method get_animal() to complete 'function interpolate' example.
2 parents f436540 + 891b080 commit 47e2f57

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

categories/cookbook/01strings/01-00introduction.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ =head2 Advanced Interpolation Control
398398
say qh/We have %animal.elems() key in %animal{}/;
399399
400400
# interpolate functions only: both & and () are required
401+
sub get_animal ($tag) { return %animal{$tag}; }
401402
say q:f/The quick brown &get_animal('quick') jumps.../;
402403
say qf/The quick brown &get_animal('quick') jumps.../;
403404

0 commit comments

Comments
 (0)