因为有现成的模块,所以直接使用就可以了
#!/usr/bin/perl -w
use Imager::QRCode;my $qrcode = Imager::QRCode->new(size => 2,margin => 2,version => 1,level => 'M',casesensitive => 1,lightcolor => Imager::Color->new(255, 255, 255),darkcolor => Imager::Color->new(0, 0, 0),);my $img = $qrcode->plot("www.google.com");$img->write(file => 'google.jpg', type=>'jpeg') or die $img->errstr;