in reply to Re^5: globbed variable in parse cgi form - beyond me
in thread globbed variable in parse cgi form - beyond me

Yes I expected there would be something to switch off xhtml. I tried - use CGI qw/:html4/; but maybe that has more to do with importing methods.

As a third point I forgot to mention a lot of the styling is rendered from css so that negates the use of attributes a bit too.

The real difficulty i am having now that i have extracted the data using the param methods is in relation to placing a textareas' value into a non textarea element such as a regular div and making it format to P or BR at the newline. I've tried mixing cgi methods with arrays and array scalars explicit and sometimes very explict. lol. And trying to regexp substitute P tags with existing carriage returns and newlines but I just cannot get that value to split and format from a predifined newline character(? i saw a ^M at one point if i can figure waht that is maybe im in with a shot). Maybe I have to tr/%daf/pack hex/ as i haven't done that yet.

my $ctp = CGI->new; my $webmaster = "http\:\/\/www.mysite.com\/"; my @names= $ctp->param; my @values; foreach my $name(@names){ my $value = $ctp->param($name); push(@values, $value); } # print "Content-type: text/plain\r\n\r\n"; my @tone = $ctp->param('tone'); #print $ctp->p(tone); my $doob; #print $ctp->p("@tone"); print "\@tone: @tone\n\n"; if ($tone[0] =~ m/\\n/){ print "[^f]*. globals and carriage returns an +d zero array value arrays !!\n\n"; } foreach my $toneadd(@tone){ if ($toneadd =~ m/\\r\\n/){ print "[^f]*. globals and carri +age returns!!\n\n"; $toneadd =~ s/\\r\\n/<\/p><p>/;} $doob .= $toneadd; print "\$toneadd: $toneadd\n\n"; } my @tone = $ctp->param('tone'); foreach my $toneadd(@tone){ $line .= "<p>$toneadd<\/p>"; } print $line; print "\$doob: $doob\n\n"; print "<p>$doob<\/p>\n\n";

Which after another quick & useless debug sesh, I think is shifting me back round to the initial importing through a glob query. Though I can just go and re-open the file again and them in afterwards maybe a good enough workaround even if time consuming.

OR I gotta read some more stuff somewhere....

Replies are listed 'Best First'.
Re^7: globbed variable in parse cgi form - beyond me
by Anonymous Monk on Jun 28, 2011 at 08:38 UTC
    $ perldoc CGI |grep -i xhtml -C1 -no_xhtml By default, CGI.pm versions 2.69 and higher emit XHTML (http://www.w3.org/TR/xhtml1/). The -no_xhtml pragma disables +this feature. Thanks to Michalis Kabrianis <kabrianis@hellug.gr> fo +r this -- If start_html()'s -dtd parameter specifies an HTML 2.0, 3.2, 4 +.0 or 4.01 DTD, XHTML will automatically be disabled without needing + to use this pragma. -- The -encoding argument can be used to specify the character set fo +r XHTML. It defaults to iso-8859-1 if not specified. -- Otherwise it will be replaced by the default DTD. If the public DT +D contains 'XHTML', CGI.pm will emit XML. The -declare_xml argument, when used in conjunction with XHTML, wi +ll put a <?xml> declaration at the top of the HTML header. The sole purpo +se of -- action: this script enctype: application/x-www-form-urlencoded for non-XHTML multipart/form-data for XHTML, see multipart/form-dat +a below. -- If XHTML is activated (the default), then forms will be automatically created using this type of encoding. -- The start_form() method uses the older form of encoding by default unless XHTML is requested. If you want to use the newer form of en +coding by default, you can call start_multipart_form() instead of start_f +orm().