Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Save Split to Array

by NetWallah (Canon)
on Aug 27, 2009 at 17:49 UTC ( [id://791728]=note: print w/replies, xml ) Need Help??


in reply to Save Split to Array

The split is unnecessary for validating VLAN numbers and names.

Here is sample validation code for vlan name:

if ( $vlan_name =~ m|^\w[\w-]*$| ){ # Name complies with : # * At least one char # * Starts with a letter, number or underscore # * Contains only alpha, num, underscore, hyphem }else{ # Complain about non-compliant name }
Similarly, the vlan number numeric check should be:
if ($vlan_number =~ m|^\d+$|) { # Compliant - numeric only }else{ # Something Not completely numeric - display error. }

     Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found