Many thanks haukex!
From what I've seen there isn't really a lot of variation in the input files. Since the project needs to be done and completed in two days ago, I'm currently concentrating on getting something into a CSV as quickly as possible. Later on, when there's still time, I can go back to making things more reliable.
Your code is really great, and I've been (probably very noobishly) able to add other fields:
{ Address => { city => "Randomcity", street_and_nr => "SampleStreet 12 +3", zip => "45678" }, Company => { companyname => "Randomcompany" }, Phone => { Telefax => "", Telephone => "0123-4 56 78 90" }, }
In your code, this is a hash, which gets returned from the subroutine as a pointer to a hash. If I understand correctly, inside the hash are three hashes ("Address", "Company" and "Phone").
Text::CSV however needs an array reference in order to work. I've spent about six hours today trying to learn about arrays, hashes, nested hashes, references to hashes etc., and to figure out a way to get Text::CSV running, by "unwrapping" the reference to a hash of hashes, getting a reference for each of the three included hashes, turning every of these hashes into an array, combining the arrays into one array, getting a reference to this array, and then calling Text::CSV with this reference. :-)
Wouldn't it be much quicker to throw data inside the subroutine not into a hash of hashes, but directly into a single, not deep array instead, and return a reference to that array?
In reply to Re^6: How to parse not closed HTML tags that don't have any attributes?
by Rantanplan
in thread How to parse not closed HTML tags that don't have any attributes?
by Rantanplan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |