variable in HERE document

M

mike

hi

i have a here doc assigned to a variable

my $datetime = "30 Jun 2004" ;

my $strings <<'EOF'
declare @lastaccessdate = "$datetime"
declare @today_date = "30 Jun 2004"
EOF

how can i interpolate the $datetime variable
inside the here doc?? I need to have the 'EOF' instead of "EOF"

thanks
 
J

Jürgen Exner

mike said:
hi

i have a here doc assigned to a variable

my $datetime = "30 Jun 2004" ;

my $strings <<'EOF'
declare @lastaccessdate = "$datetime"
declare @today_date = "30 Jun 2004"
EOF

how can i interpolate the $datetime variable
inside the here doc??

You are explicitely asking perl _not_ to interpolate the variable but to
take the text "$datetime" literally.
If you want a variable to be interpolated then use the proper double quotes.
I need to have the 'EOF' instead of "EOF"

Why?

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top