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?

/([AI])\z/ and my $variable = $1;

And if you want to remove it as well:

/[AI]\z/ and my $variable = chop;



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
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