[16185] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3597 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 19:03:59 2000

Date: Mon, 10 Jul 2000 16:03:48 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963270228-v9-i3597@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3597

Today's topics:
        Runtime Exception from commandline only, and not via CG <melorama@nospam.gov>
    Re: Runtime Exception from commandline only, and not vi <melorama@nospam.gov>
    Re: Runtime Exception from commandline only, and not vi <anmcguire@ce.mediaone.net>
    Re: Runtime Exception from commandline only, and not vi <melorama@nospam.gov>
        Script for generating pronunciations <vm1@ece.msstate.edu>
    Re: Script for generating pronunciations <care227@attglobal.net>
        Script working fine BUT..... <someone@nowhere.com>
        search and replace a hex string <cdonahue@bbn.com>
    Re: search and replace a hex string <bwalton@rochester.rr.com>
        send variable from html to perl <cam@home.com>
    Re: send variable from html to perl turnere@cc.wwu.edu
    Re: Sendmail, Perl and Windows <steven.van-poeck@SPAM.wanadoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 04 Jul 2000 19:34:04 -1000
From: Mel Matsuoka <melorama@nospam.gov>
Subject: Runtime Exception from commandline only, and not via CGI?
Message-Id: <rhh5ms0pe0rrs0gt0c17javl6mifnirbds@4ax.com>

Ive been spending all day trying to figure this one out...perhaps someone here
can shed some light on this.

Im using Win32::ODBC to create static HTML pages (basically by redirecting the
script's STDOUT to a filehandle, which im sure is a dorky way to do it, but at
least it works for me), based on data which resides in an Access97 database.
Some of the fields include very large memo data, but up to now, ive never had a
problem with my script crapping out because of them.

Today, i imported a table from an external Access97 database (via copy/paste),
and tried to run my script on it, and everything seemed to work normally, except
now the script terminates early with an "Error: Runtime Exception" error. It
looks like the script works fine up to a certain point and then dies, as if its
running out of memory or data or something else.

The wierd thing is, when i execute my script via CGI and my local webserver,
everything works just dandy, no apparant Runtime exceptions or truncated script
output.

What gives? I'm definitely not a perl wizard or even a programmer in general, so
im sort of at a loss as to why it would crap out in one environment and work
perfectly fine in another (my script does not depend on any environment
variables or commandline args)

The only thing i can think of is that the MS-DOS cmd environment under
WinNT/2000 has some sort of memory allocation limitation that prevents the large
output from the script to return properly. I did a search of the Camel book, as
well as Dejanews, and from what i can gather, this Runtime Exception error is
strictly a Win32 thing (i could find nothing about it in the camel book)

Im running Activestate Perl 5.005_3 build 522 under Windows2000 and the Xitami
webserver v2.4d6.

If it helps any, the script im using is pasted below. I'm fairly positive that
it'll provide for many laughs among the "real" perl hackers on this forum :) But
like i said, im a video-production guy, not a programmer, so be nice :)

Thanks in advance
--mel


#!C:\perl\bin\perl.exe -w
# 
# Mel's Perl-o-Matic page generator
#
# Shoppingcart product page generator
# written by Mel Matsuoka
#
# Generates product HTML pages from a MS-Access database file via ODBC.
# Make sure to add the DSN for the database file in Control Panel/ODBC/SystemDSN
# Obviously, this script runs only under Perl-Win32. duh.
#
# last modified: 7.04.2000


# import required modules

use CGI;            # CGI.pm - used for HTML/CGI creation
use Win32::ODBC;    # used for ODBC/Microsoft Access connnectivity from Perl
use Image::Size;    # used to parse graphic sizes automatically

 
####### begin CONFIGURATION ##########

my $SystemDSN = "vwtapes";	      # name of main database DSN
my $TableName = "Oreilly_1999";
my $BaseDirectory = "/oreilly/1999"; # do not add trailing slash
my $ConferenceMainIndex = "/oreilly-main.html";

my $LocalSiteRoot = "e:/vwtapes";	# Windows drive:/folder 
					# where site root is located.
                                  	# Dont add trailing slash
   
# path to conference graphic, using absolute server-root based 
# path as would be referenced one the unix server

my $ConferenceGraphic = "/oreilly/1999/ora99-header.gif";
                            
my $TracksBoxHeader = "O'Reilly Open Source Software Convention 1999 conference
tracks";
my $ConferenceName = "O'Reilly Open Source Software Convention 1999";
my $ConferenceDate = "August 21 - 24, 1999";
my $ConferenceLocation = "Monterey, CA";
my $ConferenceURL = "http://conferences.oreilly.com";
my $OrderTheTapesFrom = "Order the tapes from the 1999 O'Reilly Open Source
Software Convention!";
my $AlsoAvailableLinktext = "Audio &amp; video tapes from other Oreilly";

my $MetaTitle = "O'Reilly Open Source Software Convention 1999 - conference
audio/video tapes";
my $MetaDescription = "Audiotaped sessions from the 1999O'Reilly Open Source
Software Convention";

my $MetaStandardKeywords = "vwtapes, vw tapes, VWTapes, keynote, keynotes,
tapes, conferences, audiotapes, developer, conference, track, tracks, seminars,
lectures, documentation, audio, training, documentation, tutorials, learning,
conventions, speeches, expo, tapes, recording, computer, tapes, recordings,
transcript, transcripts, video, videotapes, trade show, trade shows";

my $MetaSpecificKeywords = "O'Reilly, Oreilly, Open Source Software Convention,
software, open source, Linux, Perl, python, Tcl/Tk, sendmail, Apache, Larry
Wall, keynote";

# page for other conferences of same name
# my $RelatedConferences = 


####### end CONFIGURATION ##########


       ### open database and create new Win32::ODBC object
        
       my($db) = new Win32::ODBC("$SystemDSN") 
      
            or die "Error opening ODBC file $!";

       # reset max buffer size 
       
       #$db->SetMaxBufSize(81920); 

       # for debugging purposes only
       # 
       # print "Error: " . Win32::ODBC::Error() . "\n";
       #  $db->DumpData;

########################################
# Generate the page!!!!!!!!
########################################

my $CurrentTime = localtime();



get_tracknames ();

foreach $TrackName (sort keys (%tracknames_unique)) {
 
       #### select data from database using SQL statement
       $db->Sql("SELECT * FROM $TableName WHERE TrackName LIKE '%$TrackName%'
ORDER BY SessionNumber"); 
    


open(PAGEOUT,">$LocalSiteRoot$BaseDirectory/$tracknames_unique{$TrackName}.html")
       or die "Couldnt open
$LocalSiteRoot$BaseDirectory/$tracknames_unique{$TrackName}.html for writing:
$!\n";    
        
   select (PAGEOUT);  # redirect STDOUT to filehandle
   
   print_header ();
       
       while ($db->FetchRow()) {
                my(%data) = $db->DataHash();


                ### translate non alphanumeric characters
		### into escaped counterparts
                ### (shoppingcart will choke without them)

                $confname_escaped=CGI->escape($data{'ConferenceName'});
                $title_escaped=CGI->escape($data{'SessionTitle'});        
       
                ### assign prices for tapes        
                $unitprice_audio_eng = $data{'EnglishAudio'};
                $unitprice_audio_jap = $data{'JapaneseAudio'};
                $unitprice_video_ntsc_eng = $data{'EnglishVideoNTSC'};
                $unitprice_video_pal_eng = $data{'EnglishVideoPAL'};
                $unitprice_video_ntsc_jap = $data{'JapaneseVideoNTSC'};
                $session_title = $data{'SessionTitle'};

                ### initialize misc variables
                $session_desc = $data{'SessionDescription'};
                $QtyInAudioSet = $data{'SetQuantityAudio'};      
                $QtyInVideoSet = $data{'SetQuantityVideo'};  
                $sku = $data{'SKU'};    

                $speakernames=$data{'SessionSpeaker'};
                
                create_cart_items();

            }
       print_footer();  

close(PAGEOUT);          
   }
   

# create ordering info page
   
   open(INFOPAGE,">$LocalSiteRoot$BaseDirectory/index.html")
        or die "Couldnt open $LocalSiteRoot$BaseDirectory/index.html
	for writing: $!\n";     
   
	select (INFOPAGE);                # redirect STDOUT to file

 generate_orderinfopage();


   close(INFOPAGE); 
                   
            $db->Close();            # close the database       
   
   select(STDOUT);                   # re-select STDOUT

exit;     
     
     
################ SUBROUTINES #######################################     
     
######################################################
# print_header() 
#
# generates tracklinks, graphic banner, HEAD tags etc
# (everything that appears before the cart items)
#
######################################################
sub print_header {
        
        
($ConferenceGraphicWidth, $ConferenceGraphicHeight) =
imgsize("$LocalSiteRoot$ConferenceGraphic"); 

print<<"HEADER";

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>

<HEAD>

<TITLE>$MetaTitle - $TrackName</TITLE>

<LINK REV="made" href="mailto:webmaster\@vwtapes.com">

<META name="generator" content="Mel's Perl-o-Matic page generator">

<META name="resource-type" content="document">

<META name="description" content="$MetaDescription">

<META name="keywords" content="$MetaSpecificKeywords, $MetaStandardKeywords">

<META name="distribution" content="global">

<META name="copyright" content="Copyright 2000 VWTAPES">

<META name="robots" content="nofollow">

</HEAD>

 

<BODY LINK="#0000CC" BGCOLOR="#FFFFFF" VLINK="#000000">

<A NAME="TOP">&nbsp;</a><br>

<!-- CLIENTSIDE IMAGE-MAP DATA (begin)-->

        <MAP NAME="HOME">

        <AREA SHAPE="RECT" COORDS="86,0,472,34"
HREF="/cgi-local/vwcart.pl?page=/index.html&cart_id=" ALT="VWTapes homepage">

        <AREA SHAPE="RECT" COORDS="357,36,560,54"
HREF="mailto:orders\@vwtapes.com" ALT="orders\@vwtapes.com">

        </MAP>

<!-- CLIENTSIDE IMAGE-MAP DATA (end)-->



<!-- VWTAPES GRAPHIC HEADER (begin) -->
    <CENTER>
    
    <IMG SRC="/headers/vwpblue.gif" ALT="VWTapes - phone: 888-VWTAPES  fax:
408-295-3925  e-mail: orders\@vwtapes.com" WIDTH="589" HEIGHT="55" BORDER="0"
USEMAP="#HOME"><BR>

    <IMG SRC="/headers/tapestore.gif" WIDTH=589 HEIGHT=50 BORDER=0
ALT="Audio/Video Store"><BR>

    </CENTER>
<!-- VWTAPES GRAPHIC HEADER (end) -->

    <P>

<!-- conference graphic banner (begin)---->
        <center>
        <a href="$ConferenceURL" target="_blank"><img src="$ConferenceGraphic"
width="$ConferenceGraphicWidth" height="$ConferenceGraphicHeight" border="0"
alt="$ConferenceName"></a><br>
        <img src="/dot.gif" alt="" width=1 height=10><br>
   

        </center>
<!--conference graphic banner (end)--->
 


<p>

<!-- begin track links----->
<center>

<!-- next three lines create black table borders in Netscape -->
<table border="0" cellspacing="0" cellpadding="0"  width="470">
<tr bgcolor="#000000">
<td align=center><font size="+1"
color="#ffffff">$TracksBoxHeader</font><br></td>
</tr>
<tr>
<td bgcolor="#000000">
        
          <table border="0" cellspacing="2" cellpadding="10"
bordercolor="#000000" width="100%">
          <tr bgcolor="#FFFFDF"> 
          

                <td VALIGN="MIDDLE" ALIGN="CENTER" bgcolor="#FFFFDF"> 


HEADER
                
           

       print <<"DROPDOWN";
                <!-- begin dropdown tracklist--->
                <FORM METHOD="POST" ACTION="/cgi-local/vwcart.pl">
                <INPUT TYPE="hidden" NAME="cart_id" VALUE="%%cart_id%%">
                <SELECT NAME = "page">
        
DROPDOWN
      
        
                # alphabetize and iterate thru unique tracknames
                
               
               
               $counter = 1;
               
        foreach $booger (sort keys (%tracknames_unique)) {
                
                # check to see if the current key matches the 
                # current $Trackname being worked on.
                # if it matches, then insert the 'SELECTED' attribute 
                # to the OPTION line
                
                if ($booger eq $TrackName) {
                    $selected = "SELECTED"
                    } else {
                        $selected = ""
                        }
                    
                print "\t\t<OPTION VALUE =
\"$BaseDirectory/$tracknames_unique{$booger}.html\" $selected>$booger
$counter\n";
                
                $counter++;
            }
            

        print <<"DROPDOWN2";
        
                </SELECT>

                <input type="submit" value="Go!" border="0"><br>

                
DROPDOWN2
               
 
print<<"HEADER2";               
				</td>
               </FORM>
               <!-- end dropdown tracklist--->               
			
            	</tr>
				
				<tr>
				<td align="CENTER" valign="MIDDLE"
bgcolor="#FFFFFF" width="100%"> 

                <font size="-1"><a
href="/cgi-local/vwcart.pl?page=$BaseDirectory/index.html&cart_id=">CLICK HERE
FOR DETAILED ORDERING INFORMATION</a></font><br>

                 <img src="/dot.gif" alt="" width=1 height=4><br>
<a
href="/cgi-local/vwcart.pl?&page=%%page%%&cart_id=&modify_cart_button=View%2FModify+Cart"><font
size="-1">VIEW YOUR SHOPPING-CART</font></a><br>
                
                <img src="/dot.gif" alt="" width=1 height=4><br>
                <font size="-1"><a
href="/cgi-local/vwcart.pl?page=$ConferenceMainIndex&cart_id=">$AlsoAvailableLinktext</a></font><br>

                
				</td>
				</tr>
			</TABLE>

<!-- next three lines close the table for Netscape black borders -->
</td>
</tr>
</table>
<P>
</center>
<!-- end tracklinks--->


<center><h1>$TrackName</h1></center>


<!--- begin cart items --->
HEADER2
}


######################################################
# print_footer() 
#
# generates page footer (everything after cart items
# 
######################################################
sub print_footer {

print<<FOOTER;


<!--- end cart items --->

<center>
<FONT SIZE="2">Last Updated: $CurrentTime HST</FONT>

<P>
<FONT FACE="arial,helvetica" SIZE="2"> &copy;2000
<a href="/cgi-local/vwcart.pl?page=/index.html&cart_id=">VWTAPES</A><BR> All
Rights Reserved<BR>
</FONT>
</CENTER>
 
</center>
</BODY>
</HTML>
FOOTER
}        


######################################################
# generate_orderinfopage() 
#
# generates "Ordering Information" page
# 
######################################################
sub generate_orderinfopage {

        print_header();
        
    
print<<"ORDERINFO";

<P>
<!----- begin ORDERING INFORMATION TABLE
---------------------------------------------->


    
<CENTER>

<TABLE BORDER="0" CELLPADDING="5" WIDTH="580">

<TR>

	<TD>

    <UL TYPE="square">

    <LI>

		    <u><b>ORDERING CONFERENCE TAPES</b></u> 



			<P>

			<font color="#FF0000"><b>Place your order using our
secure orderform:

              (below):</b><br></font>

              Your credit card information will be transmitted to our server via

              SSL, and automatically encrypted on our server using 2,048 bit PGP

              encryption. Your security is assured, as credit card numbers are 

              <em>never</em> stored on our servers in unencrypted form.



            <P>

			<font color="#FF0000"><b>Place your order via
FAX:</b><br></font>

              To FAX your order, call <strong>1-408-295-3925</strong>. Please
make sure to include 

              the catalog number, conference name, session title and quantity 

              for each tape ordered, as well as your credit card number, daytime

              <i>and</i> evening telephone number, and your shipping address. 





			<P>

			<font color="#FF0000"><b>Place your order using our
toll-free ordering line:</b></font>

			<br>

              Call <strong>1-888-VWTAPES</strong> (8982737). International
orders, please call 

              <strong>1-408-295-2939</strong>.





			<P>

			<font color="#FF0000"><b>Place your order via
e-mail:</b></font> 

			<br>

              Send your order to <a
href="mailto:orders\@vwtapes.com">orders\@vwtapes.com</a>. 

              However, for your security, please DO NOT send us your credit card

              information via unencrypted e-mail. A VWTAPES customer-service
representative 

              will call you back to collect your credit card number. If you wish

              to send us your credit card information over the internet, please 

              use our secure-orderform instead.



			<P>


			<font color="#FF0000"><b>Place your order via U.S.
mail:</b></font> 

            <p>
	
			
			<strong>VW TAPES<br>
			265 MERIDIAN AVE. #10<br>
			SAN JOSE, CA 95126</strong>
			
			<P>

			<font><b>Please make all checks payable to
"VWTAPES"</b></font>
			<P><b>Your purchase will appear on your credit card
statement as<br>
            <font>"VWTAPES - Honolulu, HI"</font> </b><P>

	</LI>



	<P>

		  


<LI><u><b>"WHICH VIDEOTAPE FORMAT SHOULD I BUY?"</b></u>
<P>
You should purchase the appropriate videotape format depending on the prevailing
<a href="/cgi-local/vwcart.pl?page=/tapestandards.html&cart_id=">television
standard</a> for your country. There are three different videotape standards for
various areas of the world, known as "NTSC", "PAL" and "SECAM". Please note that
NTSC videotapes will NOT play back properly in PAL VCR's and television sets
(and vice versa). <P>

United States, Canada and Japan use the "NTSC" format, which is the standard
recording format used by VWTapes. The United Kingdom, Australia and other
countries use the "PAL" format. To find out which standard your country uses,
please refer to our <a
href="/cgi-local/vwcart.pl?page=/tapestandards.html&cart_id=">International
videotape standards chart</a>.<P>

Please call or <a href="mailto:orders\@vwtapes.com">e-mail</a> us if you would
like to order SECAM videotapes.<P>



<P>


	<LI>

			<u><b>SHIPPING AND HANDLING</b></u><br>

            <font size="-1" color="#FF0000">(Domestic orders only - Please call
1-408-295-2939 or <a href="mailto:orders\@vwtapes.com">e-mail</a> for
international 

            postage rates)</font>

            
             
            <P>1 audiotape, add \$2.00<br>
		2-5, add \$4.00<br>

              6-15, add \$6.00.<br>

              16-30, add \$12.00<br>

              31-102, add \$25.00
             
             
            <P>Add \$4.00 for each Videotape ordered. 

     


	</LI>

	</UL>



	</TD>

</TR>

</TABLE>

</CENTER>

<!----- end ORDERING INFORMATION TABLE
---------------------------------------------->

	<center><a href="#top"><img src="/top.gif" width=50 height=40 border=0
alt=""></a></center> 
    <P> 
ORDERINFO

print_footer();
        
}




######################################################################
# item_audio_english() 
#
# generates "add to cart" link for English language audiotapes
#
######################################################################
sub item_audio_english {

            print<<ORDERNOW;
            
            <!--- $sku Audiotape (english) begin --->
            <a
href="/cgi-local/vwcart.pl?page=%%page%%&cart_id=&option%7C1%7C$sku=Audiotape%7C$unitprice_audio_eng&item-$sku%7C$confname_escaped%7C%7C$title_escaped=1&add_to_cart_button=Add+to+cart">

            <font size="-1">Audiotape</font></a> - <font
size="-1">\$$unitprice_audio_eng</font>

            <br>
            <!--- $sku Audiotape (english) end --->            
ORDERNOW

}


######################################################################
# item_audio_japanese() 
#
# generates "add to cart" link for Japanese language audiotapes
#
######################################################################
sub item_audio_japanese {
            print<<ORDERNOW;
            
            <!--- $sku Audiotape (japanese) begin --->            
            <a
href="/cgi-local/vwcart.pl?page=%%page%%&cart_id=&option%7C1%7C$sku=Audiotape+Japanese%7C$unitprice_audio_jap&item-$sku%7C$confname_escaped%7C%7C$title_escaped=1&add_to_cart_button=Add+to+cart">

            <font size="-1">Audiotape (Japanese)</font></a> - <font
size="-1">\$$unitprice_audio_jap</font>

            <br>
            <!--- $sku Audiotape (japanese) end --->            
ORDERNOW
}

######################################################################
# item_video_english_ntsc() 
#
# generates "add to cart" link for English language NTSC videotapes
#
######################################################################    
sub item_video_english_ntsc {
            print<<ORDERNOW;
            
            <!--- $sku Videotape (english-ntsc) begin --->               
            <a
href="/cgi-local/vwcart.pl?page=%%page%%&cart_id=&option%7C1%7C$sku=NTSC+Videotape+English%7C$unitprice_video_ntsc_eng&item-$sku%7C$confname_escaped%7C%7C$title_escaped=1&add_to_cart_button=Add+to+cart">

            <font size="-1">Videotape (English/NTSC)</font></a> - <font
size="-1">\$$unitprice_video_ntsc_eng</font>

            <br>            
            <!--- $sku Videotape (english-ntsc) end --->              
ORDERNOW
}


######################################################################
# item_video_english_pal() 
#
# generates "add to cart" link for English language PAL videotapes
#
######################################################################
sub item_video_english_pal {

            print<<ORDERNOW;
            
            <!--- $sku Videotape (english-pal) begin --->               
            <a
href="/cgi-local/vwcart.pl?page=%%page%%&cart_id=&option%7C1%7C$sku=PAL+Videotape+English%7C$unitprice_video_pal_eng&item-$sku%7C$confname_escaped%7C%7C$title_escaped=1&add_to_cart_button=Add+to+cart">

            <font size="-1">Videotape (English/PAL)</font></a> - <font
size="-1">\$$unitprice_video_pal_eng</font>

            <br>       
            <!--- $sku Videotape (english-pal) end --->                        
ORDERNOW
}


######################################################################
# item_video_japanese_ntsc() 
#
# generates "add to cart" link for Japanese language NTSC videotapes
#
######################################################################
sub item_video_japanese_ntsc {
           print<<ORDERNOW;
           
            <!--- $sku Videotape (japanese-ntsc) begin --->              
            <a
href="/cgi-local/vwcart.pl?page=%%page%%&cart_id=&option%7C1%7C$sku=NTSC+Videotape+Japanese%7C$unitprice_video_ntsc_jap&item-$sku%7C$confname_escaped%7C%7C$title_escaped=1&add_to_cart_button=Add+to+cart">

            <font size="-1">Videotape (Japanese/NTSC)</font></a> - <font
size="-1">\$$unitprice_video_ntsc_jap</font>

            <br>   
            <!--- $sku Videotape (japanese-ntsc) end --->
ORDERNOW
}



  
     
###################################################################################
# get_tracknames() 
#
# This subroutine gets a list of tracknames from the database and then
# creates an array of unique tracknames. The tracknames from this list
# are then copied and then "cleaned" to remove all whitespace and
non-alphanumeric
# characters. The resulting "clean" names are used to create filenames that
# correspond to the original trackname. This all gets put in a hash called
# %tracknames_unique, where key=original trackname and value="cleaned" trackname
#
###################################################################################


sub get_tracknames {

        $tracknamesdata = new Win32::ODBC("$SystemDSN") 
            or die "Error opening ODBC file $!";
       
       
       # $tracknamesdata->SetMaxBufSize(81920);
        
       #### select data from database (for getting tracknames)
       $tracknamesdata->Sql("SELECT TrackName FROM $TableName"); 

       # populate an array that contains all tracknames from SELECT'ed table
       
       my(@tracknames_dump) =();
       while ($tracknamesdata->FetchRow()) {
                push(@tracknames_dump, $tracknamesdata->Data("TrackName"));
                }                

       # then, eliminate duplicates in @tracknames_dump so we 
       # get a list of unique tracknames, then transfer results
       # to @tracknames array

       %seen =();  # initialize temporary hash to hold already "seen" tracknames
       $item=();
       
       foreach $item (@tracknames_dump) {
            push(@tracknames, $item) unless $seen{$item}++; 
            }
           
       @tracknames = sort(@tracknames); # alphabetize resulting list     

      for (@tracknames) {
                    chomp;
                  }
   
   # create a new hash of original trackname => "cleaned" trackname 
   # (for creating filenames with no whitespace & wierd chars.)
        
%tracknames_unique =();     # initialize hash
           
         foreach (@tracknames) {
                   my($clean) = $_;
                   $clean =~ tr/ //d;           # strip blank spaces
                   $clean =~ tr/a-zA-Z0-9//cd;  # strip non-alpha characters
                   $clean = "\L$clean";         # force all characters to
lowercase
                   
                   $tracknames_unique{$_} =  $clean;  # add final hash record
      
                }           
    $tracknamesdata->Close();   # close database connection 
}


###########################################
# create_cart_items() 
#
# Generates the cart display for each item, 
# including "buy now" links
#
###########################################

sub create_cart_items {

print <<"GETTHETAPE";


<!--- begin #$sku --->
<img src="/dot.gif" alt="" width=1 height=40><br>

<center>
<table border=0 width=500 cellpadding=6 cellspacing=0>
<tr>
    <td valign=middle width=50%>
        <font size="5">$session_title</font><br>
        <img src="/dot.gif" alt="" width=1 height=4><br>
        <font face="Arial, Helvetica" size="-2"><b><u>Speaker(s)</u>:
$speakernames</b></font><br>
        <font face="Arial, Helvetica" size="-2"><b><u>Catalog No</u>:
#$sku<br></b></font><br>
    </td>

    <td valign="top" width=50%>
            <table border=0 cellpadding=0 cellspacing=0 width=100%>
            <tr>
            <td valign="middle" align="center" bgcolor="#000000"><img
src="/get_the_tape.gif" width=145 height=14 border=0 alt="Get the tape!"></td>
            </tr>
        </table>    
    
        <table border=0 cellpadding=6 cellspacing=0 width=100%>
            <tr>
            <td valign="middle" bgcolor="#dfdfdf">

GETTHETAPE


##### Generate "get the tape" cart-add links (begin)###############

    
    if ($unitprice_audio_eng != "0") {
        item_audio_english();
        }


    
    if ($unitprice_audio_jap != "0") {
        item_audio_japanese();
        }
          
            
    if ($unitprice_video_ntsc_eng  != "0") {
        item_video_english_ntsc();
        }


    if ($unitprice_video_pal_eng != "0") {
        item_video_english_pal();
        }


    if ($unitprice_video_ntsc_jap  != "0") {
        item_video_japanese_ntsc();
        }

##### Generate "get the tape" cart-add links (end)###############


#######################################
# Close out the "get the tapes!" table,
# create "view shopping cart" link, and
# display session description
#######################################

print<<ALLTHEREST;						
			</td>
			</tr>
		</table>

		<center>
		<a
href="/cgi-local/vwcart.pl?&page=%%page%%&cart_id=&modify_cart_button=View%2FModify+Cart"><font
size="-1">view your shopping-cart</font></a>
		</center>
	</td>
</tr>

<tr>
	<td colspan=2>
	
	$session_desc	
	<P>
	<center><a href="#top"><img src="/top.gif" width=50 height=40 border=0
alt=""></a></center><br>

	<center>
	</td>
</tr>
</table>
</center>

<p>
<!--- end #$sku --->



ALLTHEREST
}
              


    exit;    
  
    


#### fin ####
        
        


______________________________________________________________
mel matsuoka                  Hawaiian Image Video Productions
Editor/Digital Media Dweeb        http://www.hawaiianimage.com
mel@EATTHISSPAMFORDhawaiianimage+com

(e-mail address is spam-protected. Remove capital letters and replace plus-sign
with a dot to reply via e-mail. All opinions stated are strictly my own, and do 
not reflect the views of my employer, thier clients or the Commissioner of Baseball.)


------------------------------

Date: Tue, 04 Jul 2000 19:45:40 -1000
From: Mel Matsuoka <melorama@nospam.gov>
Subject: Re: Runtime Exception from commandline only, and not via CGI?
Message-Id: <hpi5ms8vpq5lrerbe1nv40ppta63l24jkq@4ax.com>

<bloody long code snipped>

ack! I forgot to snip out all the huge HTML parts of the script before posting
that....sorry about that, chief...




------------------------------

Date: Wed, 5 Jul 2000 01:59:37 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Runtime Exception from commandline only, and not via CGI?
Message-Id: <Pine.LNX.4.21.0007050150050.8520-100000@hawk.ce.mediaone.net>

On Tue, 4 Jul 2000, Mel Matsuoka wrote:

+ Ive been spending all day trying to figure this one out...perhaps someone here
+ can shed some light on this.
+ 

[ 15 secs worth of C+k ]

Well, I can help you some.  You have probably pissed a couple of
people here off ( at least ).  Don't post such enormous amounts of
code.  It just turns people off to helping. :-)

anm  
-- 
/*----------------------------------------------------------------.
| Andrew N. McGuire                                               |
| anmcguire@ce.mediaone.net                                       |
| perl -e 'print map m~"(.*)"~ && "\u$1!\n" => `perldoc -q japh`' |
`----------------------------------------------------------------*/



------------------------------

Date: Tue, 04 Jul 2000 22:28:22 -1000
From: Mel Matsuoka <melorama@nospam.gov>
Subject: Re: Runtime Exception from commandline only, and not via CGI?
Message-Id: <scs5mscamjkq0cqq0kg4eku2ijnrankmas@4ax.com>

On Wed, 5 Jul 2000 01:59:37 -0500, "Andrew N. McGuire "
<anmcguire@ce.mediaone.net> wrote:

>On Tue, 4 Jul 2000, Mel Matsuoka wrote:
>
>+ Ive been spending all day trying to figure this one out...perhaps someone here
>+ can shed some light on this.
>+ 
>
>[ 15 secs worth of C+k ]
>
>Well, I can help you some.  You have probably pissed a couple of
>people here off ( at least ).  Don't post such enormous amounts of
>code.  It just turns people off to helping. :-)

I am well aware of that, as i mentioned in my immediate followup post.

To quote the great Elvis Costello, "Accidents Will Happen..."

cheers,
mel




------------------------------

Date: Wed, 5 Jul 2000 07:06:50 -0500
From: Vishwanath Mantha <vm1@ece.msstate.edu>
Subject: Script for generating pronunciations
Message-Id: <Pine.SOL.4.10.10007050704550.15386-100000@leto.ece.msstate.edu>



I need to write a script that will take a word as input and get it's 
pronunciation from the web (http://www.m-w.com). Are there any commands
that can help simplify the script. 

Regards,
Mantha




------------------------------

Date: Wed, 05 Jul 2000 10:37:23 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Script for generating pronunciations
Message-Id: <39634823.5E42F33F@attglobal.net>

Vishwanath Mantha wrote:
> 
> I need to write a script that will take a word as input and get it's
> pronunciation from the web (http://www.m-w.com). Are there any commands
> that can help simplify the script.
> 

Perhaps the LWP module, check it out at:

http://search.cpan.org/search?mode=module&query=LWP


------------------------------

Date: Sat, 8 Jul 2000 07:34:39 +0100
From: "the gen" <someone@nowhere.com>
Subject: Script working fine BUT.....
Message-Id: <j0H95.80$Gb2.129699@news.pacbell.net>

thanks in advance to all that help me with this...

i have a system using backoffice with iis 4.0 installed on it
i am running perl.. i run a script in the browser (webcounter) and it works
fine but... i also get an http msg that is posted right in front of the
counter..I DONT WANT THAT.. the msg says
HTTP/1.1 200 OK Date: Fri, 07 Jul 2000 09:46:54 GMT Server:
Microsoft-IIS/4.0 content-type: text/html
then the counter is right after that HOW DO I GET RID OF THAT CODE... ive
spent about 6 hours on this problem and can find anything on how to fix
this...


thanks again

The Gen







------------------------------

Date: Fri, 07 Jul 2000 01:08:42 GMT
From: Craig Donahue <cdonahue@bbn.com>
Subject: search and replace a hex string
Message-Id: <39652D8E.19CD9AE6@bbn.com>

Hello.  I am not a programmer and therefore I am humbly asking for help.

I have a file ( GT 250mb) where I want to replace every occurance of a
hex value.  In this case I want to replace hex 1F with 09.  Could some
one show me the correct syntax to accomplish this?  The file is a
standard unix flatfile.


email solution to cdonahue@genuity.com 

Thanks in advance for your help.  

Craig


------------------------------

Date: Fri, 07 Jul 2000 04:04:15 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: search and replace a hex string
Message-Id: <39655702.FF6D4876@rochester.rr.com>

Craig Donahue wrote:
> 
> Hello.  I am not a programmer and therefore I am humbly asking for help.
> 
> I have a file ( GT 250mb) where I want to replace every occurance of a
> hex value.  In this case I want to replace hex 1F with 09.  Could some
> one show me the correct syntax to accomplish this?  The file is a
> standard unix flatfile.
 ...
> Craig

If that's all you want to do, you don't need Perl.  Just do:

    tr '\037' '\011' <infile >outfile

as a Unix command.  If you don't have Unix, you can do the same using
Perl with:

    #!/usr/bin/perl -w
    use strict;
    binmode STDIN;
    binmode STDOUT;
    while(read(STDIN,$_,8*2**10)){tr/\037/\011/;print}

running Perl with:

    progname.pl <infile >outfile

Using read to read the data prevents possible humongo lines in binary
data (assuming your data is binary).
-- 
Bob Walton


------------------------------

Date: Tue, 04 Jul 2000 20:04:51 GMT
From: "cam" <cam@home.com>
Subject: send variable from html to perl
Message-Id: <Drr85.19745$Zq.581403@news1.gvcl1.bc.home.com>

Hi:

I want to have an html document that sends a variale to a perl script....to
specify a place in an array on that perl script.

ex:

html file:
=======
<a href="/cgi-bin/gothere.pl?wow=0">page 1</a>
<a href="/cgi-bin/gothere.pl?wow=1">page 1</a>
<a href="/cgi-bin/gothere.pl?wow=2">page 2</a>
<a href="/cgi-bin/gothere.pl?wow=3">page 3</a>

perl file
======
#!/usr/bin/perl

print "Content-type: text/html\n\n";
use LWP::Simple;

@gothere = ("cam","bob","mary","louis" );
$wow;

print "@gothere[wow]\n";

--

I want the variable at the end of the HTML to grab the  specified place in
the array.......

any ideas?

Cam






------------------------------

Date: Wed, 05 Jul 2000 06:42:17 GMT
From: turnere@cc.wwu.edu
Subject: Re: send variable from html to perl
Message-Id: <8julc7$lf8$1@nnrp1.deja.com>

In article <Drr85.19745$Zq.581403@news1.gvcl1.bc.home.com>,
  "cam" <cam@home.com> wrote:
> Hi:
>
> I want to have an html document that sends a variale to a perl
script....to
> specify a place in an array on that perl script.
>
> ex:
>
> html file:
> =======
> <a href="/cgi-bin/gothere.pl?wow=0">page 1</a>
> <a href="/cgi-bin/gothere.pl?wow=1">page 1</a>
> <a href="/cgi-bin/gothere.pl?wow=2">page 2</a>
> <a href="/cgi-bin/gothere.pl?wow=3">page 3</a>
>
> perl file
> ======
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
> use LWP::Simple;
>
> @gothere = ("cam","bob","mary","louis" );
> $wow;
>
> print "@gothere[wow]\n";
>
> --
>
> I want the variable at the end of the HTML to grab the  specified
place in
> the array.......
>
> any ideas?
>
> Cam
>
>

I like the CGI module. Try this:

#!/usr/bin/perl
use CGI;
$query = new CGI;
$wow = $query->param('wow');
print $query->header();
print $query->start_html();
@gothere=("cam","bob","mary","louis");
print $gothere[$wow];
print $query->end_html();


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Mon, 3 Jul 2000 17:10:28 +0200
From: "Steven Van Poeck" <steven.van-poeck@SPAM.wanadoo.com>
Subject: Re: Sendmail, Perl and Windows
Message-Id: <8jqae2$r5g$1@wanadoo.fr>

There's a Perl module you can download from the Web as an PPM package, but I
can't lay my finger on it's name right now. Search on your favorite search
engine for "+SMTP +Perl +module +PPM" and I'm sure you'll find it.
Of course, you'll need a mail server as well. Unless you're on NT Server, I
guess you don't have one. You can find small free mailservers (good for
testing purposes) on http://www.Download.com or http://www.tucows.com when
searching on "mail server".

HTH,

Steven VAN POECK

bruce mcdougald <brucemcdougald@grocerybiz.com> a écrit dans le message :
3960a8ef$0$183@wodc7nh1.news.uu.net...
> Hi,
>
> I am learning perl on and have a script that reads data from a form and
then
> sends it to my email address.  The script example uses the unix sendmail
to
> send the data.  Is there an equivalent command in Windows or WinNT?
>
> Thanks.
>
>




------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3597
**************************************


home help back first fref pref prev next nref lref last post