PerlbeginnercliAI generated

CSV to JSON Converter Script

Build a command-line utility that reads a CSV file with a header row and converts it into a JSON array of objects, handling type inference for numbers and booleans. Learners practice using CPAN modules Text::CSV and JSON::PP alongside basic data structure transformation.

Estimate
~6h
Steps
5
Completed by
0
Proposed by
codeseed.app

Text::CSV · JSON::PP

Project roadmap

  1. 01

    Read and parse CSV

    ~1.5h

    Use Text::CSV to read rows from the input file, using the header row as field names.

  2. 02

    Build record hashes

    ~1h

    Convert each row into a hash keyed by column name.

  3. 03

    Infer basic types

    ~1.5h

    Detect numeric and boolean-looking values and convert them from strings appropriately.

  4. 04

    Encode as JSON

    ~1h

    Use JSON::PP to encode the array of hashes into pretty-printed JSON output.

  5. 05

    Add CLI options and error handling

    ~1h

    Support input/output file arguments and handle malformed CSV gracefully.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~6h · 5 steps

Tech stack

Text::CSVJSON::PP