diff options
| -rw-r--r-- | challenge-002/ozzy/perl6/ch-1.p6 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-002/ozzy/perl6/ch-1.p6 b/challenge-002/ozzy/perl6/ch-1.p6 new file mode 100644 index 0000000000..cd98d990b9 --- /dev/null +++ b/challenge-002/ozzy/perl6/ch-1.p6 @@ -0,0 +1,16 @@ +#!/usr/bin/env perl6 +# The simplest solution I could think of was conversion of a numeric (integer) string through +# the use of the built-in Int method. Provide a commandline argument like "004", and the script +# will output: 4. +# +# In a Perl6/Bash one-liner, this would look something like this: +# perl6 -pe '$_=.Int' <<< "004" +# but this, in itself, isn't very practical since Bash can do it with even less fuzz: +# a="004" +# echo ${a##+(0)} + +sub MAIN (Str $numeric_string) { + + say $numeric_string.Int; +} + |
