Cool/useful short examples of Perl?

Dave Hodgkinson davehodg at gmail.com
Mon May 30 17:37:29 BST 2011


On 30 May 2011, at 16:59, Uri Guttman wrote:

> 
> from the File::Slurp synopsis. can't get much cooler, short or useful
> than this. :)
> 
> 
> # Here is a simple and fast way to load and save a simple config file
> # made of key=value lines.
> 
>  my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
>  write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ;

Jack Nicklaus called.



More information about the london.pm mailing list