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?
> 
> Thanks very much from a perl newb.

my $line = "1234567890A\n";
my ($lastchar) = $line =~ /(.)$/;

HTH,

Rob

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