in reply to (duplicate, do not respond) Total Noob....
The way to do what you want is to create a lexical variable with my.
#!/usr/bin/perl -w use strict; print "Hello, I am Komodo what is your name? "; my $name = <STDIN>; chomp $name; print "Hello, $name!\n";
For more, see Coping with Scoping. Required reading for all n00bz.
|
|---|