1

I have a Perl script which calls a bash script. The software I am using is Calibre. When I call this bash script (Calibre's) from my ssh shell, it seems to work fine. However when I call it from my Perl script it throws the following errors:

Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/ebooks/conversion/cli.py", line 307, in main
  File "site-packages/calibre/ebooks/conversion/cli.py", line 260, in create_option_parser
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 10, in
  File "site-packages/calibre/customize/ui.py", line 15, in
  File "site-packages/calibre/customize/builtins.py", line 639, in
  File "site-packages/calibre/devices/apple/driver.py", line 8, in
  File "ctypes/__init__.py", line 555, in
  File "ctypes/__init__.py", line 279, in _reset_cache
MemoryError

I posted this in the Calibre mobileread forums and was informed that this was because the Python stdlib module does not load correctly. But I have absolutely no clue what is causing this and how I can get it up and running. I am using bluehosts Linux server. Could someone please help me out?

The way I am calling the bash script from my Perl script is using backticks:

my $output=`sh ebook-convert some.html some.mobi`

I have also tried to use IPC::Run::Simple, but that doesn't work, either.


From my ssh:

pipe size            (512 bytes, -p) somenumber
POSIX message queues     (bytes, -q) somenumber
real-time priority              (-r) somenumber
stack size              (kbytes, -s) somenumber
cpu time               (seconds, -t) somenumber
max user processes              (-u) somenumber
virtual memory          (kbytes, -v) somenumber
file locks                      (-x) somenumber

While that from my Perl script is empty.

Can't exec "ulimit": No such file or directory at tester.pl line 25.
daxim
  • 39,270
  • 4
  • 65
  • 132
Sab
  • 11
  • 3
  • compare output of `ulimit -a` – jfs Jun 18 '12 at 04:35
  • Have edited it PLease take a look – Sab Jun 18 '12 at 05:27
  • It is a shell command. Run from Perl `bash -c 'ulimit -a'` – jfs Jun 18 '12 at 08:39
  • @J.F.Sebastian From your comments i changed my sh to bash and it wonderfully executes. Please post it an an answer and i will accept it. THough it would be nice if you could tell me why sh does not work but bash does. – Sab Jun 18 '12 at 08:59
  • have you tried to run it just as `/usr/bin/ebook-convert` without explicit sh/bash? – jfs Jun 18 '12 at 16:51

0 Answers0