You want to split a filename into basename, directory etc.
#!/usr/bin/env raku
use v6;
sub MAIN(:$file = "/usr/lib64/libc.so") {
my $io = $file.IO;
say "basename: ", $io.basename;
say "dirname: ", $io.dirname;
say "extension: ", $io.extension;
}
# vim: expandtab shiftwidth=4 ft=perl6
See Also
01strings
Perl 6 Cookbook: Introduction to Strings
01strings
Converting between characters and numbers.
01strings
Reversing a String by Word or Character
01strings
Trimming whitespace from both ends of a string
04arrays
Specifying a list in your program
The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society.
All rights reserved.