Howdy all :)

I'm trying to workup a nice Locale::Maketext fail_with() method, and having a bit of trouble with the last comment in the code below:

$lh->fail_with(sub {
    my ($lh, $key, @args) = @_;

    # do db lookup and return that if it was not in the db (IE !undef)
    my $db_version = _get_key_from_db($key);
    return $db_version if defined $db_version;

    # at this point we know it was not in the database so we log it:
    _log_phantom_key(ref($lh), $key, @args); # and then:
        
    # return 'en' string (if not in 'en' do: _AUTO)
});

So if it was not in 'fr', and not in a special 'fr' db entry, then I want it to return the 'en' entry and if not in 'en' then the string just as _AUTO does.

What are the best ways to do this properly?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to