Skip to content

Commit 5c1d3b6

Browse files
committed
[io grant] Document IO::Spec::Unix.basename
1 parent 9102b51 commit 5c1d3b6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Type/IO/Spec/Unix.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ need to use C<IO::Spec::*>. Use L«C<IO::Path>|/type/IO::Path» instead.
2222
Returns a string that represents C<$path>, but relative to C<$base> path.
2323
Both C<$path> and C<$base> may be relative paths C<$bar> defaults to C<$*CWD>
2424
25+
=head2 method basename
26+
27+
method basename(Str:D $path --> Str:D)
28+
29+
Takes a path as a string and return a possibly-empty portion after the last
30+
slash:
31+
32+
IO::Spec::Unix.basename("foo/bar/") .perl.say; # OUTPUT: «""␤»
33+
IO::Spec::Unix.basename("foo/bar/.").perl.say; # OUTPUT: «"."␤»
34+
IO::Spec::Unix.basename("foo/bar") .perl.say; # OUTPUT: «"bar"␤»
35+
2536
=head2 method tmpdir
2637
2738
Defined as:

0 commit comments

Comments
 (0)