Red Hat Bugzilla – Bug 145605
Uninitialized value in perl substitution when configuring HP DeskJet 3650
Last modified: 2007-11-30 17:10:58 EST
Description of problem:
Using foomatic-configure to configure an HP DeskJet 3650 seems to work but
displays a perl warning which doesn't look good.
Version-Release number of selected component (if applicable):
All the time.
Steps to Reproduce:
1. foomatic-configure -s cups -n deskjet-3600-2 -p HP-DeskJet_3650 -d hpijs
The following warning is displayed:
Use of uninitialized value in substitution (s///) at
/usr/lib/perl5/vendor_perl/5.8.5/Foomatic/DB.pm line 3427.
The printer itself seems to be properly configured except that I do need to
change the page size from A4 to Letter.
I think line 3427 of that file needs to be changed to:
$tmpl =~ s!\@\@IEEE1284\@\@!$ieee1284!g if $ieee1284;
(i.e. add "if $ieee1284" before the semi-colon)
Can you try that and see if it prevents the warning?
Yes, that makes the warning go away. Thanks.
Fixed in CVS. Thanks.
Tim, your fix caused another problem: If $ieee1284 is not defined
(printer has no autodetection info supplied in its Foomatic XML file)
the placeholder "@@IEEE1284@@" in the PPD file template is not
replaced and so the placeholder stays in the final PPD file. Such a
PPD file fails when run through "cupstestppd" and CUPS (1.1.19 or
newer) does not accept it. So jobs do not get printed by CUPS.
The correct way to fix the bug is to replace the line "my $ieee1284;"
by "$ieee1284 = '';". Then the variable is always predefined even if
no autodetection info will be found. This leads to the placeholder
being replaced by an empty string without warning.
I have fixed this on the Foomatic CVS now.
See also http://www.linuxprinting.org/pipermail/hp-list/2005q1/006247.html
What information do you need in order to have the HP DeskJet 3650 autodetected?
If it helps, it's a USB printer with:
Vendor Identifier: 03F0
Product Identifier: 7204
Manufacturer String: hp
Product String: deskjet 3600
Please let me know if you could use some more information.
Till: thanks, and sorry for breaking it.
Dave: you need to open a separate bug report so that it can be tracked
correctly. This bug report is for the uninitialized value warning.
The information we need is the stuff that system-config-printer
displays in the terminal when you run it in a terminal.
Fixed foomatic built in rawhide.