PERL: Simple reg expr validate 6 digits number

Hi there!

I'm trying to validate a simple 6 digits number with reg expr. I ONLY want 6 digits so when i type 7 digits the script should no validate the number.

I've write this code:

#!/usr/bin/perl

while(<STDIN>){
if($_=~/\d{6}/){
print "Bingo!\n";
}else{
print "Error\n";
}
}

So when a type "123456" it validates well, when i type "1234567" ou "12345678" it validates too.

Many thanks !

#!/usr/bin/perl

while(<STDIN>){
if($_=~/^\d{6}$/){
print "Bingo!\n";
}else{
print "Error\n";
}
}

Thank you very much Ikon for this solution!