in reply to heredoc interpolation

If you put the initial DATA in single quotes, interpolation goes away.

my $store = <<'DATA'; $this_wont_be_interpolated DATA

This is explained in better detail in perlop, under the HERE-doc section. The options for here-doc quoting are "double quote" style interpolation (default), "single quote" style non-interpolation, and back-tick style.


Dave

Replies are listed 'Best First'.
Re^2: here-doc question
by ikegami (Patriarch) on Jan 17, 2009 at 07:48 UTC
    Note the side-effect that "\" ceases to be special.
    my $baz = 'interpolated'; print <<__EOI__; Double quoted or unquoted $baz foo\\bar __EOI__ print("\n"); print <<'__EOI__'; Single quoted $baz foo\\bar __EOI__
    Double quoted or unquoted interpolated foo\bar Single quoted $baz foo\\bar