in reply to Undef and Unitialized Issue
In more general terms, I typically use something like this to silence those warnings (assuming a value of undef is not an error):
If in fact undef is an error I would generally use something along this line:my $string_var = defined( $input_field ) || ''; # or if ( ($string_var || '') !~ /some_pattern/ ) { ... }
croak "HEY! Why am I not defined?" if !defined( $input_field );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Undef and Unitialized Issue
by afoken (Chancellor) on Apr 04, 2015 at 09:11 UTC | |
by boftx (Deacon) on Apr 06, 2015 at 15:18 UTC |