in reply to Extract last two digits from numbers

Anonymous Monk,
There are lot's of ways to do this - you might want to consider taking a look at perldoc perlre.
#!/usr/bin/perl -w use strict; my $number = 1234; my $last2; if ( $number =~ /^\d\d(\d\d)$/ ) { $last2 = $1; } print "$last2\n" if defined $last2;
Cheers - L~R

Update: Regular expressions can be tricky as can be the notion of what constitutes a "number". You might also want to take a look at Mastering Regular Expressions and Scalar::Util's looks_like_number function for some more advanced stuff.