Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation error: example not working, HASH not used. #18

Closed
nottledim opened this issue Jun 28, 2020 · 1 comment
Closed

Documentation error: example not working, HASH not used. #18

nottledim opened this issue Jun 28, 2020 · 1 comment

Comments

@nottledim
Copy link

This is elementary but it doesn't work.

`#!/usr/bin/perl

use Text::Template qw(fill_in_string);

my $text = fill_in_string( <<EOM, HASH=>{ 'recipient' => 'John' } );
Dear { $recipient },
Pay me at once.
Love,
G.V.
EOM

print "$text\n";
`

the EOM in <<EOM must be enclosed in single quotes as in <<'EOM' (otherwise $recipient gets substituted by perl). If for example my $recipient = "Pete"; is set then the code appears to work but it doesn't. The substitution is not performed by Text::Template but by perl.

@mschout
Copy link
Owner

mschout commented Jul 3, 2020

Patched, thanks!

@mschout mschout closed this as completed Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants