in reply to Re: Passing entered value into sub for IO::Prompt
in thread Passing entered value into sub for IO::Prompt
Looking at the example, it seems I may have to use an anonymous subroutine instead? I figured it would be better for maintainability and reuse if I put in a separate CheckDate sub. That said, I tried putting it an anoymous sub, and get the following, which is always valid, even when I enter a **invalid** date (e.g. asagfas):sub CheckDate { my $date = shift @_; print "Date: $date\n"; return true; }
What am I missing here?-require=>{ "Must be in the format (two di +gits per value) of MM/DD/YY: " #=> \&CheckDate($_) => sub {return (ParseDate($_)) + ? true : false } #=> sub {return true } }
-- Burvil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Passing entered value into sub for IO::Prompt
by GrandFather (Saint) on May 28, 2008 at 00:34 UTC | |
by bowei_99 (Friar) on May 28, 2008 at 01:34 UTC |