Skip to content

Commit

Permalink
RT#83728 deal with quoting rather than trying to hack with subs and p…
Browse files Browse the repository at this point in the history
…rototypes
  • Loading branch information
bingos committed Sep 1, 2013
1 parent 6046c56 commit 2ada15d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Module/Load/Conditional.pm
Expand Up @@ -13,7 +13,9 @@ use version;

use Module::Metadata ();

use constant ON_VMS => $^O eq 'VMS';
use constant ON_VMS => $^O eq 'VMS';
use constant ON_WIN32 => $^O eq 'MSWin32' ? 1 : 0;
use constant QUOTE => do { ON_WIN32 ? q["] : q['] };

BEGIN {
use vars qw[ $VERSION @ISA $VERBOSE $CACHE @EXPORT_OK $DEPRECATED
Expand Down Expand Up @@ -495,8 +497,8 @@ sub requires {
}

my $lib = join " ", map { qq["-I$_"] } @INC;
my $oneliner = 'sub foo(_){q[BONG=].shift} print(join(qq[\n],map foo,keys(%INC)),qq[\n])';
my $cmd = qq["$^X" $lib -M$who -e"$oneliner"];
my $oneliner = 'print(join(qq[\n],map{qq[BONG=$_]}keys(%INC)),qq[\n])';
my $cmd = join '', qq["$^X" $lib -M$who -e], QUOTE, $oneliner, QUOTE;

return sort
grep { !/^$who$/ }
Expand Down

0 comments on commit 2ada15d

Please sign in to comment.