From a5ab00c5427d9e3b97b08d7c4570fb2b782bf696 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 31 May 2009 12:44:05 +0200 Subject: Simplestore.pm: Use Carp (→confess) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Simplestore.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Simplestore.pm') diff --git a/lib/Simplestore.pm b/lib/Simplestore.pm index aea8b2b..e5d060e 100755 --- a/lib/Simplestore.pm +++ b/lib/Simplestore.pm @@ -4,6 +4,7 @@ ## License: WTFPL use strict; use warnings; +use Carp; our (@ISA, @EXPORT, $VERSION); require Exporter; @@ -15,7 +16,7 @@ sub load { my $file = shift; my ($store, $key, $value); $store = shift if @_; - open(my $handle, '<', $file) or die("Cannot read $file: $!"); + open(my $handle, '<', $file) or confess("Cannot read $file: $!"); while (<$handle>) { chomp; /^(\S+)\s+(.*)$/ or next; @@ -33,7 +34,7 @@ sub load { sub save { my ($file, $store) = @_; my $key; - open(my $handle, '>', $file) or die("Cannot open $file: $!"); + open(my $handle, '>', $file) or confess("Cannot open $file: $!"); foreach $key (keys(%$store)) { foreach (split(/\n/, $store->{$key})) { print $handle "$key\t$_\n"; -- cgit v1.2.3