in reply to Re: do-ing of file without \n at the end
in thread do-ing of file without \n at the end

ok, understood. i'll check all supported code for not full correct check of do() execution :

And now issue transforms to:
- create file 'test.pl' with content:
print "err = '$!'\n"; exit 0;
without \n in the end

- run file by command like:
`perl ./test.pl`

- see in output:

$ perl ./test3.pl
err = 'Bad file descriptor'

and question now is "why perl sets $! for file w/o \n in the end"...

Thanks,
alex|sawoy|slex

Replies are listed 'Best First'.
Re^3: do-ing of file without \n at the end
by sgifford (Prior) on Mar 31, 2007 at 06:31 UTC
    $! is undefined if no error has occured, and so can be set to absolutely anything. It's not clear to me why Perl ends up setting it to this particular value under these circumstances (I see the same thing on my machine), but that's really a trivia question; since the behavior is undefined, any value is valid.
      Bad file descriptor is error 0 on some systems. It means someone did $! = 0; under the false assumption that 0 meant success. Or as a favour for those who make that assumption.