#
# Return: Status code (Bool)
#
-sub is_URL ($@) {
+sub is_URL (;$@) {
my ($string, @schemes) = @_;
+ $string = $_ unless defined $string;
my $scheme;
return unless (defined ($string) and length ($string));
#
# Return: Status code (Bool)
#
-sub is_email ($;$) {
+sub is_email (;$$) {
my $string = shift;
+ $string = $_ unless defined $string;
+ return unless defined $string;
+
my $strict = shift;
# false if any non-ascii chars
# remove nested comments
1 while ($string =~ s/\([^()]*\)//g);
- #$string =~ s/^\s+//;
- #$string =~ s/\s+$//;
return ($string =~ /^$email[0]$/) unless $strict;