my $shape = shift @ARGV; # take first argument off ARGV my %shapes = ( "tri" => "triangle", "cir" => "circle", "req" => "rectangle", "sqr" => "square" ); my $figure = $shapes{$shape} or die "Unknown shape $shape\n";