[Playlist] problem with perl xspf arrays

Ross Mohn rpmohn at waxandwane.org
Wed Jun 13 19:50:07 UTC 2007


On Wed, 2007-06-13 at 14:46 -0400, Ross Mohn wrote:

> Thanks! This code seems to work without the extra variable:
> 
>     print $track->{links}[0][1];
> 
> There must be a more elegant way to do this, but that works for now.
> 
> Now, how do I SET a new <link> or <identifier> in XML::XSPF? I still
> can't figure that out.

Never mind, I got mixed up because links require a "rel" attribute, but
identifiers don't have any attributes. I'd still like to know a more
elegant way to GET and SET these array things....

    $track->{links}[0][0] = "http://foaf.org/namespace/version1";
    $track->{links}[0][1] = "http://socialnetwork.org/foaf/mary.rdfs";
    print $track->{links}[0][0];
    print $track->{links}[0][1];

    $track->{identifiers}[0] = "7e1d6f5f-0ac3-4889-8b57-506a67b459fc";
    print $track->{identifiers}[0];

Thanks again! -Ross





More information about the Playlist mailing list