sub rename {
my($from,$to) = @_;
- if (-f $to and not &unlink($to)) {
+ if (-f $to and not unlink($to)) {
my($i);
for ($i = 1; $i < 50; $i++) {
last if CORE::rename($to, "$to.$i");
warn("Cannot rename to `$to.$i': $!"), return 0
if $i >= 50; # Give up!
}
- &link($from,$to) || return 0;
- &unlink($from)
+ link($from,$to) || return 0;
+ unlink($from);
}
sub chmod {
sub safe_rename {
my($from,$to) = @_;
- if (-f $to and not &unlink($to)) {
+ if (-f $to and not unlink($to)) {
my($i);
for ($i = 1; $i < 50; $i++) {
last if rename($to, "$to.$i");
if $i >= 50; # Give up!
}
link($from,$to) || return 0;
- &unlink($from);
+ unlink($from);
}
sub link {
#but we have to delete old *.al and *.ix files from the 5.000
#distribution:
#This might not work because $archname might have changed.
- &unlink("$installarchlib/$name");
+ unlink("$installarchlib/$name");
}
$packlist->{"$installlib/$name"} = { type => 'file' };
if (compare($_, "$installlib/$name") || $nonono) {
- &unlink("$installlib/$name");
+ unlink("$installlib/$name");
mkpath("$installlib/$dir", $verbose, 0777);
# HP-UX (at least) needs to maintain execute permissions
# on dynamically-loaded libraries.
copy_if_diff($_, "$installlib/$name")
- and &chmod($name =~ /\.(so|$dlext)$/o ? 0555 : 0444,
+ and chmod($name =~ /\.(so|$dlext)$/o ? 0555 : 0444,
"$installlib/$name");
}
}
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
CvFILE(cv) = CopFILE(PL_curcop);
CvSTASH(cv) = PL_curstash;
- /* use subs; etc may have turned this on
- As we're (re)defining the sub here it's definately not imported */
- GvIMPORTED_CV_off(gv);
#ifdef USE_THREADS
CvOWNER(cv) = 0;
if (!CvMUTEXP(cv)) {
3
########
+# override a built-in function, call after definition
+use subs qw( open ) ;
+sub open { print $_[0] + $_[1], "\n" }
+open 1,2 ;
+EXPECT
+3
+########
+
+# override a built-in function, call with ()
+use subs qw( open ) ;
+open (1,2) ;
+sub open { print $_[0] + $_[1], "\n" }
+EXPECT
+3
+########
+
+# override a built-in function, call with () after definition
+use subs qw( open ) ;
+sub open { print $_[0] + $_[1], "\n" }
+open (1,2) ;
+EXPECT
+3
+########
+
--FILE-- abc
Fred 1,2 ;
1;