Effective search of text file

2007-12-12 Thread Why Tea
I have a text file of acronyms of about 2MB, I would like to write a cgi script to allow users to query for any acronym in the text file. What is the best way of implementing it (i.e. taking the acronym as a key to search for the expanded text)? /Why Tea -- To unsubscribe, e-mail: [EMAIL

Question about escaped characters

2007-12-12 Thread Why Tea
my $s = "This is a string\nThis is line 2\n"; print $s; The "\n" is interpreted as newline in the code above. But if the string (i.e. $s) is in a file, it will be printed literally as "\n" - how do I get Perl to treat it as newline? /Why Tea -- To unsubscribe,