Cisco IP phone hard reset

Cisco IP phone hard reset.
Model: 7911/7912
  1. hold # key and wait several sec until the red indicator light up
  2. press the key sequentially -> 123456789*0#
Model: 7971
  1. hold # key and wait several sec until the red indicator light up
  2. press the key sequentially ->  3491672850*#
, , , , ,

Perl regular expression problem – not expect result

Code:
#!/usr/bin/perl
@line=(’56’, ‘1234’, ’24’);
foreach(@line)
{
$_=~/.*(3).*/;
print “##$1\n”;
}
Not expected result:
##
##3
##3
Code:

#!/usr/bin/perl

@line=(’56’, ‘1234’, ’24’);

foreach(@line)

{

print “##”.check($_).”\n”;

}

sub check

{

$_[0]=~/.*(3).*/;

return $1;

}

Expected result:
##
##3
##
, , ,