|
Lines 29-34
sub json {
Link Here
|
| 29 |
my $json = JSON->new->allow_nonref(1); |
29 |
my $json = JSON->new->allow_nonref(1); |
| 30 |
$json = $json->encode($value); |
30 |
$json = $json->encode($value); |
| 31 |
$json =~ s/^"|"$//g; # Remove quotes around the strings |
31 |
$json =~ s/^"|"$//g; # Remove quotes around the strings |
|
|
32 |
$json =~ s/\\r/\\\\r/g; # Convert newlines to escaped newline characters |
| 33 |
$json =~ s/\\n/\\\\n/g; |
| 32 |
return $json; |
34 |
return $json; |
| 33 |
} |
35 |
} |
| 34 |
|
36 |
|
| 35 |
- |
|
|