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.
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.