Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Custom error messages and moose

by irirgem (Novice)
on Sep 29, 2012 at 04:04 UTC ( #996330=note: print w/ replies, xml ) Need Help??


in reply to Custom error messages and moose

You could always put in a test like

my $ip_address = ""; if ( $allclasses_file =~ m/_([^_]+$)/ ) { $ip_address = $1; unless ($ip_address =~ m/\d+\.\d+\.\d+\.\d+/) { print "Bad ip value $ip_address\n"; } } return $ip_address;
or just change your code to use the '\d+\.\d+\.\d+\.\d+' like this
my $ip_address = ""; if ( $allclasses_file =~ m/_(\d+\.\d+\.\d+\.\d+)$/) { $ip_address = $1; } return $ip_address;


Comment on Re: Custom error messages and moose
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (19)
As of 2014-10-30 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls