Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is example of database. 07.11.2001|Hello World1|www.domain1.com|Your Comments in Here 07.12.2001|Hello World2|www.domain2.com|Your Comments in Here 07.13.2001|Hello World3|www.domain3.com|Your Comments in Here 07.14.2001|Hello World4|www.domain4.com|Your Comments in Here
Thanks, Jeremy#This is array to read from bottom to top. my @all_array; open(FILE,"$datadir/$datafile") || &Errormsg("Please correct your path + or chmod of database."); while (<FILE>) { @_ = split /\|/; my $hash_ref = { DATE => $_[0], TITLE => $_[1], URL => $_[2], COMMENTS => $_[3], }; push @all_array, $hash_ref; } close(FILE); foreach (reverse @all_array) { print "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpa +dding=\"3\">"; print " <tr>"; print " <td><font color=\"orange\"><b>$_->{'TITLE'}</b></font>< +br><font size=\"1\">Posted - $_->{'DATE'}</font></td>"; print " </tr>"; print " <tr>"; print " <td>$_->{'COMMENTS'} (<a href=\"$_->{'URL'}\" target=\" +_blank\">more information</a>)</td>"; print " </tr>"; print "</table><br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What's the best method of Array function?
by abstracts (Hermit) on Jul 14, 2001 at 16:15 UTC | |
|
Re: What's the best method of Array function?
by synapse0 (Pilgrim) on Jul 14, 2001 at 14:33 UTC | |
|
Re: What's the best method of Array function?
by mattr (Curate) on Jul 14, 2001 at 17:25 UTC |