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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scaler and Array

Status
Not open for further replies.

biobrain

MIS
Jun 21, 2007
90
GB
I have a variable


$1 = 1 2 3 4 5 6 7 8 9

i.e 9 values separated by a space

How I can read this variable in an array

@array = "'1','2','3','4','5,' and so on"

Regards
 
Code:
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$string[/blue] = [red]"[/red][purple]1 2 3 4 5 6 7 8 9[/purple][red]"[/red][red];[/red]
[black][b]my[/b][/black] [blue]@array[/blue] = [url=http://perldoc.perl.org/functions/split.html][black][b]split[/b][/black][/url] [red]'[/red][purple] [/purple][red]'[/red], [blue]$string[/blue][red];[/red]

- Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top