I want to run a Perl script online, but I don’t know how.
In PHP you need to start with <?php, so do you have to start with something like that in Perl?
And does Apache automatically recognize Perl? Or do I have to upload Perl and let it point to it using #!/path/to/perl?
Can I use print() to display HTML?
I want to run a Perl script online, but I don’t know how. In
Share
There are frameworks (such as Mason) which work like that, but it is more typical to have a standard Perl program which outputs the page.
Apache doesn’t automatically recognise any kind of server side programming.
You would need to have Perl installed on the server. You would generally start a script that way (but not necessarily, e.g. if you were using mod_perl), but would have to configure the server to recognise it as an executable and run it (just as you have to configure the server to recognise files ending with
.phpas scripts to run with PHP).Yes.
You should probably start by looking at the question Web Programming For The Non-Web Programmer (in Perl).