On Fri, 12 Apr 2002, Miko O'Sullivan wrote: > SUMMARY > > A way to declare public names for params irrelevant to the internal variable > names: > > sub load_data (-filename $filename_tainted ; 'version' 'ver' > $version_input / /= 1) {...}
I like it. It's clean (doesn't introduce any wierd operators or keywords, or abuses of existing ones) and logical. I think it could be rather useful for the user of the function. I have a tendency to remember single letters better than entire names, so a nice (or mean from a readability standpoint) module writer could say: sub head ( $data ; -n 'number_of_lines' $lines //= 10) {...} And I could just remember to call head($foo, -n => 25) instead of positional or the long number_of_lines thingy. Of course I don't know if I'd like people who named things just 'number_of_lines'. That destroys perls wonderful terseness. > Setting names wouldn't be required. If they aren't set, then Perl uses the > name of the variable. One question would be if the variable name is still > used as the name for a param. My inclination is no: declaring them means > you want the declared name, not the private name. If you want all the > names, you declare them all. I like your inclination too. Luke