Thanks to all who have responded to my rather vague request.  Indeed, I
should clarify a bit what I'm looking for.

Because I'm extremely lazy, I'd like to use certain formatting shortcuts in
my HTML.  In a given document, I might have 15 different spacer gifs of
different sizes to aid in precise formatting that would look something like
this:

<img src="spacer.gif" height="50" width="10"/>

In PHP, or ASP, for example, I would write a "spacer(height,width)" function
and call it in my block of HTML like so:

        <?spacer(50,10)?>

which would create and send the image tag for me.
I'd like, in perl, to do the following:

print<<eob;
        <table border="0">
        <TR>
        <TD><?spacer(10,50)?></TD>
        </TR>
        </TABLE>
eob

Ideally, I would overload the print function so that it would search for
statements between <??> delimeters and execute them.
Of course, I could also say:

my $spacer1=spacer(10,50);
my $spacer2=spacer(50,100);
        
print<<eof;
        <table>
        <TR>
        <TD>$spacer1</TD>
        <TD>some stuff</TD>
        <TD>$spacer2</TD>
        </TR>
        </TABLE>
eof

but it seems like there should be an easier way with fewer keystrokes and
fewer intermediate variables.

Of course, the larger issue here, is that I'd like to learn to temporarily
re-rout STDOUT to a subroutine that will manipulate whatever I send to a
print statement, before actually sending it to my desired output stream.


Perhaps, my dream is completely quixotic, but so far, it seems like the kind
of thing that must be very easy if only I knew the right trick...  Also the
only real benefit I've seen of PHP over perl-cgi is the ease with which one
can mix HTML and code (Naturally, most web architects will jump at the
opportunity to tell you why this is a very bad idea but it often makes life
easier for small projects)

I hope this clarifies things a bit.  If not..I guess I'll just need to do a
few extra keystrokes :)

Many thanks!

-peter


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to