my ($self, $path) = @_;
$self = $self->new unless ref $self;
$path = $self->resolve_path($path);
+ $path = $self->normalize_path($path);
my @active_lls = $self->active_paths;
$self->ensure_dir_structure_for($path)
unless $self->no_create;
- $path = ( Win32::GetShortPathName($path) || $path )
- if $^O eq 'MSWin32';
+ $path = $self->normalize_path($path);
my @active_lls = $self->active_paths;
$self->clone(%args);
}
+sub normalize_path {
+ my ($self, $path) = @_;
+ $path = ( Win32::GetShortPathName($path) || $path )
+ if $^O eq 'MSWin32';
+ return $path;
+}
+
sub _legacy {
my ($self, $path) = @_;
$self = $self->new unless ref $self;
for ($shellbin) {
return
- /csh/ ? 'csh'
- : /command\.com/ ? 'cmd'
- : /cmd\.exe/ ? 'cmd'
- : /4nt\.exe/ ? 'cmd'
- : /powershell\.exe/ ? 'powershell'
- : 'bourne';
+ /csh/ ? 'csh'
+ : /command\.com/i ? 'cmd'
+ : /cmd\.exe/i ? 'cmd'
+ : /4nt\.exe/i ? 'cmd'
+ : /powershell\.exe/i ? 'powershell'
+ : 'bourne';
}
}