From: Paul Archer <[EMAIL PROTECTED]> > (As I noted in an earlier post) I'm writing a handler for an LCD > display (a BPP-440 from Scott Edwards (www.seetron.com)). The display > is 4 lines x 40 characters, and has direct cursor positioning. I'm > going to store the data for several virtual screens, but I don't know > whether it would be better (in terms of speed and writing/maintaining > the code) to use an array with 160 elements (one for each character), > or a single scalar with 160 characters. It seems to me that if I use a > scalar I can use perl's string manipulation tools, and if I use arrays > I can use slices--but I have no idea if one is going to have any > significant advantages/disadvantages over the other. Any suggestions?
Only Benchmark.pm can give you the true answer, but I would be very surprised if the array solution was quicker. I would definitely go with the single scalar. Or with 4 scalars, whichever would seem easier. substr() can doo all splice() can. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
