in reply to Using associative arrays with I/O to interact with Prog. User

Please use <code>...</code> tags around your code.
#use strict #use warnings

That's the first mistake: don't comment out these lines, they are your first sanity check. And declare your variables with my.

$name=<stdin>;

Did you mean STDIN instead? Perl is case sensitive.

%family[...

That's not Perl syntax. Please read perlintro, perlsyn and perldata. Or even buy yourself a good Perl book, like "Learning Perl".

Replies are listed 'Best First'.
Re^2: Using associative arrays with I/O to interact with Prog. User
by jwkrahn (Abbot) on Dec 01, 2008 at 19:15 UTC

    Perl still supports the lower case forms of stdin, stdout and stderr:

    $ perl -le'/std/i && print for keys %::' stderr stdout stdin STDOUT STDERR STDIN $ perl -le'print stdout "Hello" or die $!' Hello

    But to get it to work with strict and warnings enabled is a bit more difficult:

    $ perl -Mwarnings -Mstrict -le'print {*stdout} "Hello" or die $!' Hello $ perl -Mwarnings -Mstrict -le'print {\*stdout} "Hello" or die $!' Hello