in reply to Re: @addrs = (gethostbyname('www.yahoo.com'))[4..-1] ?
in thread @addrs = (gethostbyname('www.yahoo.com'))[4..-1] ?

That still uses an intermediate variable (not that I think it makes sense to request avoiding such).
  • Comment on Re^2: @addrs = (gethostbyname('www.yahoo.com'))[4..-1] ?

Replies are listed 'Best First'.
Re^3: @addrs = (gethostbyname('www.yahoo.com'))[4..-1] ?
by Anonymous Monk on Nov 04, 2010 at 02:53 UTC
    I don't understand how. I guess I have no idea what is an "intermediate variable"
      The new gethostbyname copies the values from gethostbyname into an array. addr_list returns that array variable. It's what's being dereferenced (@{}). (Only one of the 4 solutions I posted copy the returned values.)