tags:

views:

180

answers:

2

I was wondering if it was possible to call a function inside a perl here doc

sub Function
{
}

print<<HERE;

  Function()

HERE
+6  A: 

Do you mean that you want the function's return value to be interpolated into the heredoc?

sub Function {
    qw( Hello, World! );
}

print <<HERE;

  @{[ Function() ]}

HERE
ephemient
A: 

There are a few potential solutions in the PerlMonks question: Calling a function from within a HERE doc?

toolic