in reply to split, Use of uninitialized value
I don't think your if test#!/usr/bin/perl -w use strict; use Data::Dumper; use constant index1 => 0; use constant index2 => 1; my $rec = [ undef, 1 ]; print Dumper($rec); # inspect before if print "$rec->[index1] $rec->[index2]\n"; # warnings here (line 11) if ( defined $rec->[index1] && $rec->[index1] ne '' && defined $rec->[index1] && $rec->[index1] eq '1' ) { print "OK\n"; } else { print "Not OK\n"; } print Dumper($rec); # and check again after if
$VAR1 = [ undef, 1 ]; Use of uninitialized value at ./p09.pl line 11. 1 Not OK $VAR1 = [ undef, 1 ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: split, Use of uninitialized value
by pg (Canon) on Jan 07, 2004 at 03:49 UTC | |
|
Re: Re: split, Use of uninitialized value
by Anonymous Monk on Jan 07, 2004 at 03:54 UTC | |
by Roger (Parson) on Jan 07, 2004 at 04:02 UTC | |
by Anonymous Monk on Jan 07, 2004 at 04:12 UTC | |
by Roger (Parson) on Jan 07, 2004 at 04:34 UTC | |
by Anonymous Monk on Jan 07, 2004 at 04:43 UTC | |
|