Melly has asked for the wisdom of the Perl Monks concerning the following question:
I've been happily using Getopt for sometime, but it only recently crossed my mind to wonder what the hell is going on when options are assigned to variables.
GetOptions( "header=s" => \$default_header )
Basically, what's going on with "header=s" => \$"? If I wasn't familiar with Getopt, I'd be scratching my head over why I'm passing a weird string ("header=s") and a reference to $default_header to a function called GetOptions, and using a hash assignment to do it.
Tom Melly, pm (at) cursingmaggot (stop) co (stop) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getopt::Long - why \$ ?
by Corion (Patriarch) on Oct 29, 2018 at 14:25 UTC | |
by Melly (Chaplain) on Oct 29, 2018 at 14:39 UTC | |
|
Re: Getopt::Long - why \$ ?
by ikegami (Patriarch) on Oct 30, 2018 at 02:21 UTC |