http://www.perlmonks.org?node_id=270223

I wonder if this would be useful? Nothing Perl-specific, but maybe to think about as Perl 6 approaches.

# pseudocode try { serve(); } bounce(Error::Return) { $rally++; } catch (Error::OutOfBounds){ new_point(); } sub serve { throw Error::OutOfBounds if int rand 10 <=1; lob Error::Return foreach (0..2); return "Advantage Caller"; }

The idea is that sometimes you definitely want to throw an error - there's no way to continue. On the other hand, you might just want to lob an error back to the caller, and let them decide if they want to go on. So then the caller could either catch the exception, or bounce it back - in which case the callee would continue executing as if nothing had happened.

Useful? Well, suppose you had a function to parse HTML. Your function hits some dodgy syntax. Should it give up or press on? Depends whether you're in strict mode or not.

Or... you read files in a directory tree, and then one of the needed files is missing. Is this a disaster, or do you just want to keep gathering up the information, but note that you missed a file?

# pseudocode sub dir_reader { # ... while (my ($curdir, $name) = next_in_tree()) { -e "$curdir/$name" or lob "Couldn't open file $name"; push @files, $name; } # ... return @files; } sub keep_on { try { dir_reader(@_) } bounce { /.*(\S+)$/; push @badfiles, $1;} } sub give_up { try { dir_reader(@_) } catch{ die "Couldn't open file $_"} }

Just a thought. It's a way to make communication between caller and callee a bit more flexible - even streamlike. I suspect someone is now going to point out that this violates fundamental design principles, or can be done easily using XOR and a box of matchsticks, but I thought it might be an interesting concept.
A massive flamewar beneath your chosen depth has not been shown here