We don't bite newbies here... much | |
PerlMonks |
Re: Problem to include a perl fileby hacker (Priest) |
on Oct 10, 2003 at 13:17 UTC ( [id://298243]=note: print w/replies, xml ) | Need Help?? |
There is no spoon. Seriously though, JavaScript is parsed, not executed (similar to perl, but not). You have to provide a link to an actual file containing JavaScript commands that your browser's JavaScript parsing engine can understand and properly parse. Passing it a Perl script will do nothing, except cause the internal browser JavaScript parser to silently abort with an error (unless you have a browser with a JavaScript debugging console). The browser's internal JavaScript parsing engine doesn't understand how to properly parse perl constructs (thankfully), and leaves it alone. Also, even if that could work, your perl script is redundant, since you're already passing a Content-Type when your webserver sends the .html page to the client, and you then parse a perl script which passes it again, right in the middle of existing content. In short, use the Perl interpretor to interpret perl, and the JavaScript interpretor to interpret JavaScript. How about using this instead, less code, easier to maintain:
You could also do this all in one print statement, if you wish:
TMTOWTDI
In Section
Seekers of Perl Wisdom
|
|