You have to put the actual command in the exec or backticks as you would
type it in your shell, not just the filename.  So instead of

$out = `convert-pdf.pl Blank.gif`;

Try

$out = `perl convert-pdf.pl Blank.gif`;

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


----- Original Message -----
From: "Terry Romine" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 24, 2001 3:23 PM
Subject: Re: [PHP-DB] Embedding Perl


> Ok, I found snippets that talk about using either exec() or backticks.
> The problem is that it still doesn't call the perl script. Or at least
> doesn't seem to.
>
> exec("convert-pdf.pl Blank.gif",$out);
> echo(implode("\n",$out));
> $out = `convert-pdf.pl Blank.gif`;
> echo($out);
>
> If I run
> perl convert-pdf.pl Blank.gif
> from the shell, it responds with 135x105 and creates a secondary file.
> This is what the script is meant to do. Calling it in either of the
> example above, results in either an Array or nothing being displayed. No
> secondary file gets created.
>
>
> On Wednesday, October 24, 2001, at 11:05 AM, Terry Romine wrote:
>
> > I have a small situation where it would be good to be able to embed a
> > perl routing in a php script. Is this possible? Or do I need to pass
> > control from php to a perl script and return?
> >
> > A quick synopsis would be (in pseudo code)
> >
> > <?php
> > if($theFileType == "pdf" {
> > // call convert.pl to get a thumbnail
> > }
> > else {
> > // other file type processing
> > }
> > ?>
> >
> >
> > Alternatively, is there a module that can take a pdf file and make a
> > thumbnail of the first page?
> >
> >
> > Thanks,
> > Terry
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to