@@ -110,11 +110,11 @@ To explicitly write binary data to a file, open it with the C<:bin> option.
110
110
The input/output operations then will take place using the C < Buf > type instead
111
111
of the C < Str > type.
112
112
113
- = head1 Copying and renaming files
113
+ = head1 Copying, renaming, and removing files
114
114
115
- Routines C < copy > , C < rename > , and C < move > are available to avoid low-level system
116
- commands. See details at L < copy|/routine/copy > , L < rename|/routine/rename > , and
117
- L < move|/routine/move > . Some examples:
115
+ Routines C < copy > , C < rename > , C < move > , and C < unlink > are available to avoid low-level system
116
+ commands. See details at L < copy|/routine/copy > , L < rename|/routine/rename > ,
117
+ L < move|/routine/move > , and C < unlink|/routine/unlink > . Some examples:
118
118
119
119
= begin code
120
120
my $filea = 'foo';
@@ -131,6 +131,10 @@ rename $filea, 'new-foo', :createonly; # fails if 'new-foo' exists
131
131
# use move when a system-level rename may not work
132
132
move $fileb, '/disk2/foo'; # overwrites '/disk2/foo' if it exists
133
133
move $fileb, '/disk2/foo', :createonly; # fails if '/disk2/foo' exists
134
+
135
+ unlink $filea; # removes $filea
136
+ $fileb.IO.unlink; # removes $fileb
137
+
134
138
= end code
135
139
136
140
= head1 Checking files and directories
0 commit comments