# No error checking ($s1,$s2)=@ARGV; print ((abs(minutes($s1)-minutes($s2)) <= 3*60) ? "yes\n" : "no\n"); sub minutes { my($str)=@_; if ($str =~ /(\d+):(\d+)/) { return $1*60+$2; } return undef; }
In reply to Re: Extract times from strings and compute difference
by sgifford
in thread Extract times from strings and compute difference
by devslashneil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |