[buug] Perl question

Joseph Zitt jzitt at josephzitt.com
Wed Oct 15 23:56:26 PDT 2003


Hi, all. I'm in the process of helping to put together a "lost pets" Web
site for a friend's daughter, adapting an open-source classified ads
package to do so.

One bit of coding is eluding me, since my Perl is rusty: The code
frequently deals with an array of information, loading and unloading it
with lines such as

($email,$itemcategory,$subject,$adtype,$picurl,$adindex,$descrip,$datenum) = split(/###/,$pre);

This list appears 39 times throughout the code, and, once I change it to
appropriate fields, I'd like to just deal with it once and refer to it
the other times, rather than having 39 unrelated places for it to break.
Is there a good way to do this?

I have a feeling it's a well-known issue with a "D'oh!"-level solution,
but it's been eluding me. Any clues?




More information about the buug mailing list