in reply to PHP to PERL ?

What you're probably looking for is:
do 'mycode.pl';
As for inserting data into an HTML page, Perl prefers to keep its code separate from text. So instead of dropping code snippets here and there in the page, you'd do something more like this:
use strict; use warnings; my ($handle, %hash); ###### Collect template contents and change to string open($handle, 'template.dat'); $_ = join '', <$handle>; close($handle); ###### Some dummy values to insert in the template $hash{'name'} = 'Theodore'; $hash{'age'} = 26; ###### Every instance of %hashkey% is replaced with ###### the corresponding value { no warnings; s/%(\w+)%/$hash{$1}/g; } print;

Replies are listed 'Best First'.
Re^2: PHP to PERL ?
by Anonymous Monk on Dec 27, 2005 at 23:52 UTC
    Does that call extra code from another file then transfer control back to the main page that called it? If so, thanks a lot, that's probably the biggest part of what I was looking for. I can probably find that word in the tutorials now that I have an idea of what it is I'm actually looking for lol. Thanks again.
        Bingo. That was exactly (part anyway) of what I needed. It shows various ways and whys. Thanks. Thanks for the rest as well, it all points to things I was wanting.