my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/);
$pkg =~ s#::#/#g;
if (defined($filename = $INC{"$pkg.pm"})) {
- $filename =~ s#^(.*)$pkg\.pm$#$1auto/$pkg/$func.al#;
+ $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
# if the file exists, then make sure that it is a
# a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al',
# looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib').
if (-r $filename) {
- unless ($filename =~ m|^/|) {
+ unless ($filename =~ m|^/|s) {
if ($is_dosish) {
- unless ($filename =~ m{^([a-z]:)?[\\/]}i) {
+ unless ($filename =~ m{^([a-z]:)?[\\/]}is) {
$filename = "./$filename";
}
}
while(defined($_ = shift @modules)){
s#::#/#g; # incase specified as ABC::XYZ
s|\\|/|g; # bug in ksh OS/2
- s#^lib/##; # incase specified as lib/*.pm
+ s#^lib/##s; # incase specified as lib/*.pm
if ($Is_VMS && /[:>\]]/) { # may need to convert VMS-style filespecs
- my ($dir,$name) = (/(.*])(.*)/);
- $dir =~ s/.*lib[\.\]]//;
+ my ($dir,$name) = (/(.*])(.*)/s);
+ $dir =~ s/.*lib[\.\]]//s;
$dir =~ s#[\.\]]#/#g;
$_ = $dir . $name;
}
# where to write output files
$autodir ||= "lib/auto";
if ($Is_VMS) {
- ($autodir = VMS::Filespec::unixpath($autodir)) =~ s|/$||;
+ ($autodir = VMS::Filespec::unixpath($autodir)) =~ s|/\z||;
$filename = VMS::Filespec::unixify($filename); # may have dirs
}
unless (-d $autodir){
}
# allow just a package name to be used
- $filename .= ".pm" unless ($filename =~ m/\.pm$/);
+ $filename .= ".pm" unless ($filename =~ m/\.pm\z/);
open(IN, "<$filename") or die "AutoSplit: Can't open $filename: $!\n";
my($pm_mod_time) = (stat($filename))[9];
for my $dir (keys %outdirs) {
opendir(OUTDIR,$dir);
foreach (sort readdir(OUTDIR)){
- next unless /\.al$/;
+ next unless /\.al\z/;
my($file) = "$dir/$_";
$file = lc $file if $Is83 or $Is_VMS;
next if $outfiles{$file};
sub id {
my $level = shift;
my($pack,$file,$line,$sub) = caller($level);
- my($id) = $file=~m|([^/]+)$|;
+ my($id) = $file=~m|([^/]+)\z|;
return ($file,$line,$id);
}
$id = $file;
($pack,$file) = caller($frame++);
} until !$file;
- ($id) = $id=~m|([^/]+)$|;
+ ($id) = $id=~m|([^/]+)\z|;
return "[$time] $id: ";
}
require Mac::Files;
my $system = Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk,
&Mac::Files::kSystemFolderType);
- $system =~ s/:.*\z/:/;
+ $system =~ s/:.*\z/:/s;
return $system;
}
my ($volume,$directory,$file) = ('','','');
if ( $nofile ) {
- ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\z))?)(.*)@;
+ ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\z))?)(.*)@s;
}
else {
$path =~
my($head,$macro,$tail);
# perform m##g in scalar context so it acts as an iterator
- while ($npath =~ m#(.*?)\$\((\S+?)\)(.*)#g) {
+ while ($npath =~ m#(.*?)\$\((\S+?)\)(.*)#gs) {
if ($self->{$2}) {
($head,$macro,$tail) = ($1,$2,$3);
if (ref $self->{$macro}) {
$npath = "$head$macro$tail";
}
}
- if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#g; }
+ if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#gs; }
$npath;
}
my($self,$path,$reduce_ricochet) = @_;
if ($path =~ m|/|) { # Fake Unix
- my $pathify = $path =~ m|/$|;
+ my $pathify = $path =~ m|/\z|;
$path = $self->SUPER::canonpath($path,$reduce_ricochet);
if ($pathify) { return vmspath($path); }
else { return vmsify($path); }
if (@dirs) {
my $path = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs));
my ($spath,$sdir) = ($path,$dir);
- $spath =~ s/.dir\z//; $sdir =~ s/.dir\z//;
+ $spath =~ s/\.dir\z//; $sdir =~ s/\.dir\z//;
$sdir = $self->eliminate_macros($sdir) unless $sdir =~ /^[\w\-]+\z/s;
$rslt = $self->fixpath($self->eliminate_macros($spath)."/$sdir",1);
if (@files) {
my $path = (@files == 1 ? $files[0] : $self->catdir(@files));
my $spath = $path;
- $spath =~ s/.dir\z//;
+ $spath =~ s/\.dir\z//;
if ($spath =~ /^[^\)\]\/:>]+\)\z/s && basename($file) eq $file) {
$rslt = "$spath$file";
}
sub catpath {
my($self,$dev,$dir,$file) = @_;
if ($dev =~ m|^/+([^/]+)|) { $dev =~ "$1:"; }
- else { $dev .= ':' unless $dev eq '' or $dev =~ /:$/; }
+ else { $dev .= ':' unless $dev eq '' or $dev =~ /:\z/; }
$dir = vmspath($dir);
"$dev$dir$file";
}
if ( $path =~ m{/} ) {
$path =~
m{^ ( (?: /[^/]* )? )
- ( (?: .*/(?:[^/]+.dir)? )? )
+ ( (?: .*/(?:[^/]+\.dir)? )? )
(.*)
}xs;
$volume = $1;