$ perl t1.pl 12345 passt nicht. $ perl t1.pl 123456 yo, das passt. $ perl t1.pl 1234567 passt nicht. # das Programm: $ cat t1.pl #!/usr/bin/perl use strict; use warnings; my $value = shift @ARGV; if ( $value =~ m/^\d{6}$/ ) { print "yo, das passt.\n"; } else { print "passt nicht.\n"; } __END__ $