Strange. It works for me on Linux with Perl 5.8.3. Some quick tests show that the arguments to a class's import function are identical for both the command-line version and the use statement. Maybe it's time to fire up the debugger or add some print statements to your encoding.pm?

Update: Here are the small test programs I used. They can probably tell you what's different between cygwin and cmd.exe.

T56.pm:

package T56; use base 'Exporter'; sub import { my $class = shift; print "$class import @{[scalar(@_)]} items: @_\n"; my $fh = $_[0]; print $fh "Ouput to first param\n"; } 1;

t56:

use T56 STDOUT, bar => 'baz';

Compare the output of these to see what's different:

perl t56 perl -MT56=STDOUT,bar,baz -e 1

End of Update

Here's my Perl info:

Summary of my perl5 (revision 5.0 version 8 subversion 3) configuratio +n: Platform: osname=linux, osvers=2.6.8-1.521smp, archname=i386-linux-thread-mu +lti uname='linux jane.spidermaker.fedoralegacy.org 2.6.8-1.521smp #1 s +mp mon aug 16 09:25:06 edt 2004 i686 athlon i386 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 - +Dversion=5.8.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc +=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchn +ame=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Du +sethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun - +Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperl +io -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin +/less -isr -Dinc_version_list=5.8.2 5.8.1 5.8.0' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemulti +plicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS + -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_S +OURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -g -pipe -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGI +NG -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.3.3 20040412 (Red Hat Linux 3.3.3-7)', + gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.s +o gnulibc_version='2.3.3' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c -Wl,-rpath,/usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_ +FILES PERL_IMPLICIT_CONTEXT Locally applied patches: SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962 Built under linux Compiled at Jan 28 2006 09:58:00 %ENV: PERL5LIB="/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi:/ +usr/lib/perl5/site_perl/5.8.3" @INC: /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/5.8.3/i386- +linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/i386-linux- +thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/5.8.2 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/5.8.1 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/5.8.0 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/5.8.2 /usr/lib/perl5/site_perl/5.8.3/5.8.1 /usr/lib/perl5/site_perl/5.8.3/5.8.0 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/5.8.3/i386-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl

In reply to Re: Strange interaction between command line and encoding by sgifford
in thread Strange interaction between command line and encoding by VSarkiss

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.