I know that it is probably (a few years) too late for a proposal like
this, that is highly invasive wrt Perl's semantic, but here it is
anyway...
Cmd line switches are so useful and effective to quickly change the
behaviour of programs: IIRC tcl's syntax was inspired by them. But OTOH it
is too
Michele Dondi skribis 2004-06-22 18:24 (+0200):
rename -v = 1, $orig, $new;
Any specific reason for the minus there? Perl's not a shell (yet).
rename.SWITCHES{-v} = sub {
my ($o, $n) = @_;
print renaming `$o' to `$n'\n;
}
I think just using named arguments would be better
Michele Dondi wrote:
Specifically I'd like to have the possibility of doing something like
this:
rename -v = 1, $orig, $new;
It's already being done:
rename $orig, $new :verbose;
sub rename($orig, $new, +$verbose) {
say Renaming `$orig' to `$new' if $verbose;
...
}
Juerd writes:
Michele Dondi skribis 2004-06-22 18:24 (+0200):
rename -v = 1, $orig, $new;
Any specific reason for the minus there? Perl's not a shell (yet).
rename.SWITCHES{-v} = sub {
my ($o, $n) = @_;
print renaming `$o' to `$n'\n;
}
I think just using named
On Tue, 22 Jun 2004, Juerd wrote:
Michele Dondi skribis 2004-06-22 18:24 (+0200):
rename -v = 1, $orig, $new;
Any specific reason for the minus there? Perl's not a shell (yet).
Because one may want to restrict the number of pairs to be interpreted as
cmd line switches, I'm not even sure
On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote:
rename -v = 1, $orig, $new;
It's already being done:
rename $orig, $new :verbose;
sub rename($orig, $new, +$verbose) {
say Renaming `$orig' to `$new' if $verbose;
...
}
I'm not sure if I
Michele Dondi writes:
On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote:
rename -v = 1, $orig, $new;
It's already being done:
rename $orig, $new :verbose;
sub rename($orig, $new, +$verbose) {
say Renaming `$orig' to `$new' if $verbose;
...