Gordon Rowell > CGI-FormMagick-0.89 > CGI::FormMagick::Validator::Network

Download:
CGI-FormMagick-0.89.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
Stalled  9
View Bugs
Report a bug
Source  

NAME ^

CGI::FormMagick::Validator::Network - network-related validation routines

SYNOPSIS ^

use CGI::FormMagick;

DESCRIPTION ^

See CGI::FormMagick::Validator for a general description.

Validation routines provided:

url

The data looks like a (normalish) URL: $data =~ m!(http|ftp)://(\w/.-/+)!

isnt( url(undef, 'http://'), "OK" , "http:// is not a complete URL"); isnt( url(undef, 'ftp://'), "OK" , "ftp:// is not a complete URL"); isnt( url(undef, 'abc'), "OK" , "abc is not a valid URL"); isnt( url(), "OK" , "undef is not a valid URL"); isnt( url(undef, ''), "OK" , "empty string is not a valid URL"); is( url(undef, 'http://a.bc'), "OK" , "http://a.bc is a valid URL"); is( url(undef, 'ftp://a.bc:21/'), "OK" , "ftp://a.bc:21 is a valid URL"); isnt( url(undef, 'http:///a.bc'), "OK" , "http:///a.bc has too many slashes"); isnt( url(undef, 'http://a_a.bc'), "OK" , "Underscores are not allowed in URLs");

email_simple

The data looks more or less like an internet email address: $data =~ /.+\@.+\..+/

Note: not fully compliant with the entire gamut of RFC 822 addressing ;)

domain_name

The data looks like an internet domain name or hostname.

ip_number

The data looks like a valid IP number.

username

The data looks like a good, valid username

password

The data looks like a good password

mac_address

The data looks like a good MAC address