Hi Guys,
Have just started learning perl this week and it seems to be going well but I have hit a brick wall. I'm trying to do something I think should be relatively simple, just read lets say the output of the free command on linux. All I want to do is read each line into an array so I can play with the values a little.
Is an array the most sensible approach for this? Or should I use a hash? It seems that when I do this the whole lines get put into the first part of the array, lets say $array[0] whereas I want each word to do into each part of the array. I tried using split but can't seem to find the appropriate regex to split on the values.
Can anyone help?
Cheers!
Have just started learning perl this week and it seems to be going well but I have hit a brick wall. I'm trying to do something I think should be relatively simple, just read lets say the output of the free command on linux. All I want to do is read each line into an array so I can play with the values a little.
Is an array the most sensible approach for this? Or should I use a hash? It seems that when I do this the whole lines get put into the first part of the array, lets say $array[0] whereas I want each word to do into each part of the array. I tried using split but can't seem to find the appropriate regex to split on the values.
Can anyone help?
Cheers!