Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: Re: Using backticks with (mount):

by BBQ (Curate)
on Jul 18, 2000 at 17:02 UTC ( [id://22981]=note: print w/replies, xml ) Need Help??


in reply to Re: Using backticks with (mount):
in thread Using backticks with (mount):

Dude! Great call! And also this, from perlvar:
Finally, $? may be set to non-0 value if the external program /cdrom/install fails. Upper bits of the particular value may reflect specific error conditions encountered by this program (this is program-dependent), lower-bits reflect mode of failure (segfault, completion, etc.). Note that in contrast to $@, $!, and $^E, which are set only if error condition is detected, the variable $? is set on each wait or pipe close, overwriting the old value.
But it still doesn't explain why $! would start up with Illegal Seek...

#!/home/bbq/bin/perl
# Trust no1!

Replies are listed 'Best First'.
RE: RE: Re: Using backticks with (mount):
by mikfire (Deacon) on Jul 18, 2000 at 17:11 UTC
    Why shouldn't it? The value is indeterminate when no error has occurred. You are seeing, effectively, /dev/random. There is no deeper mystery here, to my understanding.

    mikfire

      No, it isn't random. Yes, you shouldn't depend on it.

      In this case, I'm willing to bet that Perl has code that tries to seek, perhaps to more portably flush buffers. It is perfectly acceptable to try to seek and then see whehter or not it worked in order to tell if you happen to have a file handle to a stream that supports seeking.

      $! actually starts out as zero in a new process (no, I don't think this is guarenteed anywhere) but quickly gets changed when something deep in the guts of some library does something that fails.

      And indeterminate means it could be undef or "Illegal seek" or anything else.

      Well, maybe you're right! Maybe it should... BUT! ;)

      If its called $OS_ERROR, one might expect it to start off undef until some OS errors actually occur. With Illegal Seek, common sense would tell me that OS errors have occured! I guess that's what confuses most people. Indeterminate should be undef, and not Illegal Seek, IMHO.

      #!/home/bbq/bin/perl
      # Trust no1!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://22981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found