Please learn how to quote. This is no Google Group where each one could
see all other posts in front of this one. This is Usenet. You have to
quote the parts you answering to (then its easier to see whom you answer
than searching for the previous posting). But please, not the whole
posting rather than the parts you really answering to. Read some other
posts of this group to see how others do it.
I know Google is not the best interface to access Usenet but they allow
to draw up a posting with proper quoting. Please use it.
*
schrieb:
>
> Thank you for the code, I am so close but right now if i do a print
> "$record->{$1}\n"; or print "$1 or $2" under the elsif condition, all
> I get is the last line of each record set.
If you run into the elsif-part you know, that the regex didn't match.
Hence the special vars $1 and $2 are still set to their last match (the
line before containing an equal sign). You have to read it as follows:
If there is an equal sign, save both values into $record. Later you
could access these values via $record rather than via $1 and $2. Try to
replace the "# do stuff with $record" in Brian's Code by something like
print $record->{mail};
print $record->{telephoneNumber};
You'll see that all your value are stored in $record. Read something
about hashes and references to learn how the data is stored here.
> Also can you explain this "for (@info, '') {"
You have to guarantee that the last element contains no equal sign
(otherwise the elsif-part is never called for the last item). It's just
for iterating over all elements of @info plus one additional element (an
empty string). Think of it as an abbreviation for
push @info, '';
for ( @info ) { ... }
regards,
fabian