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.

In reply to Re: Illegal seek from Find::File by btrott
in thread Illegal seek from Find::File by infoninja

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.