distinguish $! vaules

From: Peter Michael (dog_at_dog.dog)
Date: 06/30/04


Date: Wed, 30 Jun 2004 17:44:53 +0200

Hi,

what is currently the preferred way to distinguish between different
values of $! ? I suppose that %! was created to this end (sample code?)
but should I use Switch(3) instead today?

    use Errno qw(:POSIX);
    use Switch;

    open my $fh, "file" or do
    { switch($!)
        { case ENOENT { warn "you should first create the file\n"; }
            case EACCES { warn "you are not allowed to see this\n"; }
            else { warn "some other error...\n"; }
        }
    };

Any hints welcome (Anno? ;-).

Best regards,

    Peter



Relevant Pages

  • Systems hangs on debugging unmanaged C++.Net
    ... unmanaged C++ application that I want to debug on VS.Net 2003. ... in our team has made some changes to the project during my switch. ... Here some hints: ... the problem doesn´t allways occur and not allways at the same time ...
    (microsoft.public.vsnet.debugging)
  • Re: Signed assemblies easily cracked?
    ... "Frank Wallwitz" wrote in message ... > describe the method more detailed in a public forum ... With your hints, it took me under 5 minutes to identify the switch byte. ...
    (microsoft.public.dotnet.security)
  • Re: code help
    ... roohbir said the following on 10/25/2006 12:36 AM: ... changing it to switch? ... Just need some hints and I'll try to do it on my ... Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ ...
    (comp.lang.javascript)
  • Re: code help
    ... That's sensible advice Randy. ... changing it to switch? ... Just need some hints and I'll try to do it on my ... Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/ ...
    (comp.lang.javascript)
  • Re: Is RH 7.2 schedule policy different of RH 9 ???
    ... I compiled the kernel 2.4.24, disabled DMA, IRQ unmasking and the ... sounds still stop when i switch... ... More hints? ...
    (comp.os.linux.misc)