On Sat, 02 Sep 2006 18:09:10 -0700, chen li wrote:
> Dear all,
> 
> I paste some data into textarea in a CGI script and
> use param('data')to retrieve the data. I want to pass
> the data into an array but what I find is that I only
> one dimensional array. Can someone here give me a
> hand?
> 
> data pasted into textarea:
> 
> 1 1 1
> 2 2 2
> 3 3 3
> 
> (each column separated by tab and each row ended with
> \n)
> 
> after passed into script and processed the expected
> result is 
> my @data=(
>           [1,1,1],
>           [2,2,2],
>           [3,3,3],
>        );

my @data = map [ split ] => split /\r?\n/, param('data');

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to