Perl-Sensitive Sunglasses | |
PerlMonks |
Re: PHP to PERL ?by Delusional (Beadle) |
on Dec 28, 2005 at 11:03 UTC ( [id://519514]=note: print w/replies, xml ) | Need Help?? |
Just as an example: Script file
somefile.txt
Again, just as an example, and not exactly 'perfect'. As mentioned, there isn't any one way to do anything in Perl. This example, assumes that the file passed to the sub (function) include does not contain any program code, rather only information to display (which can be html code). So, assuming your going to use this, you would copy the sub include to some file you include in your file/script, or in the primary file/script. Then place a call to include(), passing a single command, that being the file name to open, and display. Thus, the include() could be use in several locations, with each call to it having any file name you desire. But as I said, this is just an example, and I should point out, not really clean. However, it does execute and displays 'correctly'. The output of this example:
In Section
Seekers of Perl Wisdom
|
|