in reply to Re: Printing last element of hash (unintentionally)
in thread Printing last element of hash (unintentionally)
#!/usr/bin/perl my %data; my $data = "data.dbm"; my $lookup = url_param('lookup'); tie %data, 'SDBM_File', $data, O_CREAT | O_RDWR, 0644; if ( !tied %data ) { print "error $!.\n"; } print header(); print start_html(); print <<"ALL"; <table width="470" border="0"> <form name="extract" method="post" action="extract.pl"> <tr><td colspan="2"><textarea name="specifics" cols="40" rows="5" id=" +specifics">$specifics</textarea></td></tr> <tr><td><input type="submit" name="submit1" value="submit"></td></tr> </form> </table> ALL if (param('submit1')) { foreach (sort keys %data) { my ($a, $b, $c, $d, $e, $f) = split(/::/, $data{$_}); $specifics =~ s/\[a\]/$a/g; $specifics =~ s/\[b\]/$b/g; $specifics =~ s/\[more\]/$data{$_}/g; $specifics =~ s/\[c\]/$c/g; $specifics =~ s/\[d\]/$d/g; $specifics =~ s/\[e\]/$e/g; $specifics =~ s/\[f\]/$f/g; print "$specifics<br>"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Printing last element of hash (unintentionally)
by Joost (Canon) on Jan 03, 2004 at 21:31 UTC | |
by Anonymous Monk on Jan 03, 2004 at 21:38 UTC | |
by Joost (Canon) on Jan 03, 2004 at 22:26 UTC | |
by Anonymous Monk on Jan 03, 2004 at 23:28 UTC |