AppConfig and @ARGV

I've been playing with the Perl AppConfig module (http://search.cpan.org/~abw/AppConfig-1.66/lib/AppConfig.pm)

It seems that the getopt() method messes up the global @ARGV array even if I pass it a copy.

For example:
 


#!/usr/bin/perl
use strict;
use warnings;
use AppConfig;
my $opts = AppConfig->new( { CASE   => 0, } );
$opts->define('config=s', {DEFAULT => ''});
print "ARGV: @ARGVn";
my $argvCopy = [@ARGV];
print "argvCopy: @$argvCopyn";
$opts->args($argvCopy);
print "after args() ARGV: @ARGVn";
$opts->getopt(qw(auto_abbrev), $argvCopy);
print "after getopt() ARGV: @ARGVn";


produces this output


# appconfig-error.pl --config xyz 123 abc
ARGV: --config xyz 123 abc
argvCopy: --config xyz 123 abc
after args() ARGV: --config xyz 123 abc     # @ARGV is still complete
after getopt() ARGV: 123 abc                # @ARGV has bits missing


This is a problem because I need to call getopt() twice — once to get at the –config option, then I read the configuration file with the file() method, then I re-read the command line options so that they override the ones in the configuration file.

Using args() is OK — @ARGV is preserved — but I need the extra feature of getopt().

I've emailed the author, so I'll wait to see what his reply is.

Panasonic KX-MB2000E on Linux

Notes on the Panasonic KX-MB2000E.

The printer — sorry, it's not a printer, it's a <q>Document System</q> — has a web interface: the user name is 'root' and the default password is '1234'.

Installing it as a printer on Xubuntu 11.10 was straightforward, once I'd done a bit of research.

Panasonic give instructions for Redhat here: http://panasonic.cn/support/download/manual/files/Linux_Install_for_KX-MB2000_series.pdf.

This is what I did on a laptop running Xubuntu 11.10:

  1. Download three .rpm files from http://www.panasonic.net/pcc/support/fax/common/table/linuxdriver.html
  2. Use alien to convert them to do .deb files.
  3. Use dpkg -i to install them.
  4. Connect the printer (I did it on the LAN).
  5. Use CUPS to set up the printer: when it asks for a PPD file, use the one in /usr/share/cups/model/kxmb2000.ppd.
  6. Done.

The scanner was more tricky — research suggested that it couldn't be done, and SANE had no reference to it.  But as the printer is capable of scanning to an FTP account or a Samba share, I set up a 'Scans' folder with write access via Samba, and entered the details on the printer (via the web interface or the buttons on the front).  And it works!  Pressing the Scan button and choosing SMB in the printer menu puts a PDF file in the Scans folder.  There's little or no control over scanning settings, but it's a start.

I tried to add this information to openprinting.org, but every time I try to log in there, I just get an empty page.