develooper Front page | perl.perl6.users | Postings from July 2017

accepting values on the command line

Thread Next
From:
Gabor Szabo
Date:
July 1, 2017 13:15
Subject:
accepting values on the command line
Message ID:
CABe4FJDdR7S7oD8c4vFsneRqmtrWiShsoZ+Lwk3Y0DWVk+J+Tw@mail.gmail.com
I was hoping to wrote a simple script that would accept a bunch of
filenames on the command line so I wrote:


#!/usr/bin/env perl6
use v6;

multi sub MAIN(@files) {
    say @files.perl;
}



$ perl6 code.pl6
Usage:
  code.pl6 <files>

$ perl6 code.pl6 abc
Usage:
  code.pl6 <files>

$ perl6 code.pl6 abc def
Usage:
  code.pl6 <files>

I got desperate, but that did not help either:
$ perl6 code.pl6 --files abc
Usage:
  code.pl6 <files>


I am rather confused by this.


$ perl6 -v
This is Rakudo version 2017.06 built on MoarVM version 2017.06
implementing Perl 6.c.


Gabor

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About