[Omaha.pm] 'Here' Documents don't do method calls

Jay Hannah jhannah at omnihotels.com
Mon Aug 21 11:48:45 PDT 2006


Bug fix...

Before

   my $strsql = <<EOT;
update rates set 
  eff_start_booking = '$date10', 
where rate_code IN ( 
  select rate_code 
  from master_rate_info
  where prop = '$self->get_property()'
)
EOT

After

   my $prop = $self->get_property();
   my $strsql = <<EOT;
update rates set 
  eff_start_booking = '$date10', 
where rate_code IN ( 
  select rate_code 
  from master_rate_info
  where prop = '$prop'
)
EOT

The lesson there is that scalars work in 'Here' Documents, but you can't
do method calls. 

What's a '"Here" Document'?
http://www.stonehenge.com/merlyn/UnixReview/col12.html
Programming Perl 3rd Edition, Chapter 2, Scalar Values, '"Here"
Documents'

I was surprised I couldn't find any mainline perldoc info on '"Here"
Documents'. And if you don't know what they're called its hard to find
out...

j



More information about the Omaha-pm mailing list