in reply to Re^3: how can I detach a thread from another or how can I set a timer for a thread?
in thread how can I detach a thread from another or how can I set a timer for a thread?

Thanks a lot, it works for me. May I bother you with another question? I saw some code like:

$pid = open my $fh, "$cmd |" or die "$!, $^E";

Could you please tell me what does it mean by '$^E'

I google it, but nothing useful.

  • Comment on Re^4: how can I detach a thread from another or how can I set a timer for a thread?
  • Download Code

Replies are listed 'Best First'.
Re^5: how can I detach a thread from another or how can I set a timer for a thread?
by zentara (Cardinal) on Nov 15, 2011 at 11:13 UTC
    It's a built-in error message. Read perldoc perlvars and read the section on Error Variables. Its says:
     $EXTENDED_OS_ERROR
           $^E     Error information specific to the current operating system. At the moment, this differs from $! under only VMS, OS/2, and
                   Win32 (and for MacPerl). On all other platforms, $^E is always just the same as $!.
    
                   Under VMS, $^E provides the VMS status value from the last system error. This is more specific information about the last
                   system error than that provided by $!. This is particularly important when $!  is set to EVMSERR.
    
                   Under OS/2, $^E is set to the error code of the last call to OS/2 API either via CRT, or directly from perl.
    
                   Under Win32, $^E always returns the last error information reported by the Win32 call "GetLastError()" which describes the
                   last error from within the Win32 API. Most Win32-specific code will report errors via $^E. ANSI C and Unix-like calls set
                   "errno" and so most portable Perl code will report errors via $!.
    
                   Caveats mentioned in the description of $! generally apply to $^E, also.
    
                   This variable was added in Perl 5.003.
    
                   Mnemonic: Extra error explanation.
    
    

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re^5: how can I detach a thread from another or how can I set a timer for a thread?
by Anonymous Monk on Nov 15, 2011 at 11:15 UTC

    I google it, but nothing useful.

    [ddg://"$^E" site:perl.org] -> "$^E" site:perl.org

    [google://"$^E" site:perl.org] -> "$^E" site:perl.org

    [google://"$^E" site:cpan.org] -> "$^E" site:cpan.org

    [perldoc://"$^E"] -> "$^E"

    Yeah, google seems to have gotten crappier, meh

    perldoc -v "$^E" $EXTENDED_OS_ERROR $^E Error information specific to the current operating system +. At ...

    $ perldoc perltoc |grep "\^E" , $COMPILING, $^C , $DEBUGGING, $^D , ${^ENCODING} , %ENV +, ${^CHILD_ERROR_NATIVE} , $EXTENDED_OS_ERROR, $^E , $^E is meaningful on Win32 $^E, $^H, $^M %ENV, CRTL_ENV, CLISYM_[LOCAL], Any other string, $!, $^E, $?, + $|

    [doc://perlvar#$^E] -> $^E

    You cant go wrong with a classic :) Tutorials: How to RTFM