| 1 | package Spellunker::CLI; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use utf8; | ||
| 5 | |||
| 6 | use Spellunker; | ||
| 7 | |||
| 8 | sub new { | ||
| 9 | my $class = shift; | ||
| 10 | bless {}, $class; | ||
| 11 | } | ||
| 12 | |||
| 13 | sub run { | ||
| 14 | my $self = shift; | ||
| 15 | |||
| 16 | my $engine = Spellunker->new(); | ||
| 17 | while (<>) { | ||
| 18 | my @words = $engine->check_line($_); | ||
| 19 | print "Bad: $_ at line $.\n" for @words; | ||
| 20 | } | ||
| 21 | } | ||
| 22 | |||
| 23 | 1; | ||
| 24 |