print "Enter a string and I will determine the data type: "; chomp(local $_ = ); my %sigil2type = ('$' => 'scalar', '@' => 'array', '%' => 'hash', '*' => 'GLOB'); my $sigil = substr $_, 0, 1; my $type = $sigil2type{$sigil} || 'unknown'; say "\nThat is a $type data type.";