lilphil has asked for the wisdom of the Perl Monks concerning the following question:
Yes, this is completely wrong. The result is trying to be something where I can do $self->{BAR} to find an option. Would a fellow monk care to enlighten me?sub readoptions { my $self = shift; # usually I would create a hash %hash = ( foo => \$bar ); # and reference %hash. unless i'm mistaken this creates # an anoymous hash and stores it in $self->{CONFHASH} $self->{CONFHASH} = { foo => \$self->{BAR} }; # first argument to GetOptions woudl usually be \%hash GetOptions( $self->{CONFHASH}, 'foo|f' ) or die "option not found"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating references
by Zaxo (Archbishop) on Jan 25, 2004 at 23:33 UTC | |
by Anonymous Monk on Jan 26, 2004 at 03:43 UTC |