in reply to Shorter code ?

Any idea to improve it?

Don't reinvent the wheel. :-)

Any one-liner? ;))

Using Net::Netmask (alt.)...

sub mask_short_to_long { Net::Netmask->new( "0.0.0.0/" . shift )->mask + } # or as a real one-liner! :) perl -MNet::Netmask -le 'print Net::Netmask->new( "0.0.0.0/" . shift ) +->mask' 24

    --k.


Replies are listed 'Best First'.
Re: Re: Shorter code ?
by fuzzyping (Chaplain) on Mar 11, 2002 at 18:35 UTC
    One liner, perhaps. Less code, no way! Not when the module you're requiring is 400 lines of code. :-P

    -fuzzyping