Walt Mankowski on 27 Sep 2006 19:09:42 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] RE: web/perl issue?


On Wed, Sep 27, 2006 at 02:59:28PM -0400, George Gallen wrote:
> OK. How do you with a varible assignment?
> 
> I tried:
> 
> $test << EOT;
>    <div id='qtest'>
>    <button>this is a button test</button><br>
>    <button>another button test</button>
>    </div>
> EOT
> 
> which didn't seem to work

You need an equals sign there:

$test = << EOT;
   <div id='qtest'>
   <button>this is a button test</button><br>
   <button>another button test</button>
   </div>
EOT

You can also do variable interpolation inside a here document:

my $div_id = 'qtest';
$test = << EOT;
   <div id='$div_id'>
   <button>this is a button test</button><br>
   <button>another button test</button>
   </div>
EOT

For all the gory details on this syntax, run "perldoc perlop" and
search for "here-doc".

Walt

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug