[Playlist] problem with perl xspf arrays

Ross Mohn rpmohn at waxandwane.org
Wed Jun 13 18:46:41 UTC 2007


On Wed, 2007-06-13 at 18:15 +0200, Sebastian Pipping wrote:
> Ross Mohn wrote:
> >   print "Link    : " . $track->links    . "\n" if ($track->links);
> >   print "Link    : " . $track->{links}  . "\n" if ($track->links);
> >   print "Link    : " . $track->{links}->[0]  . "\n" if ($track->links);
> >   print "Link    : " . $track->links->[0] . "\n" if ($track->links);
> > }
> 
> -------------------------------------------------------------
> This code works for me:
> 
>   my @links = $track->links;
>   print "Link rel of first link  : " . $links[0][0] . "\n" if ($track->links);
>   print "Link body of first link : " . $links[0][1] . "\n" if ($track->links);

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.
Thanks! -Ross





More information about the Playlist mailing list