vendion has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl Monks!
I am trying to write a Perl module that generates a UPCE barcode, I have the module and everything installed but when I try to test my code it prints out an error about an unblessed reference. I have never used bless, nor do I quite understand how to use it (yes I know that is bad). Here is the code that I am working with.
use GD::Barcode::UPCE; my $oGdBar = GD::Barcode->new( 'UPCE', $customer{id} ); if ( !$oGdBar ) { display_menu_error("ERROR: $GD::Barcode::errStr \n"); } print "PTN:", $oGdBar->{text}, ":", $oGdBar->{barcode}, "\n"; #FIXME Prints out an error regarding unblessed referance my $output = '/tmp/UPCE.png'; open my $OUTFILE, '>', $output; print {$OUTFILE} $oGdBar->plot->png; close {$OUTFILE}; undef $oGdBar; undef $OUTFILE; undef $output; system "lpr -r $output";
I tried to follow the example file that was included with the tarbal for the module. The $customer{id} variable contains a string in this form "000-000000".
|
|---|