# Some plain Perl- my @stuf = ( 1, 2, 3 ); # Or, idiomatically ( 1..3 ) print encode_json(\@stuf), $/; # Need \ to take reference. # Same outcome as [] for array ref plus 1..3- print encode_json( [ 1 .. 3 ] ), $/;