Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: text munging utility

by jeffa (Bishop)
on Jan 26, 2004 at 22:01 UTC ( #324284=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # generate numeric comparison routines
    sub build_num_comp {
    ...
      elsif($cexp eq 'nr') { return sub { return ($_[0] !~ /$cval/); } }
      else { print "Invalid comparison, use ax -h for help.\n"; exit(1); }
    }
    
  2. or download this
    sub build_num_comp {
       my $truth = eval "@_";
    ...
    
    print build_num_comp(5,'==',5)->() ? 'yes' : 'no';
    print build_num_comp(5,'!=',5)->() ? 'yes' : 'no';
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://324284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2020-11-26 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?