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;
}
--
Manfred
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/