> On Jun 3, 2016, at 2:36 AM, Kamil Cholewiński <harry6...@gmail.com> wrote: >> On Thu, 02 Jun 2016, Ray Lai <r...@raylai.com> wrote: >> use JSON::PP; > > That's just my personal opinion, but JSON sucks for configuration files. > It's more of a human-readable data interchange format. > > It feels like the same functionality can be achieved with something much > simpler, getent or CSV style.
I agree. All I need are hashes and arrays. Any examples would be welcome, I'm open to changing the file format. But as wifind.conf(5) says, I chose json because it's included in Perl. I was more concerned with having a set-it-and-forget-it solution. The config file is a minor detail that can be changed. > >> my $tmp = "/etc/wifind.tmp"; > > mkstemp? Will fix >> Please avoid nwid or wpakey with quotes, dollar signs, or backslashes. > > Without knowing or assuming much about how WiFi works, why would this be > a concern in a well-designed program? Currently wifind parses 'ifconfig if scan' output, which, according to my reading of the code, simply adds "double quotes" around any nwid with white space when printing. (I've not tested my theory that nwid with " in the name would cause problem. ) Likewise, netstart takes nwid and wpakey, which could include spaces, but as netstart is a shell script, I have not tested what happens when the values contain backslashes, dollar signs, or double quotes. Caveat emptor! Thanks for your feedback, I appreciate it! Ray