in reply to undef vs empty string '' from split
You can achieve what (I presume) you want by ensuring there is at least one character following the match:
( $var1, $var2 ) = split( /\s*=\s*(?=.)/, $t_arr[0] );
Note however that if you are hand rolling an .ini file parser, that there area a plethora of modules to do the job on CPAN. See Config::Ini and Config::IniFiles for example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: undef vs empty string '' from split
by chrism01 (Friar) on Jun 21, 2007 at 01:23 UTC |