in reply to Re: A better way than ||
in thread A better way than ||
it's an identification number of the shape 9525423E. @digits is gotten using a split:I think in this case you're better of using a regex, so you can verify the input split more conveniently:
my $input = '9525429E'; if ( $input =~ /^([0-9]{7})([A-Z])$/ ) { my @digits = split //, $1; print "@digits, $2"; } else { print "invalid input"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A better way than ||
by Aristotle (Chancellor) on Jan 01, 2006 at 15:38 UTC |