D
Dave Saville
I have a script that processes apache log files.
One of the items it needs is a "number to english" look up of HTTP
error codes. There are around 80 of the things.
Given "200 OK" etc. per line I can see three ways of doing it:
1) External file, read and parse into a hash with the number as the
key.
2) Ditto but have the codes internally under __DATA__
3) Actually init as a hash - "code" => "english".
1 is out. I was doing it but forgot all about it and one day deleted
the file on a "what;s that doing here?" thought.
I have changed to 2, but just wonder about the pros and cons of 2 vs 3
- if there are any.
TIA
One of the items it needs is a "number to english" look up of HTTP
error codes. There are around 80 of the things.
Given "200 OK" etc. per line I can see three ways of doing it:
1) External file, read and parse into a hash with the number as the
key.
2) Ditto but have the codes internally under __DATA__
3) Actually init as a hash - "code" => "english".
1 is out. I was doing it but forgot all about it and one day deleted
the file on a "what;s that doing here?" thought.
I have changed to 2, but just wonder about the pros and cons of 2 vs 3
- if there are any.
TIA