
l4teral
User
May 25, 2010, 1:28 PM
Post #1 of 15
(710 views)
|
|
Storing an entire array into one value of another array
|
Can't Post
|
|
I have a script I'm writing, where it outputs the returned data from a telnet session. Currently, I have it storing the output into one array, which works fine. I want to make a history of the last 100 times that the command was issued (the data it gives back is relatively small, so 100 really isn't that large..) and store it somehow, without a file. What comes to mind is a two dimensional array, however I cant seem to find anything with this situation. Any help would be greatly appreciated. :) here's some pseudo code to get the jist of what i'm trying to do:
@lines = $t->cmd("some command"); @history[$a] = @lines; $a++; while ($x < 39) { print "$lines[$x]\n"; $x++; } So it first takes the entire array of @lines, and tries to store it into one slot of @history
|