|
|
|
Author:
Tyler
Posted: 19 Oct 2006 |
Perl golf challenge, open to the public.
Perl Golf rules
TTA Perl Golf 1:
Read a CSV file from STDIN, and reverse the fields per-line.
Example:
"a","b","c"
"d","e","f"
becomes
"f","e","d"
"c","b","a"
Fields are enclosed in double quotes, and are guaranteed to be alphanumeric.
Each line ends with a newline character ("\n").
The last field in the line MAY be terminated by a comma.
The terminating comma should stay with the line, like so:
"a","b","c"
"d","e","f",
becomes
"f","e","d",
"c","b","a"
Your solution should be able to handle both types of input.
In case it doesn't go without saying, the output should have
a single newline at the end of each line, with no additional newlines.
Click the "Post Comment" link below to post your solution. Use [color] tags inside [quote] tags to spoilertext the solution. Example:
[quote][color=white]code[/color][/quote]
PLAY GOLF
|
|
|
|
|