I am writing the small subroutine which will validate if the contents of the variable is alphabet or numeric. Below mentioned is my solution but I think there must be better way to do the same. So I would request all the Monks out there to help me with the same.
Regards#!/usr/bin/perl -w my $a = "aBcdeFG"; if ($a =~ /[a-z]+/i) { print "Alphabet\n"; } else { print "Numeric\n"; }
Joel
In reply to isAlpha / isNumeric by Jamnet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |