Posted on 2006-11-10 21:56:24-08 by cmv in response to 3479
Re: How to handle multiple Ethernet Interfaces?
Martin- I'm an advocate of changing the existing interface as little as possible. If you agree with this route, here are some thoughts that come to my mind: my $sAddress = get_address; Assigning get_address to a scalar variable would work as it does today, but the definition of which address you get back in a multi-interface system is the first active one that shows up when doing the given command on the given OS. my @sAddress = get_address; Assigning get_address to a list would return an array of all the active interfaces in a multi-interface system. my %sAddress = get_address; Assigning get_address to a hash would return a hash of all the active or inactive interfaces where the hash value is an indicator, or bit flag, such as: sAddress{xx:xx:xx:xx} = 'Active'; sAddress{xx:xx:xx:xx} = 1; You could also put arguments on some of these to give the user more flexibility, such as: my $sAddress = get_address(state=>'Active'); my @sAddress = get_address(state=>'Inactive'); my %sAddress = get_address(state=>0); Just some thoughts. -Craig
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.