O'Reilly logo

Catalyst 5.8 by Antano Solar John

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extracting the data

Now that our database is full of data, it's time to make some sense out of it. We'll start by writing a function to determine the total number of points a "thing" has accumulated.

Instead of writing a script to test each query we write, we'll use a read-evaluate-print loop (REPL) to interact with our program in real time. To get a Perl REPL, install the Devel::REPL module from CPAN. That module provides a script called re.pl. Run re.pl, and you'll be able to type in Perl code as though you're at a shell prompt that understands Perl.

As an example, let us try adding an opinion from re.pl:

$ re.pl # the > is now re.pl's prompt > use lib qw(lib); > use ChatStat::Action; > use ChatStat::Schema; > my $s = ChatStat::Schema->connect('DBI:SQLite:root/database'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required