#!/usr/bin/perl -wT use strict; use Test; BEGIN { plan tests => 345 } for my $num (-56789, -300, -1, 0..100, 5345, 6574572, 23457356) { ok( is_integer($num) ); my $string = "$num"; ok( not is_integer($string) ); } for my $string ((map { chr($_) } 0..127), 'dog', 'cat', 'mouse') { ok( not is_integer($string) ); } sub is_integer { ~$_[0] !~ /\D/ }