Cool/useful short examples of Perl?
Ben Tisdall
ben.tisdall at photobox.com
Mon May 30 17:33:27 BST 2011
Config::Tiny fits the bill nicely.
On Mon, May 30, 2011 at 5:13 PM, Denny <2011 at denny.me> wrote:
> On Mon, 2011-05-30 at 11:59 -0400, Uri Guttman wrote:
>> from the File::Slurp synopsis. can't get much cooler, short or useful
>> than this. :)
>> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
>> write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ;
>
> It's kind of horrific looking though, and potentially fragile. Is there
> a less hideous way of doing it with another module? Config::Any covers
> the read but not the write...
>
>
More information about the london.pm
mailing list