For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > August 2004 > displaying array elements on HTML file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author displaying array elements on HTML file
j2dizzo

2004-08-09, 4:02 pm

Hi,

can someone pls help explain how I can check if a variable contains a string or if it's empty. I tried

if ($var =~ //){

do something;

}

but it seems not to actually check for empty varaibles because some varibles containing nothing where able to pass this if condition, which normally shouldn't.

Secondly, How can I get to print the values of an array to be displayed on a HTML file. E.g

@arr = qw(One Two Three Four);

print << "VAR_VALUES";
Content-type: text/html

<HTML>
<HEAD>
<TITLE>Values Entered</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=5>Here are the values entered:</FONT></P>

#How can I print the elements of the array @arr
</BODY>
</HTML>
VAR_VALUES



Thanks
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com