#!/usr/bin/perl -w use strict; &a; sub a{ ASK: print "enter a number: "; chomp(my $a=); if ($a=~/[^\d]/){ print "not a number!\n"; goto ASK; } else { print "you entered: $a\n"; goto ASK; } }