use strict; use warnings; use Getopt::Std; use Data::Dump::Streamer; testSwitches (qw(-p -q)); testSwitches (qw(-s)); testSwitches (qw(-t)); testSwitches (qw(-s -t)); testSwitches (qw(-p)); sub testSwitches { local @ARGV = @_; my %opt; my $test; print join (' ', @ARGV), "\n"; getopt ('st', \%opt); Dump \%opt; print "\n"; }