Team Totally Awesome
Opinion/Editorial Reviews Humor Vice Advice Boobsquad Forums

TTA Perl Golf 1

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

     ·  Read 15 comments

  • Subscribe!
      · site updates
      · exclusives
      · previews
    newmoanyeah
    Mitch Krpata's Video Game Reviews - Boston Phoenix
    Video Game Reviews - Insult Swordfighting
    The Pop Cult
    Only Paper Dolls
    MAGGERific Designs
    Landing Party Records
    More pimpin'...
    All text, images, and design ©2003-2017 Team Totally Awesome unless otherwise noted