From: Ian Jackson Date: Tue, 25 Aug 2009 16:11:59 +0000 (+0100) Subject: Saner sourcebasedir function X-Git-Tag: 3.4~104^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=6d33c3a7453e6b13057cda116d3dadd52d4bcd0b Saner sourcebasedir function --- diff --git a/yarrg/CommodsWeb.pm b/yarrg/CommodsWeb.pm index 84ea710..1eae15e 100644 --- a/yarrg/CommodsWeb.pm +++ b/yarrg/CommodsWeb.pm @@ -62,12 +62,10 @@ sub sourcebasedir () { for my $dir (@INC) { if ($dir =~ m/\.perl-lib$/) { - $dir= "$dir/.."; - last; + return "$dir/.."; } } - defined $dir or - die "no source base dir in @INC"; + die "no source base dir in @INC"; return $dir; }