Aha! This is exactly the kind of solution I was looking for. I guess what
I'm doing here is passing a reference to a subroutine call? \box(5,10) and
then turning it into a scalar? ${}
Quite ingenious. While I'm sure I'll regret it later (and curse your good
name as I'm wishing I'd taken the time to learn Mason or HTML::Template)
this seems like a great quick fix for the time being. And it never hurts to
learn a few new tricks!
Thanks All.
-----Original Message-----
From: Todd W [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 12:32 PM
To: [EMAIL PROTECTED]
Subject: Re: php like behavior for my perl CGI
Well, you can save yourself a bundle of keystrokes and use a templating
system and cascading stylesheets, but heres a quick fix:
[wadet@ecg-redhat wadet]$ perl
sub box {
return('<img src="p.gif" height="'.$_[0].'" width="'.$_[1].'">');
}
print <<eot;
<table>
<tr>
<td>${\box(5,10)}</td>
<td>${\box(7,10)}</td>
</tr>
</table>
eot
Ctrl-D
<table>
<tr>
<td><img src="p.gif" height="5" width="10"></td>
<td><img src="p.gif" height="7" width="10"></td>
</tr>
</table>
see:
[wadet@ecg-redhat wadet]$ perldoc perlref
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]