in reply to Easy hash question (uninitialized value)
Use chomp:
.... say 'Enter a number: '; my $number = <STDIN>; chomp( $number ); say $number; .... [download]
Produces:
Enter a number: 4 4 bash done [download]