开发者

Oneliner -a-switch - in Perl

Would it be theoretically possible to enable automatically the -a 开发者_如何学JAVAswitch if -n or -p is enabled and if in the code is a non declared @F array or a part of it?


No, I don't think you can do this; -a, like -l, -n, and -p actually changes the code presented to the parser, long before you'd know if the code uses @F.


No. One-liners don't have to declare variables, and there could be some already out there that use an array named @F for something completely different. Perl 5 doesn't like to break backwards compatibility, especially for a savings of only one character (Perl allows you to bundle switches, like -an).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜