package WWW::Newzbin::Constants; use 5.005; use strict; use warnings; use base qw(Exporter); our $VERSION = '0.07'; #=============================================================================# # constant groups #=============================================================================# my @categories = qw( NEWZBIN_CAT_UNKNOWN NEWZBIN_CAT_ANIME NEWZBIN_CAT_APPS NEWZBIN_CAT_BOOKS NEWZBIN_CAT_CONSOLES NEWZBIN_CAT_EMULATION NEWZBIN_CAT_GAMES NEWZBIN_CAT_MISC NEWZBIN_CAT_MOVIES NEWZBIN_CAT_MUSIC NEWZBIN_CAT_PDA NEWZBIN_CAT_RESOURCES NEWZBIN_CAT_TV ); my @sortfields = qw( NEWZBIN_SORTFIELD_DATE NEWZBIN_SORTFIELD_SUBJECT NEWZBIN_SORTFIELD_FILESIZE ); my @sortorder = qw( NEWZBIN_SORTORDER_ASC NEWZBIN_SORTORDER_DESC ); #=============================================================================# # export lists #=============================================================================# our @EXPORT_OK = ( @categories, @sortfields, @sortorder ); our %EXPORT_TAGS = ( all => [ @categories, @sortfields, @sortorder ], categories => \@categories, sort => [ @sortfields, @sortorder ], ); #=============================================================================# # constant definitions #=============================================================================# sub NEWZBIN_CAT_UNKNOWN() { return "Unknown"; } sub NEWZBIN_CAT_ANIME() { return "Anime"; } sub NEWZBIN_CAT_APPS() { return "Apps"; } sub NEWZBIN_CAT_BOOKS() { return "Books"; } sub NEWZBIN_CAT_CONSOLES() { return "Consoles"; } sub NEWZBIN_CAT_EMULATION() { return "Emulation"; } sub NEWZBIN_CAT_GAMES() { return "Games"; } sub NEWZBIN_CAT_MISC() { return "Misc"; } sub NEWZBIN_CAT_MOVIES() { return "Movies"; } sub NEWZBIN_CAT_MUSIC() { return "Music"; } sub NEWZBIN_CAT_PDA() { return "PDA"; } sub NEWZBIN_CAT_RESOURCES() { return "Resources"; } sub NEWZBIN_CAT_TV() { return "TV"; } sub NEWZBIN_SORTFIELD_DATE() { return "DATE"; } sub NEWZBIN_SORTFIELD_SUBJECT() { return "SUBJECT"; } sub NEWZBIN_SORTFIELD_FILESIZE() { return "BYTES"; } sub NEWZBIN_SORTORDER_ASC() { return "ASC"; } sub NEWZBIN_SORTORDER_DESC() { return "DESC"; } #=============================================================================# 1; __END__ #=============================================================================# =pod =head1 NAME WWW::Newzbin::Constants - Exportable constants for use with L =head1 SYNOPSIS use WWW::Newzbin::Constants qw(:all); # exports everything use WWW::Newzbin::Constants qw(:categories); # just exports categories use WWW::Newzbin::Constants qw(:sort); # just exports sorting-related constants =head1 DESCRIPTION This module contains exportable constants that can be used in conjunction with its parent module, L. The constants exported by this module are otherwise not very useful. =head2 EXPORT GROUPS Nothing is exported by default (this means that adding C or C to your code will export no constants). One or more of the following export groups must be explicitly stated. =head3 all use WWW::Newzbin::Constants qw(:all); Exports constants from all export groups. =head3 categories use WWW::Newzbin::Constants qw(:categories); Exports constants relating to Newzbin categories: =over =item * C - "Unknown" category =item * C - "Anime" category =item * C - "Apps" category =item * C - "Books" category =item * C - "Consoles" category =item * C - "Emulation" category =item * C - "Games" category =item * C - "Misc" category =item * C - "Movies" category =item * C - "Music" category =item * C - "PDA" category =item * C - "Resources" category =item * C - "TV" category =back =head3 sort Exports constants related to searching Newzbin (particularly via L's L method): =over =item * C - Sort search results by date posted =item * C - Sort search results alphabetically by subject =item * C - Sort search results by file size =item * C - Sort search results in ascending order =item * C - Sort search results in descending order =back =head1 DEPENDENCIES L =head1 SEE ALSO L L - Newzbin v3 home page =head1 AUTHOR Chris Novakovic =head1 COPYRIGHT Copyright 2007-8 Chris Novakovic. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut