Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Advice on script

by Util (Priest)
on Oct 21, 2011 at 19:00 UTC ( #932965=note: print w/ replies, xml ) Need Help??


in reply to Re: Advice on script
in thread Advice on script

In your point 4, I think that all the $i++ are intentional, although a bad fit for the for loop. If my refactoring is correct, then I recommend this equivalent code:

while (@options) { my $option = hex shift @options; last if $option == 255; # end of DHCP Options my $length = hex shift @options; push @{$opts{$option}}, splice( @options, 0, $length ); }


Comment on Re^2: Advice on script
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2015-07-07 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls