in reply to HTML and Perl

The problem is, <STDIN>=$name1 tries to assign the value identified as $name1 to the (read only) line read from standard input. Swap the lvalue (left side of the assignment operator) with the rvalue (right side) and you'll have better luck: my $name1 = <STDIN>; Of course, if you have a variable number of things to read, you're better off with an array. See push.