edpatterson
IS-IT--Management
- Feb 24, 2005
- 186
I am processing screen reports that I have redirected to disk (command >diskfile). The reports are laid out below. I use a while() loop with a nested until() loop to do the processing. Basically while(<>){until (/^-/){...}}. This part is working just fine.
I would like to skip the redirected part and do all of the processing in RAM.
I replaced the command >deskfile with @array = `command`. As expected the @array is populated with one line per element. The problem I am having as stepping through the array. I have tried using nested labeled foreach loops with no joy at all.
[tt]
Output of the program is
"aaa","some_a_data","some_b_data","some_c_data","some_d_data"
"bbb","some_a_data","some_b_data","","some_d_data"
"ccc","some_a_data","some_b_data","some_c_data","some_d_data","some_e_data"
[/tt]
Ideas?
Ed
data set
[tt]
----------------------------
record aaa
item a: some_a_data
item b: some_b_data
item c: some_c_data
item d: some_d_data
----------------------------
record bbb
item a: some_a_data
item b: some_b_data
item d: some_d_data
----------------------------
record ccc
item a: some_a_data
item b: some_b_data
item c: some_c_data
item d: some_d_data
item e: some_e_data
----------------------------
[/tt]
I would like to skip the redirected part and do all of the processing in RAM.
I replaced the command >deskfile with @array = `command`. As expected the @array is populated with one line per element. The problem I am having as stepping through the array. I have tried using nested labeled foreach loops with no joy at all.
[tt]
Output of the program is
"aaa","some_a_data","some_b_data","some_c_data","some_d_data"
"bbb","some_a_data","some_b_data","","some_d_data"
"ccc","some_a_data","some_b_data","some_c_data","some_d_data","some_e_data"
[/tt]
Ideas?
Ed
data set
[tt]
----------------------------
record aaa
item a: some_a_data
item b: some_b_data
item c: some_c_data
item d: some_d_data
----------------------------
record bbb
item a: some_a_data
item b: some_b_data
item d: some_d_data
----------------------------
record ccc
item a: some_a_data
item b: some_b_data
item c: some_c_data
item d: some_d_data
item e: some_e_data
----------------------------
[/tt]