Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created October 13, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/3605a2f8e953dfe6cc37da8768276071 to your computer and use it in GitHub Desktop.
Save zoffixznet/3605a2f8e953dfe6cc37da8768276071 to your computer and use it in GitHub Desktop.
use v6;
class Filename is Str {
# Do some filename type stuff, here...
}
sub MAIN(
Filename :$foo is copy where { .defined and $foo = Filename.new: :value($foo) }
#= A filename argument.
) {
say $foo.IO.basename;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment