CPANモジュール「GD::Barcode」を使ってQRコードを生成するサンプル。実行環境はWindows XP Home上のActive perl 5.8.8 qr01.pl #!/usr/bin/perl use strict; use warnings; use GD::Barcode; my $url = ‘https://blog.kumacchi.com/’; my $qrimg = GD::Barcode->new(‘QRcode’,$url,{‘Ecc’=>’M’,Version=>’4′,’ModuleSize’=>’3′}); open(FILE,">qr.gif"); binmode(FILE); print FILE $qrimg->plot->gif; close(FILE); exit(0);
![【perlメモ】CPANモジュール「GD::Barcode」を利用してQRコードを作成するサンプル](https://cdn-ak-scissors.b.st-hatena.com/image/square/3453fa87d261eca1dd6d4823c1d5fe29f4194518/height=288;version=1;width=512/http%3A%2F%2Fblog.kumacchi.com%2FWindowsLiveWriter%2FperlCPANGDBarcodeQR_BFAA%2Fqr_79090ca4-be63-4007-a39b-d55ff1655445.png)