in reply to Explanation of 'use strict;'

( Accidentally posted this in the dupe thread. Copied it here. )

You're getting that error because you're defining a package-global variable ($name) which is not allowed under strict. (Well, it's allowed, but it requires an explicit package name, which probably does not surprise you.)

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.