-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =pod I just uploaded C to the CPAN. It makes working with heredocs much nicer. Instead of making a hideous mess with a heredoc: lang:Perl sub mk_htaccess { my ($site, $users) = @_; my $user_list = join ' ', grep { !/\n/ } keys %$users; my $site_name = do { $_ = "". $site->name; $_ =~ s/\"//g; $_ }; my $htpasswd_file = "/path/to/". $site->url. "/.htpasswd"; my $file = <<"HERE"; AuthType Basic AuthName "$site_name preview" AuthUserFile $htpasswd_file Require user $user_list HERE ... } You can use a nice-n-clean TT template: use String::TT qw/tt strip/; sub mk_htaccess { my ($site, $users) = @_; my $file = strip tt q{ AuthType Basic AuthName "[% site.name | remove('"') %] preview" AuthUserFile /path/to/[% site.url %]/.htpasswd Require user [% users.keys.join(' ') %] }; ... } Notice how the indenting flows with your program, and that you don't need to create useless variables to interpolate. I like it. See the manpage for more details. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFII14V2rw+dVvzZm0RAudRAJ4lmZyROR2AZXn+s4EmVP2swuMycwCfddfG 5F3etnwieBslb6NSFsp+UIk= =8WWo -----END PGP SIGNATURE-----