Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array references

Status
Not open for further replies.

ianfo

Programmer
Aug 20, 2002
29
GB

Hi,

Does anyone know if it's possible to do this in one line, as opposed to creating an array then creating a reference to that array?

my @HOSTS=split /,/, aaa,bbb,ccc,ddd
my $HOSTLIST=\@HOSTS;

Thanks
 
You can just make the assignment directly like
Code:
my @$HOSTLIST = split /,/, "aaa,bbb,ccc,ddd";

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top