Caleb Cushing's Blog Also known as XenoTerraCide
Posts with the tag perl:

Teaching Perl - Week 3 - Textual Data

So lastweekyou should have covered variables, conditionals, flow control statements, calling functions, stdin/out/err, and using new perl features.This week we’re covering text processing, scalars, external libraries, and reinforcing what we learned last week. Text Processing is one of Perl’s specialty’s, mostly due to it’s powerful regular expression engine.First install LWP with cpan. cpanp -i Bundle::LWPwill do it.#!/usr/bin/perluse strict;use warnings;use LWP::Simple;getprint(“http://aur.archlinux.org/packages/modern-perl/modern-perl/PKGBUILD");So this is almost completely new… what does it do? and what does it have to do with text?

Teaching Perl - Week 3 - Prelude Commentary

So I think that Head First Programming: A Learner's Guide to Programming Using the Python Languageis a great guideline to teach any programming course, esp a 10 week course as it has 10 chapters. We’re one week behind. Arguably you could merge week 2 into week 1 and I may do just that in a rewrite of this series. In fact I’d suggest you do just that. But for now I’m going to continue on and we’ll see what people think once I reach the end.

Dist::Zilla vs xenoterracide

Yes, I am invincible! I solved my problemwith Dist::Zilla. If you agree with me that you should be able to install from your git repository, without requiring your users to have Dist::Zilla installed here’s one way of doing it.First install Dist::Zilla::Plugin::CopyTo. Now Edit your dist.ini. Most people probably use one of the Dist::Zilla bundles. Assuming you use Basic here’s what you do.; remove GatherDir from basic so we can specify it seperately[@Filter]bundle = @Basicremove = GatherDir; specify the where your ungenerated source lives[GatherDir]root = src; specify where you want the generated source to live[CopyTo]dir = .

My new Love/Hate Relationship with Dist::Zilla

Dist::Zillais a great release tool, code generator, and it just plain takes the boring part of doing a release away from you.That having been said, it does, imo, horrible things to your source repository. “But, Caleb, it cleans up your source repository you can remove a lot of excess stuff you don’t really need to be storing there”. Well… I disagree, to the point that I’ve used every explicative in the book to express my displeasure.

Teaching Perl - Week 2 ( part2 )

This part2 was prompted by Chromatic’s post on state. I’d never heard of state before, and it’s documentation is poor. Let’s take a look at how state could affect our game. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #!/usr/bin/env perl # guess a number game use strict; use warnings; use feature qw( say state switch ); say 'welcome'; # generate the winning number between 1 and 10 # see perlfaq4 for algorithm details my $winning_num = 1 + int( rand( (10-1)+1 ) ); until ( $winning_num == state $guess ) { say 'Guess a number between 1 and 10: '; $guess = readline(*STDIN); # check to see if we have a winner, or the guess is to high, or low.

Teaching Perl - Week 2

Teaching Perl - Week 1 - ( Part2 )

Teaching Perl - Week 1 - ( Part1 )

Make sure you’ve read Part 0first.As I said before Baker provides a Linux server for the perl class. However, none of the students have had a unix class. So I advise touching on it and giving them a link to these tutorialsif they want to use it, and a helping hand. The book also talks about ActiveState but this isn’t the recommended way to do perl on windows anymore. Avoiding crux will prevent you from wasting a week or more on unix which is not what the class is about (my instructor failed horribly at this, and at knowing unix (or perl for that matter) well enough to cover it).

Teaching Perl - Part 0 - Preface

This is my 2 cents on how perl should be getting taught at my school. My school’s curriculum sucks in general across the board. But assuming I can’t change what classes are taught, when and what prerequisites this is how I would teach perl given the current computer science curriculum.Since people reading this are probably not familiar with the Fail that is Baker College(I would not choose Baker if I had to start again but credits don’t transfer easily, so it was easier to continue on with it).

Say Perl

SayPerllaunched yesterday. It’s essentially aggregated perl blogs translated through google’s translation service into english. Very awesome. 3 things could make it better.1) An atom/rss feed 2) instead of clicking on ‘spanish’ and listing all the feeds that were written in spanish… click on spanish (or make it espanol) and have it show all the feeds translated into spanish.3) It’s newest post is a while ago… so it’s update speed could be a bit better.