Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
No matter how many things are in my hash, it only prints data for the last key. What am I doing wrong? (I'm trying to substitute for each and every key and have the results be dynamic per it's own data)
print <<"ALL"; <table width="470" border="0"> <form name="extract" method="post" action=""> <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/\[$_\]/$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>"; exit; } }
|
|---|