use Regexp::Common; if ( $input =~ m/\A$RE{num}{int}\z/ ) { print "Ganzzahl eingegeben\n"; } else { print "Keine Ganzzahl\n"; }