in reply to simple padding of IP address

This is a perfect job for sprintf. Try something like this:
while (<IN>) { chomp; my $padded; $padded .= sprintf("%03d", $_) for split /\./; }

Update: I like Aristotle's solution better. Use that one, not mine. TIMTOWTDI! :-)

-- Mike

--
just,my${.02}

Replies are listed 'Best First'.
Re^3: simple padding of IP address
by Aristotle (Chancellor) on Jul 25, 2002 at 21:15 UTC
    Why the for loop? sprintf takes more than one argument.

    Makeshifts last the longest.