Hi Shlomi, it took me a while to get back to it. The versions of the two systems where the error came up are:
1. Slackware 14.0, kernel 3.2.29-smp "This is perl 5, version 16, subversion 3 (v5.16.3) built for i486-linux-thread-multi" Carp.pm: our $VERSION = '1.26'; 2. Debian testing ("Debian 3.16.7-ckt7-1 (2015-03-01) i686") This is perl 5, version 20, subversion 2 (v5.20.2) built for i586-linux-gnu-thread-multi-64int Carp.pm: our $VERSION = '1.3301'; From what Andy said I think it is not easy to reproduce the error. I was not successful when trying it out on my system with the same Perl (perhaps a different patch level, though), and the same data. At least, I'm sure it is not reproducible using a minimal example. I don't know if this setting has any influence: main( @ARGV ) unless caller(); sub main { ... } sub ... I just worked around by using warn/die again. -- Manfred On Tue, 31 Mar 2015 13:24:31 +0300 Shlomi Fish <shlo...@shlomifish.org> wrote: > Hi Manfred, > > On Tue, 31 Mar 2015 10:28:13 +0200 > Manfred Lotz <manfred.l...@arcor.de> wrote: > > > Hi there, > > I have a script where I use croak and somebody else using that > > script gets > > > > Bizarre copy of HASH in list assignment > > at /usr/share/perl/5.20/Carp.pm line 228. > > > > I get a message like this, instead: > > > > Variable b has empty value! at ./x.pl line 23. > > main::myfunc() called at ./x.pl line 8 > > > > which is what should happen. > > > > Any idea what this message means? I'm not able to reproduce it. > > > > Here a minimal example: > > > > #! /usr/bin/perl > > > > use strict; > > use warnings; > > > > use Carp; > > > > myfunc(); > > > > > > > > sub myfunc { > > my %vars = ( > > 'a' => 'some val', > > 'b' => q{}, > > ); > > > > while ( my ( $key, $val ) = each %vars ) { > > if ( not defined $val ) { > > croak "No value given for $key"; > > } > > if ( $val eq q{} ) { > > croak "Variable $key has empty value!"; > > } > > } > > return; > > } > > > > This code looks fine to me (except for some \t|4-space-indent mixup, > which is relatively minor). I cannot reproduce the reported problem > here ( perl-5.20.1-8.mga5 on Mageia Linux x86-64 5 - I'm getting > something similar to what you are getting). > > Can you please ask your friend for: > > 1. Operating system + version. > > 2. The perl 5 distribution and its version. > > 3. Version of Carp.pm and the surrounding lines. > > 4. Other parameters of their environment. > > Maybe this way we'll be able to reproduce it. > > Regards, > > Shlomi Fish > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/