in reply to Re: textarea entries
in thread textarea entries

Thank you for your replies... I admit it I am a CGI rookie here.... I need a snipet or 2 to see what you are saying. If I show you what I have for the current code to accept the <input type text> entries. Could you suggest the best method to read a textarea instead of multiple text fields. Feel free to alter this code . Thank you in advance
#!/usr/bin/perl if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } &process; } #The following displays barcode sub process { ($name = $FORM{name});
more html & print script would be below here Once again I thank you gc

Replies are listed 'Best First'.
Re^3: textarea entries
by jZed (Prior) on Feb 23, 2005 at 17:43 UTC
    GAH! Stop right now. Go get CGI and use it. I really mean it, you really should not be using code like what you are doing. Nothing we say about your particular issue will be as important as using the CGI.pm module. Do that first, then come back and ask again.

    update to give an example

    #!perl -w use strict; use CGI qw(:all); my $FORM = param->Vars; my $textarea = $FORM{"text_area_field_name"}; my @numbers = split /\s+/, $textarea.
    (When I said "go get CGI.pm" I was speaking metaphorically, you don't actually need to "get" anything, it comes with perl.
      Thank you again, but remember things you take for granted, are very new to me. I have already humbled myself before you Monks.. I am as green as it gets. LOL Explanation of using cgi.pm module. (as if I were a 4 yr old) is it being used in the update code you mentioned? or do I have to code  use CGI.pm
        The script I showed is how to do it. The line use CGI qw(:all) makes CGI.pm available in your script (you shouldn' specify the .pm part in a use statement) and makes all functions in the CGI.pm module available to you.