[Israel.pm] quick help please on parameter parsing

Yuval Yaari yuval at windax.com
Tue Oct 19 03:00:24 PDT 2004


Prager, Mark wrote:

>Hi -
>I want to pass a parameter for timenow to a perl script -
>so the parameter can be either 
>
>now or
>now+NoOfMinutes
>
>How can I parse this easily in perl to get the no of minutes ( zero or more ) ?
>
What's wrong with @ARGV or Getopt::Std and some basic regex?
$ARGV[0] =~ m/now\+(\d+)$/;

  --Yuval



More information about the Perl mailing list