in reply to RE: it is amazing sometimes how little you know...
in thread it is amazing sometimes how little you know...
... and other pearls of the sort! (pun intended) I'm sure at the time I thought I had a good reason to hash and then loop the hash, but now, looking at the file, I fail to find it. If I had to re-write the entire script nowadays, I'd do it in a very different fashion. Maybe something in the lines of:@tmp = <FILE>; foreach $line (@tmp) { chop $line; ($foo,$bar) = split(/\t/,$line); $HASH{$foo} = $bar; } foreach $key (keys %HASH) { print "<some html>$key - $HASH{$key}</some html>\n"; }
Come to think of it, even the HTML is so bad that I would do it a different way! I dunno, at this point I'm just rambling. I don't think that this feeling is ever going to get any better. Maybe in two years I'll look back at the stuff I'm doing today and go EEEEK! And maybe four years from now I'll look back on the stuff that I'll do in two years and go EEEEK! as well? Who knows...while (<FILE>) { m/(^.*)\t(.*$)/; print "<some html>$1 - $2</some html>\n"; }
|
|---|