suttercain Posted August 17, 2007 Share Posted August 17, 2007 Hi Guys, I am attempting to access my first Perl script so I can then attempt a module. I have no idea how to do this and google yileds very little help. The closest thing I found was this article: http://devzone.zend.com/node/view/id/1712 Right now I am attempting to access the perl directory on my shared hosting account: <?php require('/usr/local/bin/perl'); ?> When I ran this, the following error was echoed: Warning: Unexpected character in input: '' (ASCII=15) state=1 in /usr/bin/perl on line 957 Warning: Unexpected character in input: '' (ASCII=3) state=1 in /usr/bin/perl on line 957 Parse error: syntax error, unexpected '{' in /usr/bin/perl on line 957 Anyone know how to connect to Perl then attempt to run a module? The module I need is already installed on the host, I just need to know how to access it. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65364-accessing-perl-through-php/ Share on other sites More sharing options...
trq Posted August 17, 2007 Share Posted August 17, 2007 exec(). Quote Link to comment https://forums.phpfreaks.com/topic/65364-accessing-perl-through-php/#findComment-326436 Share on other sites More sharing options...
suttercain Posted August 17, 2007 Author Share Posted August 17, 2007 Thanks Thorpe, That seems to be getting me on the right path. I ran this: exec('/usr/bin/perl/sample/dmpExR.pl'); and I got a blank white page, which is better that the errors. Does anyone know how to actually run a specific module? The module, Spreadsheet::ParseExcel, is installed on my shared server and the module information is here: http://search.cpan.org/dist/Spreadsheet-ParseExcel/lib/Spreadsheet/ParseExcel.pm A link to a tutorial or demo would be great... I have numerous books on PHP and not one shows me how to run a perl module via PHP. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65364-accessing-perl-through-php/#findComment-326441 Share on other sites More sharing options...
Hypnos Posted August 17, 2007 Share Posted August 17, 2007 Perl != PHP If you want to access a perl module, write perl. exec is the same as running from the command line. Quote Link to comment https://forums.phpfreaks.com/topic/65364-accessing-perl-through-php/#findComment-326443 Share on other sites More sharing options...
trq Posted August 17, 2007 Share Posted August 17, 2007 The perl command line interpretor has several options for running code directly on the command line, but yeah... as has been pointed out, your question has now become that of a perl one. I've shown you how to access the perl interpretor, if you can't get it to do what you want, you need perl help. If your on linux type.... info perldoc Otherwise Id'e suggest taking a look at http://perldoc.perl.org Quote Link to comment https://forums.phpfreaks.com/topic/65364-accessing-perl-through-php/#findComment-326461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.