Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

torf or Mindy?

by metaperl (Curate)
on Apr 29, 2009 at 15:11 UTC ( #760901=snippet: print w/replies, xml ) Need Help??
Description: Well, oftentimes when pulling data from somewhere, you will need to humanize booleans... not everyone is a Mork from Ork!
sub torf {
    my($val, $true_word, $false_word)=@_;

    $true_word  ||= 'Yes' ;
    $false_word ||= 'No' ;

    $val ? $true_word : $false_word ;
}
Replies are listed 'Best First'.
Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://760901]
help
Chatterbox?
[choroba]: oh, you mean a cup with no water.
[Discipulus]: you are rigth, gory details but i remember from dunnowhere that concetrate caffein is more effective than brown water almost coffe..
[LanX]: prepared both kinds a 100 times and thinks the amount of grind code is about the same
Discipulus less effective i mean
[LanX]: (french press vs espresso cooker )
[LanX]: s/code/coffee/
Discipulus progammer is an organism that transforms caffeine into software..
[LanX]: hmm interesting link

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-01-16 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (149 votes). Check out past polls.