I sent a colleague a perl script, wrapped in my standard Perl polyglot, and
named with a .cmd extension, so that it can easily be run from the Windows
command line. This is the wrapper I use, which is based on bat2pl from the
ActiveState Perl installation:

@rem = '--*-Perl-*--
@echo off
perl "%~dpnx0" %*
goto endofperl
@rem ';
#!perl
#line 8
use strict;
use warnings;

# perl code goes here

__END__
:endofperl

She reported back to me that after installing ActiveState Perl 5.8.1.807,
she gets the following error:

Name "main::rem" used only once: possible typo at E:/.../csvsplit.cmd line
1.

I experimented on my machine, and I could make it do this by putting -w in
the perl statement on line 3, and then fix it again by putting -wx in, so I
advised her to put -x in the call thus:

perl -x "%~dpnx0" %*

Any ideas why her installation gives this error, and mine (same ActiveState
version) doesn't? Have I done something to turn off default warnings on my
system and forgotten that I did it? As far as I can remember, warnings are
off by default in Perl.

She was running the script in the manner I instructed, she was definitely
not doing "perl -w csvsplit.cmd". I had to give her detailed instructions on
how to run a command prompt, so she won't have done anything even more
complex like setting an environmental variable to turn warnings on.

I have previously posted this on PerlMonks, but no solution was forthcoming.

__________________________________________________
Phil Hibbs | Capgemini | Rotherham
Technical Consultant
__________________________________________________

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

Reply via email to