App::Pimpd::Validate - Package exporting various functions for validating data
use App::Pimpd; use App::Pimpd::Validate; if(to_terminal()) { print "Yes, you can see me!\n"; } $str = escape($str); if(invalid_playlist_pos(42)) { print STDERR "No song on playlist position 42!\n"; }
App::Pimpd::Validate provides functions for verifying certain conditions that's crucial for other functions.
Returns true if the MPD server is located on a remote host.
The MPD server is assumed to be remote if the mpd_host configuration file variable is:
not defined or equals 'localhost' or equals '127.0.0.1'
Parameters: $regex
Returns true if the provided regex is invalid.
Returns true if the current playlist is empty.
Returns true if output is going to a TTY.
Parameters: $integer
Returns true if supplied argument is an invalid playlist position.
Parameters: $string Returns: $string
Takes the supplied string and escapes it from evil chars the shell might otherwise munch.
Parameters: @playlists Returns: @valid_playlists
Takes a list and traverses it, checking if every playlist exists.
If a playlist is found to be non-existant, tries to match the string against all known playlists. If a partial match is found, prompts for validation.
App::Pimpd
Magnus Woldrich CPAN ID: WOLDRICH m@japh.se http://japh.se
Copyright (C) 2010, 2011 Magnus Woldrich. All right reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install App::Pimpd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Pimpd
CPAN shell
perl -MCPAN -e shell install App::Pimpd
For more information on module installation, please visit the detailed CPAN module installation guide.