in reply to Running a long perl process

Yes, that should work fine. I'd call exec with list arguments. The form of your question has syntax errors which should cause it to fail. Here's one way, exec '/path/to/perl', '-T', '/path/to/mylongperlprogram.pl' or die $!;

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Running a long perl process
by Anonymous Monk on Aug 24, 2004 at 00:01 UTC
    Thanks for your help, one more problem, how do I pass parameters to mylongperlprogram.pl?
    I tried -
    exec '/path/to/perl', '-T', '/path/to/mylongperlprogram.pl', 'number=10' or die $!;
    but number=10 is not passed.
    when I type -
    perl -T mylongperlprogram.pl number=10
    on the command line it does work.
    Whats my problem?

      You are correct in the idea of passing parameters to the script via exec's argument list. Without knowing how your script handles arguments I can't say what's going wrong.

      You might try inserting some throwaway print or warn statements to see what the script thinks is happening. Look for the values in @ARGV.

      Do you still have the problem is you make your script executable and call it directly, instead of as an explicit call to perl?

      After Compline,
      Zaxo