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!

Converting a variable to an array

Status
Not open for further replies.

FreeBASE

Programmer
May 3, 2002
39
US
I am try to convert a $variable list split by spaces

EX:

111111 321212 675675 525243

to an array...

Anyone??
 
[tt]my @arr = split(/\s+/, $variable);[/tt]

That will split [tt]$variable[/tt] into it's elements delimited by one or more space-like characters (spaces, tabs)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top