Browse files

[proof-of-concept] fixed .pm file opening

The ufo part of pls was under-tested, and blew up on first use. It should
open a path not relative to the cached project, but relative to the pls
dir. Also decided that a bare &open is too dangerous to have lying around,
and surrounded it with a try {} block.
  • Loading branch information...
1 parent 1b95d78 commit 663199f53380f8a0ec4559ab6db7f29f1650ba20 @masak committed Jul 4, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 proof-of-concept
View
10 proof-of-concept
@@ -149,7 +149,15 @@ class POC::Builder does App::Pls::Builder {
my @modules = map { path-to-module-name($_) }, @module-files;
my %usages_of;
for @module-files -> $module-file {
- my $fh = open($module-file, :r);
+ my $fh;
+ my $succeeded = False;
+ try {
+ $fh = open($cwd ~ '/' ~ $module-file, :r);
+ $succeeded = True;
+ }
+ unless $succeeded {
+ return failure;
+ }
my $module = path-to-module-name($module-file);
%usages_of{$module} = [];
for $fh.lines() {

0 comments on commit 663199f

Please sign in to comment.