#!/usr/local/bin/perl
use strict;
use CGI qw(-nosticky);
use GD::Barcode::QRcode;
my $q = CGI->new();
my $me = $ENV{SCRIPT_NAME};
if( (my $string=$q->param('string')) && (my $level=$q->param('level')) ){
# ecc = l m q h
# version = 1 .. 40
# modify /usr/local/lib/perl5/site_perl/5.8.9/GD/Barcode/QRcode.pm
# -$oSelf->{Version} = $rhPrm->{Version} || 1;
# +$oSelf->{Version} = $rhPrm->{Version} || 0;
# then use Version => undef, below
my $qr = GD::Barcode::QRcode->new($string, {
Ecc => $level,
Version => undef,
ModuleSize => 8,
} );
print $q->header(-expires => 'now', '-Content-Type' => 'image/png'),
$qr->plot->png;
}else{
print $q->header(-expires => 'now'),
$q->start_html(), "\n",
$q->start_form('POST', $me), "\n",
'Code:
', "
\n",
'Redundancy Level: \n",
"
\n",
$q->submit(), "
\n",
$q->end_form();
}