PDA

View Full Version : Number crunching and textareas


rockdoc
08-23-2005, 09:26 AM
Hello,
Is it possible to paste a line of numbers into a textarea (see example below) and when submitted, have the perl script treat each line as a separate value?

<form>
<textarea>
23
56
78.5
12
</textarea>
</form>

Any advice (and code for doing so) would be much appreciated.

shyam
08-23-2005, 10:51 AM
if the $text comes out like this 23\n56\n78.5\n12 u can do this :)

$text = $cgi->param("textarea1");
@splits = split("\n", $text);

rockdoc
08-23-2005, 04:44 PM
Thanks shyam,
That did it
@Nums = split(/\n/, $list); #split textarea value