in reply to how add option to my program?

You can change your code to:
use strict; use warnings; sub version { print "Beginning perl's \"Hello, World.\" version 2.0\n"; } my $option = shift; $option or $option = ""; version if $option eq "-v" or $option eq "--version"; print "Hello, World.\n";
This eliminates the uninitialized value error. However, you still get "Hello, World" even with an option; I'm not sure if that's what you want...
Getopt is likely the way to go (much more flexibility.)
chas