diff --git a/config/auto/perldoc.pm b/config/auto/perldoc.pm index d2104221ad..e697bb63a5 100644 --- a/config/auto/perldoc.pm +++ b/config/auto/perldoc.pm @@ -20,6 +20,7 @@ use strict; use warnings; use File::Temp qw (tempfile ); +use File::Spec qw (catfile ); use base qw(Parrot::Configure::Step); use Parrot::Configure::Utils ':auto'; @@ -35,8 +36,7 @@ sub _init { sub runstep { my ( $self, $conf ) = @_; - my $slash = $conf->data->get('slash'); - my $cmd = $conf->data->get('scriptdirexp_provisional') . $slash . q{perldoc}; + my $cmd = File::Spec->catfile($conf->data->get('scriptdirexp_provisional'), q{perldoc}); my ( $fh, $filename ) = tempfile( UNLINK => 1 ); my $content = capture_output("$cmd -ud $filename perldoc") || undef; diff --git a/lib/Parrot/Pmc2c/Pmc2cMain.pm b/lib/Parrot/Pmc2c/Pmc2cMain.pm index f124e51761..bf2711b121 100644 --- a/lib/Parrot/Pmc2c/Pmc2cMain.pm +++ b/lib/Parrot/Pmc2c/Pmc2cMain.pm @@ -91,8 +91,9 @@ sub new { die "Must have key 'args' which is a reference to a list of the remaining arguments" unless ( defined $allargsref->{args} and ref( $allargsref->{args} ) eq q{ARRAY} ); + my $base = File::Spec->catdir($allargsref->{bin},'..','..'); unshift @{ $allargsref->{include} }, - '.', "$allargsref->{bin}/../..", "$allargsref->{bin}/../../src/pmc", "$allargsref->{bin}/../../src/dynpmc"; + '.', $base, File::Spec->catdir($base,'src','pmc'), File::Spec->catdir($base,'src','dynpmc'); foreach my $opt ( qw(nolines) ) { if ( !defined $allargsref->{opt}{$opt} ) { diff --git a/lib/Parrot/Pmc2c/VTable.pm b/lib/Parrot/Pmc2c/VTable.pm index 702cae5d41..12b211c2fa 100644 --- a/lib/Parrot/Pmc2c/VTable.pm +++ b/lib/Parrot/Pmc2c/VTable.pm @@ -6,6 +6,7 @@ use warnings; use Storable (); use Parrot::Vtable (); use Parrot::Pmc2c::Method (); +use File::Spec (); use File::Basename; use Cwd qw(cwd); @@ -51,8 +52,9 @@ sub dump { my ($self) = @_; my $dump_filename = - cwd() . q{/} - . basename( Parrot::Pmc2c::UtilFunctions::filename( $self->filename, '.dump' ) ); + File::Spec->catfile( cwd(), + basename( Parrot::Pmc2c::UtilFunctions::filename( $self->filename, '.dump' ) ) + ); Storable::nstore( $self, $dump_filename ); return $dump_filename; } diff --git a/tools/build/pmc2c.pl b/tools/build/pmc2c.pl index 62088d2290..124a39820b 100644 --- a/tools/build/pmc2c.pl +++ b/tools/build/pmc2c.pl @@ -5,8 +5,9 @@ use warnings; use Getopt::Long (); use FindBin qw($Bin); -use lib "$Bin/../lib"; # install location -use lib "$Bin/../../lib"; # build location +use File::Spec (); +use lib File::Spec->catdir($Bin,'..','lib'); # install location +use lib File::Spec->catdir($Bin,'..','..','lib'); # build location use Parrot::Pmc2c::Pmc2cMain (); my ( %action, %options, @pmc_include_paths ); @@ -42,7 +43,7 @@ ); if ( $action{default} ) { - $self->dump_vtable("$Bin/../../src/vtable.tbl"); + $self->dump_vtable(File::Spec->catfile($Bin,'..','..','src','vtable.tbl')); exit; }