bug-a2ps
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

freeze in perl filter


From: David L. Nicol
Subject: freeze in perl filter
Date: Thu, 19 Jul 2001 20:52:07 -0500



The attached file causes a freeze with -Eperl

-Eplain works okay though.

(sorry I haven't found the offending section closer
than 400 lines, I can if you can't -- I imagine you
have a tool, a very verbose a2ps perhaps, which will 
tell you where it is exactly when it gets into its
infinite loop.)




-- 
                                           David Nicol 816.235.1187
                            "Your plastic pal who's fun to be with"
        print qq!
\n</select><font size="2"><b>\&nbsp;\&nbsp;hours, \&nbsp;</b></font>
<select name="dur_mins">!;
        if ($type_of_form eq "modify") {
                print "<option value=\"\">Don't Change";
        }
        foreach $i (@fcs::mins_values) {
                print "<option value=\"$i\">$i";
        }
        print "\n</select><font 
size=\"2\"><b>\&nbsp;\&nbsp;mins</b></font></td></tr>\n";

# We now provide an input item for entering the location of the event, and a
# textarea box to enter the body information of the event.

        print qq!

<script language="JavaScript">
function makewindow1()
 
{thewindow=window.open("http://$fcs::site_dom_name.com/find/index2.htm","foo","width=400,height=290,resizable=yes,scrollbars=yes";)}
</script>       
<tr valign="top"><td align="right"><font size="2"><b>Location</b></font></td>
<td><input type="text" name="location" size="40" maxlength="60">*<br><font 
size=1>[Ex. The Taft Theatre]</font></td></tr>
<tr valign="top"><td align="right"><font size="2"><b>Street</b></font></td>
<td><input type="text" name="street_add" size="30" maxlength="60">*<font 
size=1> [<a href=javascript:self.makewindow1()>Search for 
Address</a>]</font><br><font size=1>[Ex. 404 Main St. - For Yahoo map 
link]</font></td></tr>
<tr valign="top"><td align="right"><font size="2"><b>City</b></font></td>
<td><input type="text" name="city_add" size="20" maxlength="60">*<br><font 
size=1>[Ex. Newport, Cincinnati - For Yahoo map link]</font></td></tr>
<tr valign="top"><td align="right"><font size="2"><b>State</b></font></td>
<td>
<select name="state_add">
    <option value="">??</option>
    <option value="OH">OH</option>
    <option value="KY">KY</option>
    <option value="IN">IN</option>
  </select>*
</td></tr>

        <script language="JavaScript">
        function textCounter(field, countfield, maxlimit) {
        if (field.value.length > maxlimit)
        field.value = field.value.substring(0, maxlimit);
        else
        countfield.value = maxlimit - field.value.length;
        }
        </script>
<tr valign="top"><td align="right" valign="top"><font 
size="2"><b>Body</b></font></td>
<td align="left"><textarea wrap="virtual" name="body" rows="6" cols="40"
onKeyDown="textCounter(this.form.body,this.form.remLen,$fcs::body_char_limit);" 
onKeyUp="textCounter(this.form.body,this.form.remLen,$fcs::body_char_limit);" 
onBlur="textCounter(this.form.body,this.form.remLen,$fcs::body_char_limit);" 
></textarea>*
<br>!;

&spellcheckerbutton;

        print qq!
<font size="1"><font color=red>STOP.</font></b> You have <input readonly 
type=text name=remLen size=4 maxlength=4 value="$fcs::body_char_limit"> 
characters left. Please include a CONTACT PHONE NUMBER and PRICE if possible. 
The box will automatically wrap your text for continuous sentences. Press the 
return key only if you want a line break in the final calendar 
entry.</font></td></tr>!;

# If we are allowing notifications, we provide a checkbox to select that we
# do want to notify people, and then a multiple selector that is created by
# opening the authorized users file and reading all the lines in there.  For
# each entry, we use the name of the user as the item to show up in the
# selector, and their email address for the value to be returned if they are
# selected.  We then close the file, and print out information on how to
# select multiple people to notify.

        if ($fcs::allow_notify) {
                print qq!
<tr><td colspan="2"><hr size="1"><font size="2"><b>Notifications 
<i>(optional)</i></b></font></td></tr>
<tr><td>&nbsp;</td>
<td valign="top"><input type="checkbox" name="notify" value="on"><font 
size="1">Check
box to notify, via email, selected people below.</font><br>
<select name="mail_choices" size="2" multiple>!;
                open (AUTHFILE, "$auths::auth_user_file") || 
&open_error($auths::auth_user_file);
                while (<AUTHFILE>) {
                        chomp $_;
                        ($name, $email) = (split (/\|/,$_))[3,4];
                        print "<option value=\"$email\">$name\n";
                }
                close (AUTHFILE);
                print qq!
</select><br><font size="1">Hold down Ctrl key to select 
multiple.</font></td></tr>!;
        }

# If we are not in modify mode, we now need to present the user with a list of
# options to make the event recurring, as an option.  The following code sets
# up the form to allow all kinds of different selections for this.

        unless ($type_of_form eq "modify") {
                print qq!
<tr><td colspan="2"><hr size="1"><font size="2"><b>Recurring Events 
<i>(optional)</i></b></font></td></tr>
<tr><td align="right"><input type="radio" name="rep_opt" value="0" checked> 
</td><td>
<font size="2">Do Not Repeat This Event.</font></td></tr>
<tr><td align="right"><input type="radio" name="rep_opt" value="1"> </td><td>
<font size="2">Repeat&nbsp;&nbsp;<select name="rec_a"><option value="1" 
selected>Every
<option value="2">Every Other<option value="3">Every Third
<option value="4">Every Fourth</select>&nbsp;&nbsp;
<select name="rec_b"><option value="0:0:0:rec">Day
<option value="0:0:rec:0" selected>Week<option value="0:rec:0:0">Month
<option value="rec:0:0:0">Year</select></font></td></tr>
<tr><td align="right"><input type="radio" name="rep_opt" value="2"> </td><td>
<font size="2">Repeat&nbsp;&nbsp;<select name="rec_c"><option value="1" 
selected>Every
<option value="2">Every Other<option value="3">Every Third
<option value="4">Every Fourth</select>&nbsp;&nbsp;!;
        &select_a_dow( "rec_d");
        print qq!
</font></td></tr>
<tr><td align="right"><input type="radio" name="rep_opt" value="3"> </td><td>
<font size="2">Repeat on the&nbsp;&nbsp;<select name="rec_e">
<option value="0">First<option value="1">Second<option value="2">Third
<option value="3">Fourth<option value="-1">Last</select>&nbsp;&nbsp;!;
        &select_a_dow( "rec_f" );
        print qq!
&nbsp;&nbsp;of the month every&nbsp;&nbsp;
<select name="rec_g"><option value="0:1" selected>Month<option value="0:2">2 
Months
<option value="0:3">3 Months<option value="0:4">4 Months
<option value="0:6">6 Months<option value="1:0">Year</select></font></td></tr>
<tr><td>&nbsp;</td><td><hr align="left" size="1" width="75"></td></tr>
<tr><td>&nbsp;</td><td><font size="2">Through&nbsp;&nbsp;!;
        &select_a_month( "rec_mon" );
        print "\&nbsp;\&nbsp;";
        &select_a_day( "rec_day" );
        print "\&nbsp;,\&nbsp;\&nbsp;";
        &select_a_year( "rec_year" );
        print qq!
<p></font><font size="1"><b>Please Note&#58;</b> A maximum of $fcs::max_posts 
events can be repeated at one time.</font></td></tr>!;
        }

# If we are allowing web links in the calendar, we provide input items to
# enter the link title and link url to be used.

        if ($fcs::allow_links) {
                print qq!
<tr><td colspan="2"><hr size="1"><font size="2"><b>Link Information 
<i>(optional)</i></b></font></td></tr>
<tr><td align="right"><font size="2"><b>Title</b></font></td>
<td><input type="text" name="linktitle" size="30" maxlength="30">*
</td></tr><tr><td align="right"><font size="2"><b>URL</b></font></td>
<td><input type="text" name="linkurl" size="30" maxlength="80">*</td></tr>!;
        }

# We now provide some notes to the user regarding the properties of the Body 
textarea,
# since many people want to hit the return key at the right margin of the
# textarea rather than letting it wrap automatically.

        print qq!
</table><quoteblock>!;
}

# SUB HEADER #

# This subroutine takes a title as an argument.  It then generates the
# content type information so the browser knows what it is receiving, and
# then opens up the HTML page.  It provides a javascript function that will
# be used by the help files and the search routine to display information.
# It also starts the standard form that will be used on most every page.

sub header {
        my ($title) = $_[0];
        if ($title eq '') {
                $title = "$fcs::cal_name Calendar";
        }
        print "Content-type: text/html\n\n";
        print qq!
<html><head><title>$title</title>!;
&spellcheckerjs;
        print qq!
<style type="text/css">
<\!--
input, select { font: Tahoma; font-size: 8pt; border-width:1; 
border-color:000000; border-style:solid; }
 -->
</style>
<script language="JavaScript" type="text/javascript">
<\!--
    function openNew(url) {
        var win = window.open(url, "fc_info", 
"scrollbars,height=225,width=400");
        win.focus();
    }
//-->
</script>\n
</head><body$fcs::bodytag>
$fcs::basefont_tag
<form method="post" action="$fcs::this_script_url" target="$fcs::day_frame" 
name="TestForm">
<input type="hidden" name="session_file" value="$session_file">
<input type="hidden" name="calendar" value="$form_data{'calendar'}">!;
}

# SUB spellcheckerjs #

# To include spellchecker routine

sub spellcheckerjs {
        print qq!
<script type="text/javascript" language="javascript" 
src=http://$fcs::site_dom_name.com/spellchecker/spch.js></script>!; 
}

# SUB spellcheckerbutton #

# To include spellchecker routine

sub spellcheckerbutton {
        print qq!
<a href="javascript: var f= document.forms[0];doSpell('en', f.body, 
document.location.protocol + '//' + document.location.host + 
'/cgi-bin/spellchecker/sproxy.cgi', true); "><img 
src="http://$fcs::site_dom_name.com/spellchecker/spellcheck.gif"; 
border="0"></a><br>!; 
}

# SUB FOOTER #

# This subroutine is used to generate a standard footer for each HTML
# page, and properly close the HTML.

sub footer {
        print qq!
<p><font size="1"><center>For comments or questions, contact
<a 
href="mailto:$auths::auth_admin_email_address?subject=Help";>$fcs::support_name</a>
</center></font></body></html>!;
}

# SUB PRINT_EVENT #

# This subroutine prints out the information for an event in the specified
# format.  It is called from three other subroutines.

sub print_event {
        my ($event) = $_[0];
        my ($time,$time_zone,$dur_hrs,$dur_mins,$name,$email,$notified);
        my ($linkurl,$linktitle,$location,$subject,$body,$end_time,$eventid);
        my ($mmn,$mh,$md,$mm,$myr,$mtime,$mtstr,$ampm,$recur_tag);

# We first gather all of the information on the event that was passed to us,
# and then format the time_zone variable and the end_time variable for display.

        ($time,$time_zone,$dur_hrs,$dur_mins,$name,$email,$notified,
         $linkurl,$linktitle,$location,$subject,$body,$eventid) = 
&get_event_info("$event");

        $time_zone = (($fcs::use_time_zones && $time_zone) ? " \( $time_zone 
\)" : '');
        if ($dur_hrs || $dur_mins) {
                $end_time = &get_end_time($time,$dur_hrs,$dur_mins);
        }

# This section of code gets the time that the event file was last modified, so
# we can display this with the event for informational purposes.  After we get
# the time, which is provided in epoch seconds by stat, we format it for 
printing.

        $mtime = (stat("$fcs::path_to_events/$event"))[9];
        ($mmn,$mh,$md,$mm,$myr) = (localtime($mtime + ($fcs::time_offset * 
3600)))[1..5];
        $myr += 1900;
        $mm = $fcs::month_hash{$mm + 1};
        $ampm = "am";
        if ($mh >= 12 ) {
                $mh -= 12;
                $ampm = "pm";
        }
        if ($mh == 0) { $mh = 12; }
        $mtstr = "$mm $md, $myr, at $mh\:".sprintf("%.2d", $mmn)." $ampm";

# Finally, we need to set up our recurrence tag.  If the event is a recurring
# event, and we have defined a value in calendar.setup for $recur_image, we
# will format it here.

        if( ($event =~ /_/o) && $fcs::recur_image ) {
                $recur_tag = " <img src=\"$fcs::recur_image\" border=\"0\" 
alt=\"[ recurring event ]\">";
        }

# Now that we have all the information on the event, we need to print it out.
# The following lines of code do just that, printing out the HTML that formats
# the event information.
# Insert reminder script here 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Insert reminder script here 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Insert reminder script here 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        print qq!

<font color=$fcs::subjcol size="+1"><b>$subject</b></font>$recur_tag<br>
<font color=$fcs::timecol size="1">!;
        if ($end_time) {
                print qq!$fcs::TIME{$time} - 
$fcs::TIME{$end_time}$time_zone<br>!;
        } else {
                print qq!( Call for Time )<br>!;
        }
        print qq!
Location&#58;&nbsp;&nbsp;$location</font>
<blockquote>$body</blockquote>
<font size="1"><i>For further information contact </i>
<a href="mailto:$email?subject=$subject";>$name</a>!;

# At the end of the print, we need to do special formatting depending on whether
# we are allowing off site links to be posted to the event, and if one is 
present.
# If we answer yes to all of these, we add on the link information, formatting 
it
# so that we open a new browser to view the link.  Otherwise, we just finish up
# the closing line for the event.

        if ($fcs::allow_links && $linktitle && $linkurl) {
                print "<i> or go to </i>",
                          "<a href=\"$linkurl\" 
target=\"fc_new\">$linktitle</a>";
        }
        print ".<br><i>Last Updated\: $mtstr ( Server Time )</i></font>";

# Generate random number
$session2 = int(rand(90000));

        print qq!
\<SCRIPT LANGUAGE\=javascript\>
\<\!-- Hide Code



function makeStory$session2\(\) \{
        var writeIt \= new Boolean\(true\)
        for \(var i\=0\; i\<4\; i++\)
        if \(writeIt\) \{
        var subject \= document\.getInfo$session2\.subject\.value
        var location \= document\.getInfo$session2\.location\.value
        var desc \= document\.getInfo$session2\.desc\.value
        storyWin \= window\.open\(\"\"\, 
\"story\"\,\'toolbar\=no\,location\=no\,directories\=no\,status\=no\,scrollbars\=yes\,menubar\=no\,resizable\=yes\,width\=550\,height\=500\'\)
var story \= \"<html><head><title>$fcs::site_dom_name ListServ<\/title><style 
type\=text\/css><\!--input, select { font: Tahoma\; font-size: 8pt\; 
border-width:1\; border-color:000000\; border-style:solid\; 
\}--><\/style><\/head><body bgcolor\=FFFFFF><BR><table cellpadding\=0 border\=0 
cellspacing\=0 width\=500><tr><td><img 
src\=http:\/\/$fcs::site_dom_name.com\/dot.gif height\=1 width\=41 
border\=0><BR><\/td><td bgcolor\=ff0000 width\=1><img 
src\=http:\/\/$fcs::site_dom_name.com\/dot.gif height\=75 width\=1 
border\=0><BR><\/td><td bgcolor\=ffffff width\=10><img 
src\=http:\/\/$fcs::site_dom_name.com\/dot.gif height\=75 width\=10 
border\=0><BR><\/td><td><center><form method\=POST 
action\=http:\/\/www.$fcs::site_dom_name.com\/cgi-bin\/reminder\/remindme.cgi><table
 border\=0><tr><th align\=left colspan\=2><\/th><\/tr><tr><th align\=left>Your 
email address:<\/th><td><input type\=text name\=Email 
size\=15><\/td><\/tr><tr><th align\=left>Your Password:<\/th><td><input 
type\=text name\=Password size\=15><\/td><\/tr><tr><th align\=left>Your 
Password again:<\/th><td><input type\=text name\=Password2 
size\=15><\/td><\/tr><tr><td colspan\=2><font size\=1>Note: You must confirm 
yourself <u>once<\/u> via return email before you setup a 
reminder.<br><hr><\/td><\/tr><input type\=hidden name\=Sendme 
value\=Once><tr><th align\=left>How Far in Advance:<\/th><td><select 
name\=Remindme><option value\=1>1 day <option value\=3>3 days <option 
value\=7>1 week <option value\=21>3 weeks <option value\=30>1 month <option 
value\=180>6 months <\/select><\/td><\/tr><tr><td 
colspan\=2><hr><\/td><\/tr><tr><th align\=center colspan\=2>The 
Message:<\/th><\/tr><tr><td align\=center colspan\=2><textarea name\=Message 
cols\=40 rows\=5>\\n\"\;
var story \= story + subject + \"\\n\"\;
var story \= story + \"<br>\\n\"\;
var story \= story + location + \"\\n\"\;
var story \= story + \"<br>\\n\"\;
var story \= story + desc + \"<\/textarea><\/td><\/tr><tr><input type\=hidden 
name\=Formaction value\=Add><input type\=hidden name\=Sendme value\=Once><input 
type\=hidden name\=Day value\=$day2><input type\=hidden name\=Month 
value\=$current_month_name><input type\=hidden name\=Year 
value\=$currentyear><td colspan\=2 align\=center><input type\=submit 
value\=DoIt><\/td><\/tr><\/form><\/table><\/center><hr><center><strong><a 
name\=list_reminders>List Reminders:<\/a><\/strong><form method\=POST 
action\=http:\/\/www.$fcs::site_dom_name.com\/cgi-bin\/reminder\/remindme.cgi><input
 type\=hidden name\=Formaction value\=List><table border\=1><tr><th><table 
border\=0><tr><th align\=right>Email address:<\/th><td><input type\=text 
name\=Email size\=15><\/td><\/tr><tr><th align\=right>Password:<\/th><td><input 
type\=password name\=Password size\=15><\/td><\/tr><tr><th colspan\=2><input 
type\=submit value\=List 
Reminders><\/tr><\/form><\/table><\/th><\/tr><\/table><\/center><hr><P><center><font
 size\=1>Concept by Arie Vandenberg, custom programming by Kristina 
Pfaff-Harris<br> RemindMe v3.1 copyright \&copy\; 2000 Kristina Pfaff-Harris 
can be found at <A 
HREF\=http:\/\/www.tesol.net\/scripts\/>http:\/\/www.tesol.net\/scripts\/<\/A>. 
<\/center><\/td><\/tr><\/table><BR><BR><BR><\/BODY><\/HTML>\"
        storyWin\.document\.writeln\(story\)
        storyWin\.document\.close\(\)
        storyWin\.focus\(\)
        \}
\}
\/\/ End hide --\>
\<\/SCRIPT\>!;

        print ".<FORM NAME=\"getInfo$session2\"><INPUT NAME=subject TYPE=hidden 
SIZE=25 VALUE=\"$subject\"><INPUT NAME=desc TYPE=hidden SIZE=25 
VALUE=\"$body\"><INPUT NAME=location TYPE=hidden SIZE=25 
VALUE=\"$location\"><INPUT TYPE=button VALUE=Setup_Reminder 
onClick=makeStory$session2();return true></FORM>";

}

# SUB GET_EVENT_INFO #

# This subroutine returns the information from an event file associated with an
# id number.  Note that we apply special formatting to the file when we create 
it,
# and place it in the same order, so that when we call this subroutine it is
# returned in the same order every time.  Thus, if you make modifications to 
what
# data is stored in this file, be sure to get the insertion/extraction order
# correct!

sub get_event_info {
        my ($filename) = $_[0];
        my (@event_array);

# We open up the file, then read through it one line at a time.  If the line 
starts
# with one of the tags that we have defined, we push what it "points to" onto 
the
# array that we will return.

        open (EVENTFILE, "$fcs::path_to_events/$filename") || 
&open_error("event file $filename");
        while (<EVENTFILE>) {
                   if (/^time->(.*)/io)                 { push (@event_array, 
$1); }
                elsif (/^timezone->(.*)/io)             { push (@event_array, 
$1); }
                elsif (/^durationhrs->(.*)/io)  { push (@event_array, $1); }
                elsif (/^durationmins->(.*)/io) { push (@event_array, $1); }
                elsif (/^name->(.*)/io)                 { push (@event_array, 
$1); }
                elsif (/^email->(.*)/io)                { push (@event_array, 
$1); }
                elsif (/^notified->(.*)/io)             { push (@event_array, 
$1); }
                elsif (/^linkurl->(.*)/io)              { push (@event_array, 
$1); }
                elsif (/^linktitle->(.*)/io)    { push (@event_array, $1); }
                elsif (/^location->(.*)/io)             { push (@event_array, 
$1); }
                elsif (/^subject->(.*)/io)              { push (@event_array, 
$1); }
                elsif (/^body->(.*)/io)                 { push (@event_array, 
$1); }
        }
        close (EVENTFILE);

# At the end of the file, we close it, then chomp the entire array, since
# each item has a trailing new line character.  We are then done, so we
# return the array.

        chomp (@event_array);
        return (@event_array);
}

# SUB GET_END_TIME #

# This subroutine takes a beginning time and duration and returns a
# properly formatted end time.

sub get_end_time {
        my ($time,$dur_hrs,$dur_mins) = @_;
        my ($end_hrs,$end_mins,$end_time);

# Initialize the end_hrs and end_mins by splitting the start time
# at the :.  We then increase the minutes by the duration minutes.
# If they are greater than 60, we add one to end_hrs, and subtract
# 60 off of end_mins.  Then we add the duration hours to end_hrs,
# and correct for being greater than 24 if necessary.  We then
# format the time correctly, and return it.

        ($end_hrs,$end_mins) = split(/:/, $time);
        $end_mins += $dur_mins;
        if ($end_mins >= 60) { $end_hrs++; $end_mins -= 60; }
        $end_hrs += $dur_hrs;
        if ($end_hrs >= 24) { $end_hrs -= 24; }
        $end_time = sprintf("%.2d", $end_hrs).":".sprintf("%.2d", $end_mins);
        return ($end_time);
}

# SUB DAY_OF_WEEK #

# This subroutine calculates the day of the week a particular date falls on,
# and returns that name.  Note that it uses English names for the days of the
# week, so you will need to change these if you are converting to another 
language.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]