[Quoting Myk Melez, on August 29 2004, 07:00, in "Re: [Templates] tpag"]
> +if (!GetOptions(\%opt, "h|help", "d|define=s@",
> +my $vars = { };
> +for (@{ $opt{d} }) {
> +    my($var, $val) = split(/\s*=\s*/, $_, 2);
>      $vars->{ $var } = $val;
>  }

Getopt::Long supports this already:

  my $vars = {};

  GetOptions(...
             "d|define=s%" => $vars,
             ...);

-- Johan

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to