use Getopt::Long; use strict; use warnings; use Data::Dumper; my %hash; GetOptions(\%hash, 'pdcuse!', 'uamlist=s', 'loginmesg=s'); print "" . Dumper(\%hash) . "\n"; __END__ perl test.pl -u "test eins zwei drei" -l "test drei vier fuenf" -p yields: $VAR1 = { 'pdcuse' => 1, 'uamlist' => 'test eins zwei drei', 'loginmesg' => 'test drei vier fuenf' };