in reply to Parsing Variables

What you're looking for is along these lines. In Perl, there are many alternatives to everything, but this is one approach that a newcomer such as yourself may be able to use as you learn.
my @rows = split /\n/, $input; foreach my $row (@rows) { print "<TR>\n"; my @columns = split / /, $row; foreach my $column (@columns) { print "<TD>$column</TD>\n"; } print "</TR>\n"; }
Now, personally, I think your table will turn out kind of odd... you're making three cells just for the date, and the "still logged in" will be lined up funny against the logout timespans. To fix this would best be served by parsing the rows with a regular expression instead of split, but this is a start.

Update: Added 'my' keywords to match your 'use strict'. Glad to see newcomers learning discipline.

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: Parsing Variables
by EvdB (Deacon) on Jun 14, 2003 at 12:19 UTC
    with input lines of the form:
    unixhelp pts/3 10.3.4.00 Fri Jun 13 10:10 - 10:10 (00:00)

    you could include a number at the end of the split like so:

    my @columns = split / /, $row, 10;

    This will tell the split command to split into no more than ten bits, hence the message at the end will not get split and appear in one td cell.

    --tidiness is the memory loss of environmental mnemonics