in reply to Re^3: improving the aesthetics of perl code
in thread improving the aesthetics of perl code

I'd write that as
push @hosts, map { /^([\w.]+)$/ ? $1 : () } @tmp;
Not that I make any claims for its aesthetics. :-)

Replies are listed 'Best First'.
Re^5: improving the aesthetics of perl code
by sleepingsquirrel (Chaplain) on Jan 21, 2005 at 22:43 UTC
    Why not...
    @hosts = map { /^([\w.]+)$/ ? $1 : () } @tmp;
    update: might as well get rid of the @tmp while we're at it...
    @hosts = map { /^([\w.]+)$/ ? $1 : () } <CFGFILE>;


    -- All code is 100% tested and functional unless otherwise noted.