Hi Erasmus,

Not sure what is going on - I never use exec if I can avoid it, but the way you have written it is in a form that I do not usually trust the shell to work with.

If you pass a list instead of a string you are usually on safer ground, and that works whether you put use PDL or not:

  use PDL;
  my @cmd =("echo", "hello");
  exec @cmd  or die "Could not exec (" . $? . ", " . $! . ")\n";

Not really an answer, but return values & operation of system & exec is mildly black magic to me and I find that as long as I pass an array rather than a string to either I save myself a significant amount of headache!

                        Cheers,
                                J.



Erasmus Oblar wrote:
I've run into an odd problem that seems to involve PDL, I was hoping someone on the list could give me a hand.

this script:

#!/usr/bin/perl -w
my $cmd ="echo hello";
exec $cmd or die "Could not exec (" . $? . ", " . $! . ")\n";

works as expected (prints hello), but if I insert:
use PDL;
after the first line, I get the following error:
Could not exec (0, Illegal seek)


This happens on both x86_64 and i386, and with PDL version 2.4.3 and 2.3.4, perl 5.8.
Any thoughts as to what might cause this?
Thanks,
eo



------------------------------------------------------------------------

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to