When i put it in subroutine still doesn't work, thogh by itself it does?
use strict;
sub Convert;
my $aa =<>;
chomp($aa);
my $c = Convert($aa);
print $c, "\n";
sub Convert
{
my $a = @_;
my %amin = (
ALA => "A",
ARG => "R",
ASN => "N",
ASP => "D",
ASX => "B",
CYS => "C",
GLU => "E",
GLN => "Q",
GLX => "Z",
GLY => "G",
HIS => "H",
ILE => "I",
LEU => "L",
LYS => "K",
MET => "M",
PHE => "F",
PRO => "P",
SER => "S",
THR => "T",
TRY => "W",
TYR => "Y",
VAL => "V"
);
my $b;
foreach my $key (keys %amin) {
if ($a eq $key) {
$b = $amin{$key};
}
}
return $b;
}
use strict;
sub Convert;
my $aa =<>;
chomp($aa);
my $c = Convert($aa);
print $c, "\n";
sub Convert
{
my $a = @_;
my %amin = (
ALA => "A",
ARG => "R",
ASN => "N",
ASP => "D",
ASX => "B",
CYS => "C",
GLU => "E",
GLN => "Q",
GLX => "Z",
GLY => "G",
HIS => "H",
ILE => "I",
LEU => "L",
LYS => "K",
MET => "M",
PHE => "F",
PRO => "P",
SER => "S",
THR => "T",
TRY => "W",
TYR => "Y",
VAL => "V"
);
my $b;
foreach my $key (keys %amin) {
if ($a eq $key) {
$b = $amin{$key};
}
}
return $b;
}