From 75aaf20db6dd0b68e07086f39728d6e9e78806e8 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 14 Jan 2009 08:27:56 +1300 Subject: [PATCH] Handle the case where the eval fails. Thanks Mahlon for pointing this out. --- enum.agi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enum.agi b/enum.agi index a852aa1..38e8cce 100644 --- a/enum.agi +++ b/enum.agi @@ -88,6 +88,10 @@ sub get_resources { $A->verbose( "$pattern, $replacement", 4 ); my $regexp = "\$resource =~ s/$pattern/$replacement/"; eval "$regexp"; + if ($@) { + $A->verbose( "ENUM replacement faileD: $@", 1 ); + next; + } $A->verbose( "new resource: $resource", 4 ); $resource =~ s/^(\w+):/\U$1\//; $records{$count} = -- 2.30.2