http://www.perlmonks.org?node_id=193341


in reply to Using multiple args per switch with Getopts::Std

&help unless (($opt_d, $opt_e) =~ /(\d{2})\/(\d{2})\/(\d{4})(.*?)$/);
isn't doing what you think it is. Compare them separately...

Replies are listed 'Best First'.
Re: Re: Using multiple args per switch with Getopts::Std
by blink (Scribe) on Aug 28, 2002 at 10:20 UTC
    You may be right, but I don't think that that's where my problem lies. The print statement that prints $opt_d and $opt_e, and returns "DD/MM/YYYY", rather than "DD/MM/YYYY HH:MM:SS", is executed before hitting the regex.