perl-Data-JavaScript-Anon - Dump big dumb Perl structs to anonymous JavaScript structs

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package filename perl-Data-JavaScript-Anon-1.03-alt1.noarch.rpm
Package name perl-Data-JavaScript-Anon
Package version 1.03
Package release alt1
Package architecture noarch
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 40.19 KB
Installed size 40.19 KB
Data::JavaScript::Anon provides the ability to dump large simple data
structures to JavaScript. That is, things that don't need to be a class,
or have special methods or whatever.
The method it uses is to write anonymous variables, in the same way you
would in Perl. The following shows some examples.
[ 1, 'a', 'Foo Bar' ]
[ 1, 'a', 'Foo Bar' ]
{ foo => 1, bar => 'bar' }
{ foo: 1, bar: 'bar' }
One advantage of doing it in this method is that you do not have to
co-ordinate variable names between your HTML templates and Perl. You
could use a simple Template Toolkit phrase like the following to get
data into your HTML templates.
var javascript_data = [% data %];
In this way, it doesn't matter WHAT the HTML template calls a
particular variables, the data dumps just the same. This could help
you keep the work of JavaScript and Perl programmers ( assuming you
were using different people ) seperate, without creating
cross-dependencies between their code, such as variable names.
The variables you dump can also be of arbitrary depth and complexity,
with a few limitations.
=over 4
=item ARRAY and HASH only
Since arrays and hashs are all that is supported by JavaScript, they
are the only things you can use in your structs. Any references or a
different underlying type will be detected and an error returned.
Note that Data::JavaScript::Anon will use the UNDERLYING type of the
data. This means that the blessed classes or objects will be ignored
and their data based on the object's underlying implementation type.
This can be a positive thing, as you can put objects for which you expect
a certain dump structure into the data to dump, and it will convert to
unblessed, more stupid, JavaScript objects cleanly.
=item No Circular References
Since circular references can't be defined in a single anonymous struct,
they are not allowed. Try something like the Data::JavaScript manpage instead.
Although not supported, they will be detected, and an error returned.


Package Version Architecture Repository
perl-Data-JavaScript-Anon - - -


Name Value
/usr/share/perl5 -
perl(Class/ >= 1.510
perl(Params/ >= 0.100
rpmlib(PayloadIsLzma) -


Name Value
perl(Data/JavaScript/ = 1.030
perl-Data-JavaScript-Anon = 1.03-alt1


Type URL
Binary Package perl-Data-JavaScript-Anon-1.03-alt1.noarch.rpm
Source Package perl-Data-JavaScript-Anon-1.03-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    rpm [Sisyphus] noarch autoimports
    rpm [Sisyphus] noarch autoimports
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Data-JavaScript-Anon rpm package:
    # sudo apt-get install perl-Data-JavaScript-Anon



See Also

Package Description
perl-Data-JavaScript-LiteObject-1.04-alt1.noarch.rpm perl module Data-JavaScript-LiteObject
perl-Data-Kanji-KanjiVG-0.04-alt1.noarch.rpm parse KanjiVG kanji data
perl-Data-Kanji-Kanjidic-0.15-alt1.noarch.rpm parse the "kanjidic" kanji data file
perl-Data-Kanji-Tomoe-0.05-alt1.noarch.rpm parse the data files of the Tomoe project
perl-Data-KeyDiff-0.021-alt1.noarch.rpm Diff one set/list against another with a key basis
perl-Data-Keys-0.04-alt1.noarch.rpm get/set key+value extensible manipulations, base module for Data::Keys::E::*
perl-Data-LNPath-0.08-alt1.noarch.rpm lookup on nested data via path
perl-Data-LUID-0.014-alt1.noarch.rpm Generate guaranteed unique local identifiers
perl-Data-Layout-BuddySystem-20170808-alt1.noarch.rpm Layout data in memory allocated via a buddy system
perl-Data-Lazy-0.6-alt1.noarch.rpm perl module Data-Lazy
perl-Data-LazyACL-0.05-alt1.noarch.rpm perl module Data-LazyACL
perl-Data-Leaf-Walker-0.21-alt1.noarch.rpm Walk the leaves of arbitrarily deep nested data structures
perl-Data-Library-0.2-alt1.noarch.rpm perl module Data-Library
perl-Data-LineBuffer-0.01-alt1.noarch.rpm perl module Data-LineBuffer
perl-Data-LinkedList-0.01-alt1.noarch.rpm Perl implementation of the GNU Classpath LinkedList