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

MacScissor has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks! I have 3 lines of strings:
xxxxx yyyyy zzzzz
Now, I want to do a Regex on the last line (zzzzz). When successful, I want to do a Regex on the middle line (yyyyy). If this is successful too, I want to do a Regex on the top line (xxxxx). Can anyone tell me how to do that? Thank you in advance!