print((@ARGV=map glob,@ARGV)?do{0 while(<>);$.}:0)
- Easy: What language is it?
- Moderate: What does it do?
- Difficult: Can you golf it? That is, can you write a script that's even shorter but does the same thing?
logic, a spice rack, and some other things
5 comments:
I have no idea what this is or what it does. Therefore it is most likely Perl. At least...that's my experience with Perl! But this could be something else. I almost never see anything other than Java, C#.net, or PHP.
Excellent reasoning. It is in fact Perl.
I hope someone comes up with the answer and posts here. And I want to know what the shortened version would be, if there is one.
I golfed it: print((@ARGV=map glob,@ARGV)?do{@_=<>;$.}:0)
I remember why I used the while loop: reading <> one line at a time and throwing away the result uses less memory than allocating an array to hold the lines from <>, as would happen when "@_=<>"; is evaluated.
Post a Comment