CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Storing perl array into HTML textarea

 



zak100
User

Nov 13, 2013, 9:15 PM

Post #1 of 2 (715 views)
Storing perl array into HTML textarea Can't Post

Hi,
I am trying to store perl array into HTML text area. Its not generating any error but its ot display any value in the textarea.


Code
#!C:/Perl64/bin/perl.exe 


use DBI;
use CGI;
use CGI::Session;
use Path::Class;

my $existingdir;
my $cgi;
my $dirstr;
my $filename;
my $TextMessage;

$cgi = new CGI;



open(MYFILE, "<TestFile") or die "Unable to open file, ";

my @entire_file=<MYFILE>; #Slurp!
close (MYFILE);

print "Content-type: text/html\n\n";
print <<EOF;
<HTML>
<HEAD>
<TITLE> Coding Page </TITLE>
</Head>
<BODY>
<textarea name="ProjectCode" rows="5" cols="60">

</textarea></p>
<form method="post" action="compiletextarea.pl">

<p>Client Code:
EOF

$cgi->textarea(
-name=>'ClientCode',
# -size=>15, # Deleted, doesn't apply to textarea controls
-rows=>5,
-columns=>60,
-default=>@entire_file, # Amended line
);

print <<EOF;


</p>


<p><input type="submit" name="compile" value="compile"></p>

</form>
<textarea name="Output_Error" rows="5" cols="60">

</textarea></p>
</BODY></HTML>

EOF
exit;


Somebody plz help me in this regard.

Zulfi.


(This post was edited by zak100 on Nov 13, 2013, 9:19 PM)


zak100
User

Nov 13, 2013, 9:57 PM

Post #2 of 2 (711 views)
Re: [zak100] Storing perl array into HTML textarea [In reply to] Can't Post

Hi,
This problem is solved now.

Code
#!C:/Perl64/bin/perl.exe 


use DBI;
use CGI;
use CGI::Session;
use Path::Class;

my $existingdir;
my $cgi;
my $dirstr;
my $filename;
my $TextMessage;

$cgi = new CGI;



open(MYFILE, "<TestFile") or die "Unable to open file, ";

my @entire_file=<MYFILE>; #Slurp!
close (MYFILE);

print "Content-type: text/html\n\n";
print <<EOF;
<HTML>
<HEAD>
<TITLE> Coding Page </TITLE>
</Head>
<BODY>
<textarea name="ProjectCode" rows="5" cols="60">

</textarea></p>
<form method="post" action="compiletextarea.pl">

<p>Client Code:


<textarea name="ClientCode" rows="5" cols="60">
EOF
print @entire_file;


print <<EOF;
</textarea>
</p>


<p><input type="submit" name="compile" value="compile"></p>

</form>
<textarea name="Output_Error" rows="5" cols="60">

</textarea></p>
</BODY></HTML>


Zulfi.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives