splitting a $ variable into several variables

my subject may not be too clear, but i have a variable called $output = 20120608|Friday|08-Jun-2012|Open|zzzzz 20120609|Saturday|09-Jun-2012|Open|zzzzz 20120615|Friday|15-Jun-2012|Open|zzzzz 20120616|Saturday|16-Jun-2012|Open|zzzzz 20120622|Friday|22-Jun-2012|Open|zzzzz 20120623|Saturday|23-Jun-2012|Open|zzzzz 20120629|Friday|29-Jun-2012|Open|zzzzz 20120630|Saturday|30-Jun-2012|Open|zzzzz

each line in the variable ends with \n

i want to read each line individually and split at the | and access each field separately. if i were reading the lines from a file, i know how to do it. but i can't figure out how to split the lines of the variable. i tried

@lines = $output and @lines = split('\n',$output) and several other things. so far, nothing works. help please. thanks.

Re: [delicia] splitting a $ variable into several variablesIn reply to

Hi,

From what it looks like, its extracting the values into the array using a loop. Personally, I would go with my code (as its more readable). Its untested, but I can't see any reason why it wouldn't work.

Gossamer Threads is a Vancouver-based company with over 20
years experience in web technology. From development to hosting, we
partner with leading organizations around the globe and help to build
their web presences, strategies and infrastructures.