#! /usr/local/bin/perl -w use strict; use Getopt::Std; my %args; getopt('g', \%args); my $thing = shift || 'world'; print $args{g} ? 'Goodbye' : 'Hello', ", $thing\n";