in reply to Illegal seek from Find::File

I don't think find returns anything, which would cause the "print ..." bit of your condition to be executed. So your find is actually running successfully. There's no need to check for an error.

Were you expecting find to return something?

As for the "Illegal seek"--running the code through the debugger, it seems that $! gets set to "Illegal seek" after the call to Cwd::cwd(). And in Cwd::cwd (aliased to Cwd::_backtick_pwd), it gets set after running this line:

chop($cwd = `pwd`);
You can actually take out the chop, and still get the error:
print "Before: ", $!, "\n"; my $cwd = `pwd`; print "After: ", $!, "\n";
gives
Before: After: Illegal seek
And in fact, I get this w/ any backtick call:
print "Before: ", $!, "\n"; my $cwd = `date`; print "After: ", $!, "\n";
gives the same output. So it doesn't look like this is anything to worry about.

Replies are listed 'Best First'.
RE: Re: Illegal seek from Find::File
by infoninja (Friar) on Jun 02, 2000 at 00:58 UTC
    I was originally hoping that it would, but after reading your reply, I think I've got a better way to handle the return.
    Out of curiosity, any idea what's causing the "illegal seek"?
      infoninja said:
      Out of curiosity, any idea what's causing the "illegal seek"?
      Nothing. That's an "expected error" that is unrelated to your operation, and has already been dealt with.

      Moral: Do not use $! on calls that are not immediately "system" calls.

      -- Randal L. Schwartz, Perl hacker