From: Andrew Ruthven Date: Tue, 13 Jan 2009 19:27:56 +0000 (+1300) Subject: Handle the case where the eval fails. X-Git-Tag: debian-0.2-1~16 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75aaf20db6dd0b68e07086f39728d6e9e78806e8;p=asterisk-agi-enum.git Handle the case where the eval fails. Thanks Mahlon for pointing this out. --- 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} =