in reply to Re: Any module suggestion for URL QRCode rendeing for ActivePerl?
in thread Any module suggestion for URL QRCode rendeing for ActivePerl?

Thanks Corion, I tried but I have problem with this module when I first use the write() method, I got nothing, and I added $img->write(file=>"./file.gif") or die $!, it dies with "No such file or directory". I have no clues about it

Then I tried to Data::Dump the $img obj, and I got 'IMG' => bless( do{\(my $o = 11056608)}, 'Imager::ImgRaw' I got nowhere can find this package (local harddisk, CPAN, ppm), and I the write() method was not in the Imager::QRCode either...

Any suggestion I can do about ?

Replies are listed 'Best First'.
Re^3: Any module suggestion for URL QRCode rendeing for ActivePerl?
by Corion (Patriarch) on Aug 04, 2014 at 11:24 UTC

    Maybe the current directory is not writeable?

    I recommend using absolute filenames when writing files from scripts that run in the context of a webserver.

      I just work it on desktop only, anyway, I tried with this
      $|=1; open F, ">R:/Test.txt" or die $!; print F "OK$/"; close F; open F, "R:/Test.txt" or die $!; print <F>; close F; use Imager::QRCode qw(plot_qrcode); my $img = plot_qrcode("blah blah"); $img->write(file => "R:/qrcode.gif") or die $!; # this is line 13
      and I got
      OK No such file or directory at C:\Documents and Settings\Panda\Desktop\t +est.pl line 13.

        The image you get back is an Imager object, and the documented method for checking if a ->write call was successful is:

        $thumb->write(file=>$file) or die $thumb->errstr;

        So maybe the $img->errstr method has better information?