Hi there,

I have the following problem:

I want to read a logfile in which every line follows this rule:
<value1>:<value2>:<value3>...

But the number of values differs. Sometimes a line has 2 values (the
minimum) and sometimes 3 or more values. Now I want to push these
values into a hash that follows that form:
$hash->{value1}->{value2}...

This is what I have so far:

sub readLog {
    my $self = shift;
    my $logfile = getFilename();

    open LOG, "<$logfile";

    foreach my $line (<LOG>) {
        my @values = split /\:/, $line;
        ... # at this point I don't know what to do :(
    }
}

Greetings
Dennis

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to