in reply to Re^4: Reading host from defaults file with DBD::mysql
in thread Reading host from defaults file with DBD::mysql
What module did you use for reading/parsing your INI file? Config::Tiny? Config::Simple? Config::INI? Something else? Or did you roll your own?
For example, Config::Tiny handles spaces around the equals just fine:
#!/usr/bin/perl -l use warnings; use strict; use Config::Tiny; my $ini_string = <<"EOINI"; a=nospace b = space [GROUP1] c=nospace d = space EOINI my $cfg = Config::Tiny->read_string($ini_string); use Data::Dumper; $Data::Dumper::Indent = 0; print Dumper $cfg; __END__ __OUTPUT__ $VAR1 = bless( {'_' => {'a' => 'nospace','b' => 'space'},'GROUP1' => { +'d' => 'space','c' => 'nospace'}}, 'Config::Tiny' );
I don't have the other two installed, but Config::INI claims to handle spaces around the equals, and Config::Simple's claim of "whitespace support" implies to me that it might
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Reading host from defaults file with DBD::mysql
by parv (Parson) on Feb 01, 2019 at 18:32 UTC | |
by pryrt (Abbot) on Feb 01, 2019 at 20:16 UTC | |
by Llew_Llaw_Gyffes (Scribe) on Feb 01, 2019 at 20:59 UTC | |
by parv (Parson) on Feb 04, 2019 at 09:29 UTC |