S
Stephanie Kroeplin
All,
I have an array of strings lets say @records. The strings are records that
are comma-separated (i am shortening them to save typing though). IE:
$records[0] = '77856, LP3-13,stephk,1234'
$records[1] = '77857,LP3-13,stephk,1235'
....and so on
I also have an array of strings (@field_names) =
[record_id,printer_name,user_name,print_count]. These correspond to each
comma-seperated string in @records.
I would like to step thru each element in @records, using split turn each
comma-separated string into an array, an generate a hash that is like this:
%HASH {
record0 =>{ record_id=>77856
printer_name=>'LP3-13'
user_name=>'stephk'
print_count=>1234
}
record1 =>{ record_id=>77857
printer_name=>'LP3-13'
user_name=>'stephk'
print_count=>1235
}
}
What is the best way to get this done? I have a lot of records.
Any help would be awesome! Thanks,
stephanie
I have an array of strings lets say @records. The strings are records that
are comma-separated (i am shortening them to save typing though). IE:
$records[0] = '77856, LP3-13,stephk,1234'
$records[1] = '77857,LP3-13,stephk,1235'
....and so on
I also have an array of strings (@field_names) =
[record_id,printer_name,user_name,print_count]. These correspond to each
comma-seperated string in @records.
I would like to step thru each element in @records, using split turn each
comma-separated string into an array, an generate a hash that is like this:
%HASH {
record0 =>{ record_id=>77856
printer_name=>'LP3-13'
user_name=>'stephk'
print_count=>1234
}
record1 =>{ record_id=>77857
printer_name=>'LP3-13'
user_name=>'stephk'
print_count=>1235
}
}
What is the best way to get this done? I have a lot of records.
Any help would be awesome! Thanks,
stephanie