#!perl -w -I../lib use strict; use warnings; use Data::Dump; use Net::BitTorrent::Torrent; my $torrent = Net::BitTorrent::Torrent->new({Path => 'a.legal.torrent'}) or exit; $torrent->as_string(1); dd $torrent->raw_data(1); print map { qq[\n] . $_->path } @{$torrent->files}; =pod =head1 NAME 001-torrent-info.pl - Demonstration of using a standalone Net::BitTorrent::Torrent object to gather information =head1 Description This is a demonstration of how standalone C objects can be created and used to gather information from a .torrent file. =head1 Synopsis 001-torrent-info.pl =head1 Lowdown This section only makes sense when you view the source. =over =item Line 6 Returns a new C object. Created this way, (without a 'C' parameter) the new object is not loaded into a parent C client. You may use any of the arguments listed in L's constructor. If there's a problem loading the .torrent, an error will (probably) be Ced by C. =item Line 8 Calls the debugging method L just to give you a rundown of what can be parsed from the file. =item Line 9 Prints a dump of the .torrent file's L. =item Line 10 Prints a list of the .torrent's L. This line also uses the L method from L. =back =head1 See Also Please see L's documentation for a list of methods and accessors. =head1 Author Sanko Robinson - http://sankorobinson.com/ CPAN ID: SANKO =head1 License and Legal Copyright (C) 2008-2009 by Sanko Robinson This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the F file included with this distribution or http://www.perlfoundation.org/artistic_license_2_0. For clarification, see http://www.perlfoundation.org/artistic_2_0_notes. When separated from the distribution, all POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See http://creativecommons.org/licenses/by-sa/3.0/us/legalcode. For clarification, see http://creativecommons.org/licenses/by-sa/3.0/us/. Neither this module nor the L is affiliated with BitTorrent, Inc. =for svn $Id: 001-torrent-info.pl d3c97de 2009-09-12 04:31:46Z sanko@cpan.org $ =cut