Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to write testable command line script?

by perlancar (Hermit)
on Nov 22, 2018 at 01:29 UTC ( [id://1226157]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ### file: trig_calc1.pl
    #!/usr/bin/env perl
    
    ...
        require Perinci::CmdLine::Any;
        Perinci::CmdLine::Any->new(url => '/main/trig_calc')->run;
    }
    
  2. or download this
    ### file: trig_calc2.pl
    #!/usr/bin/env perl
    
    ...
        use Perinci::CmdLine::Any;
        Perinci::CmdLine::Any->new(url => '/main/trig_calc')->run;
    }
    
  3. or download this
    ### file: lib/TrigCalc.pm
    package TrigCalc;
    
    ...
    }
    
    1;
    
  4. or download this
    ### file: script/trig_calc
    #!/usr/bin/env perl
    
    ...
    
    use Perinci::CmdLine::Any;
    Perinci::CmdLine::Any->new(url => '/TrigCalc/trig_calc')->run;
    
  5. or download this
    ### file: t/trig_calc.t
    #!perl
    use strict;
    ...
    is_deeply(TrigCalc::trig_calc(90, 35, 29, '+', 90, 24, 31), [181,  0, 
    + 0]);
    
    done_testing();
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found