Greg wrote:

I have an input file that I have to evaluate whether to include lines
based upon their last character.
Is there a simple regex that would allow me to assign the very last
character to a variable?

In my case it will either be A or I (capital i) if that helps?

    while ( <$fh_in> ) {
        my ($tail) = / ( [AI] ) $/x or next;

        if ( $tail eq "A" ) {
            ...
        }
        else {
            ....
        }
    }

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to