my ($num)= $seqnum=~/^(\d+)/;This would extract the first string of digits inside the string $seqnum. I'm not sure whether this is what the OP wanted. Giving the call to the write-function in the posting, I rather think the OP would like to catch those cases where the string does not evaluate to an integral number. I think one portable solution would be
use Scalar::Util qw(looks_like_number); if(looks_like_number($seqnum) && int($seqnum)==$seqnum) { # $seqnum is arithmetically an integral number }
In reply to Re^2: Style and warnings
by rovf
in thread Style and warnings
by api
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |