Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Goto-labels for exception handling?

by ikegami (Patriarch)
on May 10, 2018 at 05:08 UTC ( [id://1214309]=note: print w/replies, xml ) Need Help??


in reply to Goto-labels for exception handling?

Test::More uses last similarly.

SKIP: { skip "Unix-specific tests skipped on Windows", 2 if $^O eq 'Win32'; is(...); is(...); };

I've used the same trick in an overridden exit in FastCGI daemon that executes CGI scripts.

chdir(dirname($script_qfn)); local $0 = $script_qfn; FindBin::again(); local @ENV{ keys(%$env) } = values(%$env); my ($rv, $e); FCGI_DAEMON_EXEC_BLOCK: { package scripts::fcgi_daemon::root; # Hide a spurious warning. { no warnings 'void'; *CORE::GLOBAL::exit; } local *CORE::GLOBAL::exit = sub { no warnings 'exiting'; last FCGI_DAEMON_EXEC_BLOCK; }; $rv = do($0); $e = $@; } ... delete $scripts::fcgi_daemon::{'root::'}; CGI::_reset_globals() if $INC{"CGI.pm"};

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-28 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found