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
##
, , ,
Trackback

no comment untill now

Sorry, comments closed.