Exec Perl Script

I have a small perl script, used to watermark and personalized a pdf
file for download. I have been unsuccessful in getting the script to
execute.

This is part of a function in the protectedfile model, maybe it has to
be in the controller?

output = #{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl #{self.filename} "#{user.fullname}" #{user.username}

any help?

if you’re trying to execute the file, than try the %x() sytax:

output = %x("#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl
#{self.filename} ‘#{user.fullname}’ #{user.username}")

ed

On 12/13/06, Ed Hickey [email protected] wrote:

if you’re trying to execute the file, than try the %x() sytax:

output = %x(“#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl
#{self.filename} ‘#{user.fullname}’ #{user.username}”)

ed

Isn’t backtick and %x the same thing?

How do you know that the script didn’t run? I would look for the
obvious problems, like permissions. Can the user that is runing your
rails app get to the file? What are the permissions on the directory?
Does the file personalizePDF.pl have the execute bit set? etc.
How about redirecting stderr to a file in /tmp and see if a) the file
gets created and if there are problems with running it?
Lots of investigation to be done.
Bruce.