my @day_of_week = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'); sub check_business_day { my ($name_of_day) = @_; if ( grep( /^$name_of_day$/, @day_of_week ) ) { return 1; } else { return 0; } } check_business_day($date_time->day_name());
Function returns 1 if given day name from $date_time variable is a business day, otherwise it return 0.
Reference :
[1] Source Pastebin.com
No comments:
Post a Comment