Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Github repo with plenty of module examples

by neilwatson (Priest)
on Feb 10, 2017 at 14:37 UTC ( #1181669=CUFP: print w/replies, xml ) Need Help??

This site has large and hopefully growing number of code examples for Perl modules.

Neil Watson
watson-wilson.ca

  • Comment on Github repo with plenty of module examples

Replies are listed 'Best First'.
Re: Github repo with plenty of module examples
by stevieb (Abbot) on Feb 10, 2017 at 15:44 UTC

    While we're sharing our examples, I have a boatload of one-off type example Perl scripts in my scripts repo here :)

    I think it's a good idea to share our one-off-type stuff!

      Here's couple of my scripts :-). I totally forgot about some of them so I updated the README file to refresh my memory.


      I don't care to belong to a club that accepts people like me as a member. -- Groucho Marx
Re: Github repo with plenty of module examples
by 1nickt (Monsignor) on Feb 10, 2017 at 14:55 UTC

    Cool idea. I wouldn't recommend that implementation as an example of good Perl style, though:


    my $date_1 = new DateTime (year => 2014, month => 7, day => 5);
    my $date_2 = new DateTime (year => 2014, month => 7, day =>15);
    
    # Calculate Δ
    #    delta_tays() returns a DateTime::Duration object
    printf "date_2 (%s) is %d days away from date_1 (%s)\n", $date_2 -> dmy, $date_1->delta_days($date_2)->delta_days, $date_1 -> dmy;
    
    my $today = today DateTime;
    
    printf "Tdoay is %s\n", $today->dmy;
    

    ( sic: https://github.com/ReneNyffenegger/PerlModules/blob/master/DateTime/script.pl )


    The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1181669]
Approved by stevieb
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-07-18 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (388 votes). Check out past polls.

    Notices?