Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Referencing a Backreference

by PrimeLord (Pilgrim)
on Mar 14, 2002 at 16:54 UTC ( [id://151731]=note: print w/replies, xml ) Need Help??


in reply to Referencing a Backreference

This solution is along the same lines as gav's but with slightly less typing.

while (<DATA>) { chomp; push @ips, (split)[0]; push @names, (split)[1]; }


Also I am a little confused on your question. If you are looking for a way to seperate the data, but still access server name by IP address you could always just write the info into a hash.

my %ips_names; while (<DATA>) { $ips_names{(split)[0]} = (split)[1]; }


Then you can access just the portion of the data you need, but they are still tied together. Sorry if that wasn't actually what you were looking for.

-Prime

Update: Sigh. Juerd beat me to it again. :) Although my code is still shorter ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-19 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found