in reply to Executing system command

I am not sure how you are trigerring this using your mailing list but you may want to try using the full path for  de. Also you can add debug statements in your program so that you can figure exactly at what point this program fails

-SK

Replies are listed 'Best First'.
Re^2: Executing system command
by perl_devel (Friar) on Jul 28, 2005 at 04:45 UTC
    There is a way to trigger perl script thru mailing list
    Aliases file will direct which perl script to trigger
    (eg) i want to trigger  parse.pl on mailing trigger@xx.com
    
    aliases mapped for trigger will be
    
    trigger | parse.pl
    
      I am not familiar with mailing lists so I cannot help you much there... Since you are saying the problem does not occur when you run the script from the command line it makes me wonder the script failing because it cannot excecute your command

      . Here is a code snippet

      #!/usr/bin/perl -w print `date`; print `dfs`; print `date1`;

      In the above code, the first line will execute, the second line is referencing my ".alias file" (i guess this is nothing to do with your mailing list alias your are talking about), the third line is an invalid command.

      I get the following error as Perl cannot find the commands

      Thu Jul 28 00:01:32 CDT 2005 Can't exec "dfs": No such file or directory at sys line 4. Can't exec "date1": No such file or directory at sys line 5.

      Is this what you are referring to File or Directory Not Found? Is that the exact error? I am confused because I cannot figure out "what" is "not found" - perl script? or one of the commands inside the perl script? That's why i asked you to put full path for the de command. It could also be that your Perl script cannot be located by your mailing list trigger in which case give it a full path on that alias file

      . It will be helpful if you could add some debug statements in your script and say "reached line #: __LINE__" etc. By that you know where it is failing and probably post your code around that if it is too big to post

      If the problem is in "executing" the perl script itself then it is probably not perl related and you might want to check our your mailing list app usenet

      -SK