#!/your/perl/here use strict; use warnings; my $options; my $string; BEGIN { $string = <<'HERE'; -one First parameter HERE } use Getopt::Declare $string => $options; ### <<< BONK! print "one = $options->{-one}\n"; #### use Getopt::Declare; $options = Getopt::Declare->new($string);