Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rjray/json-withcomments

Perl module to allow parsing JSON data with embedded comments
https://github.com/rjray/json-withcomments

Last synced: 26 days ago
JSON representation

Perl module to allow parsing JSON data with embedded comments

Awesome Lists containing this project

README

        

# JSON::WithComments - Parse JSON content with comments

## What Is It

JSON::WithComments is a simple sub-classing of the JSON module that
pre-processes the input text to remove any comments. The scrubbed text is
then passed to the `decode` method of the JSON class.

Where the JSON module itself can handle comments in the style of Perl/shell
(comments starting with a `#`) by use of the `relaxed` method, this module
also supports the JavaScript/C++ style of comments, as well.

## Using JSON::WithComments

JSON::WithComments is simple to use:

```perl
use JSON::WithComments;

my $content = <new;
my $hashref = $json->decode($json);
```

## Building and Installing

This module builds and installs in the typical Perl fashion:

```
perl Makefile.PL
make && make test
```

If all tests pass, you install with:

```
make install
```

You may need super-user privileges to install.

## Problems and Bug Reports

Please report any problems or bugs to either the Perl RT or GitHub Issues:

* [Perl RT queue for YASF](http://rt.cpan.org/Public/Dist/Display.html?Queue=JSON-WithComments)
* [GitHub Issues for YASF](https://github.com/rjray/json-withcomments/issues)