|No such thing as a small change|
Bare BLOCK vrs. grep BLOCKby powerin (Initiate)
|on Jan 15, 2018 at 19:59 UTC||Need Help??|
powerin has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to make a return from subroutine by the code running in a BLOCK.
I noticed how grep is working in the question:
So, "Still here #1" is never shown.
grep is a Perl function, but I'd like to get such behaviour in a BLOCK of my own subroutine. Below is my example:
And this is nothing like original grep makes.
So, the question is: How to run a code in BLOCK passed to a subroutine and call return in a caller?