#!/usr/bin/perl
use strict;
use warnings;
use Text::QRCode;
use TextPrinter;
use GridFiller;
use Path::Class;

my $data='MECARD:N:Ceccarelli,Gianni;TEL:+447564023056;EMAIL:dakkar@thenautilus.net;URL:http://www.thenautilus.net/contacts/;NICKNAME:dakkar;;';

my $qr=Text::QRCode->new(
    level=>'H',
    mode=>'8-bit',
);

my $arr=$qr->plot($data);

my @words = grep { length($_) > 2 }
    file('/usr/share/dict/words')->slurp(chomp=>1);

my $filler=GridFiller->new({words=>\@words,grid=>$arr});

$filler->fill;

TextPrinter::draw_whole($filler->result,1);
