i'm trying to write a sub function that will write a date drop down box onto a form this function is going to be called from many pages and should therefore be in another file i'm figuring that i'll call the function like
<form action="foo.asp"> <!--#include virtual="/actest/vtt/includes/DateDropdownSelector.a +sp" --> <% &amp;amp;Month_Dropdown("D1"); %> </form>
and recieve a dropdown
<% sub Month_Dropdown ($prefix) { my @month_order = ("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG" +,"SEP","OCT","NOV","DEC"); my %month_days = ( JAN => 31, FEB => 29, MAR => 31, APR => 30, MAY => 31, JUN => 30, JUL => 31, AUG => 31, SEP => 30, OCT => 31, NOV => 30, DEC => 31 ); $response->write(qq!<select name="! . $prefix . qq! _MONTH">!); foreach $month (@month_order) { $response->write(qq! <option value="$month">$month! +); }; $response->write(qq!</select>!); $response->write(qq!<select name="! . $prefix . qq! _DAY">!); for ($i = 1;$i <= 31;$i++) { $response->write(qq! <option value="$i">$i!); }; $response->write(qq!<input type="text" name="! . $prefix . qq!_YEA +R" maxlength=4 value="2001">!); } %>
the hash table is in place so i can eventually figure out how to create a dropdown pair on which the number of available days changes based on the month that is selected maybe i shouldn't be including the file as a virtual include but should instead put a 1; at the bottom and say
require /includes/DateDropdownSelector.pm
and then of course fiddle around with the internals a bit (come to think of it, just taking out the <% and %> should complete that transformation anyways ... i know there's a mega -expert out there who can get me over this last little hurdle :)

update:
I forgot to mention that the error that i am recieving is as follows:

PerlScript Error error '80004005' (in cleanup) Can't call method "write" on an undefined value /actest/vtt/includes/DateDropdownSelector.asp, line 19

In reply to Server Side PERLScript for building forms by Buckaroo Buddha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.