CPAN-API/cpan-api — pull request #151 by rwstauner (2011-12-17 02:57:35+00:00)
Title: Glob operator context weirdness causes META.json to get skipped

I'd be very interested if these tests fail for anybody else.

If you've got a working (Testable) api checked out, fetch this branch, then check out the parent commit.

git checkout 4262cd

Alternatively just checkout this branch and remove the parens from the lib/MetaCPAN/Script/Release.pm (use scalar context on the glob).

First run `prove -lv` once which will build the fake cpan and execute t/release/prefer-meta-json.t (which failed for more).
Then you can run `prove -lv t/script/release/load_meta_file.t` and see if that passes or fails.

I was trying to fake a dist with a META.json file and it just didn't seem to be getting picked up...
Strangely it seemed that calling the glob operator in scalar context it was skipping over the first `*/META.json` even though the file existed.

In fact adding something along the lines of `if( <$dir/$_> =~ /Something/ ) { print "globbed: ". <$dir/$_>`
Seemed to finally return the right value the third time (not the first or second)...
After finally figuring out where the issue was originating,
simply switching to list context seemed to make it work much more reliably.

So if anybody has time to test it I'd be curious if it's my machine or my perls or if it happens like this to everyone.