I've have some code that prints a column of a database table into a html
form.  The column of the table is just the last 6 months of the year:
 
my @emonth;
while ( @emonth = $end_Months->fetchrow_array()) {
  print HTML "<OPTION VALUE=\"@emonth\">@emonth\n";
}
 
returns:
<OPTION VALUE="MAY">MAY
<OPTION VALUE="JUN">JUN
<OPTION VALUE="JUL">JUL
<OPTION VALUE="AUG">AUG
<OPTION VALUE="SEP">SEP
<OPTION VALUE="OCT">OCT
 
i've got the current month stored in a scalar variable:
my $thisMonth = (split ' ', uc localtime)[1];    #equates to 'OCT'
 
i want to print <OPTION SELECTED= if the month is equal to the current
month...ie.
<OPTION VALUE="MAY">MAY
<OPTION VALUE="JUN">JUN
<OPTION VALUE="JUL">JUL
<OPTION VALUE="AUG">AUG
<OPTION VALUE="SEP">SEP
<OPTION SELECTED="OCT">OCT
 
i've tried many ways of doing this and it seems that perl can't compare
scalar variable with array elements, does anyone know of a way of doing
this??
any help would be much appreciated, cheers!
 
Jonathan Musto

 

BT Ignite Solutions
Telephone - 0113 237 3277
Fax - 0113 244 1413
E-mail -  <mailto:Jonathan.Musto@;bt.com> [EMAIL PROTECTED]
http://www.technet.bt.com/sit/public <http://www.technet.bt.com/sit/public> 


British Telecommunications plc 
Registered office: 81 Newgate Street London EC1A 7AJ 
Registered in England no. 1800000 
This electronic message contains information from British Telecommunications
plc which may be privileged or  confidential. The information is intended to
be for the use of the individual(s) or entity named above. If you  are not
the intended recipient be aware that any disclosure, copying, distribution
or use of the contents of  this information is prohibited. If you have
received this electronic message in error, please notify us by  telephone or
email (to the numbers or address above) immediately.




 

Reply via email to