#!/usr/bin/perl -w use strict; use warnings; use Getopt::Long; my ($test); my $a = "1"; GetOptions( "test" => \$test); \$test->() if ($a > 0); if ($test) { print "Running test.....\n"; }