[13801] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1211 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 28 12:05:33 1999

Date: Thu, 28 Oct 1999 09:05:15 -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: <941126714-v9-i1211@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 28 Oct 1999     Volume: 9 Number: 1211

Today's topics:
    Re: "1" end ? <gellyfish@gellyfish.com>
        "require" encourages non-portable code?? (Kirk Is)
        $50 for solution to this newsmf@bigfoot.com
    Re: $formdata=~s/\s+$//; ? boris_bass@my-deja.com
    Re: [off topic] What makes the web go? (Jon Bell)
    Re: adding data to beginning of file <lr@hpl.hp.com>
    Re: adding data to beginning of file <lr@hpl.hp.com>
    Re: Banner Rotation Theory (Benjamin Franz)
        CGI Fileupload using cgi-lib <Mats.Jansson@cern.ch>
    Re: Circular buffering <lr@hpl.hp.com>
    Re: Circular buffering (Bart Lateur)
        COM automation server in Perl? <viggiani@hotmail.com>
        Difference btw PerlDBD and DBD::Oracle srinvas@my-deja.com
    Re: EXECUTE <procname> with Oraperl <alla.gribov@metatel.com>
    Re: EXECUTE <procname> with Oraperl <alla.gribov@metatel.com>
    Re: How di I join a string together? (Clinton Pierce)
    Re: How di I join a string together? (Bart Lateur)
        How parse a,b,"x,y",c (Holger Marzen)
    Re: How to divide output records per page ? (Bill Moseley)
    Re: How to divide output records per page ? <sariq@texas.net>
        how to reformat a multiline string <yaoy@law.georgetown.edu>
    Re: HTML Table to Array? <kerry.allsup@eds.com>
    Re: HTML Table to Array? <hmarq@interaccess.com>
    Re: HTML::Parser (Tad McClellan)
    Re: Learn to do deja searches was [Re: Perl vs. REBOL] (Michael Houghton)
    Re: length (number of items) of an array (Greg Bacon)
    Re: linking to perl script to html page. <lee@insync.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 28 Oct 1999 15:28:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: "1" end ?
Message-Id: <38185d76_2@newsread3.dircon.co.uk>

ling <link@nowhere.org> wrote:
> Why most html page created using perl have an "1" character appear at the
> end of page ?

They dont.

> How to make it disappear ?
> 

Dont print it.

/J\
-- 
"The Tory Party is like a wonky shopping trolley - it pulls to the
left, it pulls to the right, but you just can't get it to go forward"
- John Prescott


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

Date: 28 Oct 1999 15:47:50 GMT
From: kisrael@andante.cs.tufts.edu (Kirk Is)
Subject: "require" encourages non-portable code??
Message-Id: <7v9r76$pb4$1@news3.tufts.edu>

I'm trying to get a good explanation for why "require" can't use the
"current script location" rather than the "current working directory" for
relative paths, and if there is some equivalent "include" command that
would allow my code to be moved from one directory to another without
breaking or forcing a ENV change.

Here's the situation, and it doesn't seem that uncommon to me:
I have a series of scripts in a directory.  For the sake of argument,
let's say that they are all in my ~/scripts directory, and that each
script depends on "common.perl" that's in that same directory to run.

Now, it's not enough to just put 
	require "common.perl";
in each file that needs it, because then I have to type 
	cd ~/scripts
	./script.perl
to run it (or have to change my ENV to include that directory)

It seems to me like it would be a good thing to have the script location
as part of the search path as well, not just the cwd.

This code 
0 =~ /^(.*\/).*?$/;
$scriptdir = $1;

require $scriptdir."run_common.perl";

seems to work, though is not extremely robust.

Is there a better way to make a directory of codependent scripts portable,
so that I could move the kit-and-kaboodle with impunity, without having to
redo my ENV or change the scripts themselves?


-- 
Kirk Israel - kisrael@cs.tufts.edu - http://www.alienbill.com
"It is absurd to divide people into good and bad.  
 People are either charming or tedious." --Oscar Wilde              


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

Date: Thu, 28 Oct 1999 13:12:48 GMT
From: newsmf@bigfoot.com
Subject: $50 for solution to this
Message-Id: <7v9i4d$pdk$1@nnrp1.deja.com>

Hello -
whoever solves this for me first will get a $50 check in the mail
(sorry I can't afford more).

Here's the question:

I'm having to send large html files (250 Kb and more) by email either
as attachments or so they can be viewed inline (within the receiving
mail program). I'm currently using the MIME::Lite module to accomplish
this.

Here's the problem: it seems that some lines in the text are getting
broken apart by randomly inserted carriage returns. The lines in
question come up with exclamation marks just before the carriage
return. This causes html to be displayed improperly and, worse, nasty
Javascript errrors if the inserted exclamation marks and carriage
returns fall inside an html page's  javascript code.

I read somewhere that this is caused by Sendmail only being able to
transfer text chunks of a certain size. I thought that I would have
fixed this by using MIME::LITE. But obviously not.


Below, please find my routines using MIME::Lite to give you an idea how
I've been doing this so far. Below that, you find an example of what
html looks like afer being sent (you'll see said exclamation marks in
it).
Cheers and thx a bunch,

Marc.

++

my current code:

$attachmentname = "qb".$timestamp.".html";


$SENDMAIL='/usr/sbin/sendmail';

if ($htmldelivery ne "on") {


   $msg = new MIME::Lite
                    From    =>'emailservice@quickbrowse.com',
                    To      =>"$email",
                    Subject =>"qb: $title",

        # Add parts (each "attach" has same arguments as "new"):

                    Type     =>'TEXT',
                    Data     =>"Your requested delivery
\"$title\l\"\n\n\n";
                # Attach a part:

        attach $msg Type     =>'text/html',
                    Disposition =>'inline',
                    Path     =>"/home/httpd/quickbrowse/tempfiles/
$tempoutput",
                    Filename =>"$attachmentname";
        $msg->send;


}
else {


       $msg = new MIME::Lite
                    From    =>'emailservice@quickbrowse.com',
                    To      =>"$email",
                    Subject =>"qb: $title",

        # Add parts (each "attach" has same arguments as "new"):

                    Type     =>'TEXT',
                    Data     =>"Your requested delivery
\"$title\l\"\n\n\n";
                # Attach a part:

        attach $msg Type     =>'text/html',
                    Disposition =>'attachment',
                    Path     =>"/home/httpd/quickbrowse/tempfiles/
$tempoutput",
                    Filename =>"$attachmentname";
        $msg->send;


} # end else

}


#########

html example:

         </TD></TR><TR VALIGN=TOP> >         <TD WIDTH=140
VALIGN=TOP>                                                <!--START
NESTED SEARCH AND SMALL ADS TABLE-->>    <TABLE WIDTH=133 BORDER="0"
CELLPADDING="0" CELLSPACING="0" BGCOLOR=#FFCC00>>         <!--START
SEARCH ROW-->>    <TR>             <TD WIDTH=1 VALIGN=TOP><img
SRC="http://www.redherring.com/resources/black.gif" HEIGHT=5
WIDTH=1></TD>         <TD VALIGN=TOP WIDTH=125><IMG
SRC="http://www.redherring.com/resources/black.gif" HEIGHT=1
WIDTH=125></TD>         <TD BGCOLOR=#FFFFFF><IMG
SRC="http://www.redherring.com/resources/shdw_tpcrnr.gif" HEIGHT=5
WIDTH=7></TD>     </TR>>    <TR>             <TD WIDTH=1
VALIGN=TOP><IMG SRC="http://www.redherring.com/resources/black.gif"
HEIGHT=45 WIDTH=1></TD>         <TD WIDTH=125 VALIGN=TOP
BGCOLOR=#FFCC00><IMG
SRC="http://www.redherring.com/resources/search_new.gif" ALIGN=LEFT
HEIGHT=9 WIDTH=111 HSPACE=5 VSPACE=0 ALT="Search"><BR><FORM METHOD=POST
ACTION="http://www.herring.c!
om/cgi-bin/asearch.cgi"><IMG
SRC="http://www.redherring.com/resources/blank.gif" WIDTH=5
HEIGHT=1><INPUT NAME="qt" SIZE="8" MAXLENGTH="50"><IMG
SRC="http://www.redherring.com/resources/blank.gif" WIDTH=5
HEIGHT=1><INPUT TYPE=IMAGE
SRC="http://www.redherring.com/resources/go_bt_2.gif" WIDTH="29"
HEIGHT="12" BORDER="0"></TD>         <TD BGCOLOR=#FFFFFF WIDTH=7
VALIGN=TOP><IMG SRC="http://www.redherring.com/resources/shdw_rt.gif"
HEIGHT=45 WIDTH=7></TD>     </FORM></TR>>    <TR>             <TD
WIDTH=1 VALIGN=TOP><IMG
SRC="http://www.redherring.com/resources/black.gif" HEIGHT=12
WIDTH=1></TD>         <TD VALIGN=TOP WIDTH=125 BGCOLOR=#FFCC00><IMG
src="http://www.redherring.com/resources/sponsoredbony.gif" WIDTH=125
HEIGHT=12></TD>         <TD ><IMG
SRC="http://www.redherring.com/resources/shdw_rt.gif" HEIGHT=12
WIDTH=7></TD>     </TR>>    <TR>>        <TD WIDTH=1 VALIGN=TOP><IMG
SRC="http://www.redherring.com/resources/black.gif" HEIGHT=60
WIDTH=1></TD>         <TD><!iframe delete!
d></TD>>        <TD BGCOLOR=#FFFFFF WIDTH=7 VALIGN=TOP><IMG
SRC="http://www.redherring.com/resources/shdw_rt.gif" HEIGHT=60
WIDTH=7></TD>     </TR>>    <TR>             <TD COLSPAN=3><IMG
SRC="http://www.redherring.com/resources/ad_shdwbtm.gif" HEIGHT=7
WIDTH=133></TD>     </TR>>     <!--CLOSE SEARCH ROW-->>
<TR>>                <TD COLSPAN=3><IMG
src="http://www.herring.com/resources/bg2.gif" HEIGHT=5 WIDTH=133
BORDER="0"></TD>         </TR>                 <!--START FIRST AD ROW--
>             <TR>             <TD WIDTH=1 VALIGN=TOP><img
src="http://www.herring.com/resources/black.gif" HEIGHT=5
WIDTH=1></TD>         <TD VALIGN=TOP WIDTH=125 ROWSPAN=2><img
src="http://www.herring.com/resources/black.gif" HEIGHT=1
WIDTH=125><BR><!--BEGIN AD CALL--><a
href="https://www.redherring.com/service/circ/subs_WA.html"
onClick="openWin
('https://www.redherring.com/service/circ/subs_WA.html');return
false;"><img src="http://www.herring.com/banners/promo_circ-
getahead.gif" W!
IDTH=125 HEIGHT=125 BORDER=0></a><!--CLOSE AD CALL--></TD>         <TD
BGCOLOR=#FFFFFF><img
src="http://www.herring.com/resources/shdw_tpcrnr.gif" HEIGHT=5
WIDTH=7></TD>     </TR>>        <TR>             <TD WIDTH=1
VALIGN=TOP><img src="http://www.herring.com/resources/black.gif"
HEIGHT=121 WIDTH=1></TD>         <TD BGCOLOR="#FFFFFF" WIDTH=7><img
src="http://www.herring.com/resources/shdw_rt.gif" HEIGHT=121
WIDTH=7></TD>     </TR>          <TR>             <TD COLSPAN=3><img
src="http://www.herring.com/resources/ad_shdwbtm.gif" HEIGHT=7
WIDTH=133></TD>>    </TR>>     <!--CLOSE FIRST AD ROW-->
<TR>>                <TD COLSPAN=3><img
src="http://www.herring.com/resources/bg2.gif" HEIGHT=5 WIDTH=133
BORDER="0"></TD>         </TR>                      <!--START SECOND AD
ROW-->       <TR>             <TD WIDTH=1 VALIGN=TOP><img
src="http://www.herring.com/resources/black.gif" HEIGHT=5
WIDTH=1></TD>>        <TD VALIGN=TOP WIDTH=125 ROWSPAN=2><img
src="http://www.her!
ring.com/resources/black.gif" HEIGHT=1 WIDTH=125><BR><!--BEGIN AD CALL--
><a  href="http://www.redherring.com/mag/issue70/news-fea-
entrepreneur.html?promo=promo_top10entrepreneur&id=redherring"
onClick="openWin('http://www.redherring.com/mag/issue70/news-fea-
entrepreneur.html?promo=promo_top10entrepreneur&id=redherring');return
false;"><img
src="http://www.herring.com/banners/promo_top10entrepreneur.gif"
WIDTH=125 HEIGHT=125 BORDER=0></a><!--CLOSE AD CALL--></TD>         <TD
BGCOLOR=#FFFFFF><img
src="http://www.herring.com/resources/shdw_tpcrnr.gif" HEIGHT=5
WIDTH=7></TD>     </TR>>    <TR>             <TD WIDTH=1
VALIGN=TOP><img src="http://www.herring.com/resources/black.gif"
HEIGHT=121 WIDTH=1></TD>         <TD BGCOLOR=#FFFFFF WIDTH=7><img
src="http://www.herring.com/resources/shdw_rt.gif" HEIGHT=121
WIDTH=7></TD>     </TR>>    <TR>             <TD COLSPAN=3><img
src="http://www.herring.com/resources/ad_shdwbtm.gif" HEIGHT=7
WIDTH=133></TD>     </TR>>    <!--CLOSE SECOND AD !
ROW-->           <TR>>                <TD COLSPAN=3><img
src="http://www.herring.com/resources/bg2.gif" HEIGHT=5 WIDTH=133
BORDER="0"></TD>         </TR>                   <!--START THIRD AD ROW-
->>   <TR>             <TD WIDTH=1 VALIGN=TOP><img
src="http://www.herring.com/resources/black.gif" HEIGHT=5
WIDTH=1></TD>         <TD VALIGN=TOP WIDTH=125 ROWSPAN=2><img
src="http://www.herring.com/resources/black.gif" HEIGHT=1
WIDTH=125><BR><!--BEGIN AD CALL--><a
href="http://www.redherring.com/cgi-bin/pci-query.pl?
promo=promo_cow102599&id=redherring" onClick="openWin
('http://www.redherring.com/cgi-bin/pci-query.pl?
promo=promo_cow102599&id=redherring');return false;"><img
src="http://www.herring.com/banners/promo_cow102599.gif" WIDTH=125
HEIGHT=125 BORDER=0></a><!--CLOSE AD CALL--></TD>         <TD
BGCOLOR=#FFFFFF><img
src="http://www.herring.com/resources/shdw_tpcrnr.gif" HEIGHT=5
WIDTH=7></TD>     </TR>>    <TR>             <TD WIDTH=1
VALIGN=TOP><img src="http://www.herring.com/r!
esources/black.gif" HEIGHT=121 WIDTH=1></TD>         <TD
BGCOLOR=#FFFFFF WIDTH=7><img
src="http://www.herring.com/resources/shdw_rt.gif" HEIGHT=121
WIDTH=7></TD>     </TR>>    <TR>             <TD COLSPAN=3><img
src="http://www.herring.com/resources/ad_shdwbtm.gif" HEIGHT=7
WIDTH=133></TD>     </TR>>    <!--CLOSE THIRD AD ROW-->>
<TR>>                <TD COLSPAN=3 BGCOLOR="#FFFFFF"><img
src="http://www.herring.com/resources/rounded_edge.gif" WIDTH="69"
HEIGHT="47" BORDER="0"></TD>         </TR>         </TABLE>>        <!--
CLOSE NESTED SEARCH AND SMALL ADS TABLE-->>                 <img
src="http://www.herring.com/resources/blank.gif" HEIGHT=1
WIDTH=133>>         </TD>



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


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

Date: Thu, 28 Oct 1999 15:18:56 GMT
From: boris_bass@my-deja.com
Subject: Re: $formdata=~s/\s+$//; ?
Message-Id: <7v9pgr$va9$1@nnrp1.deja.com>

I have a question on a closely related topic:

if I have a string with multiple newlines and I want to get
rid of all of them , should I use /s or /m modifier?

$mystringwithmanynewlines=~s/\s+$/m/

  or

$mystringwithmanynewlines=~s/\s+$/s/

What is the meaning of /s and /m modifiers, I could never figure
that out exactly?

Boris


In article <7v9et3$ql0$1@proxy2.fe.internet.bosch.de>,
  "Joachim Pimiskern" <Joachim.Pimiskern@de.bosch.com> wrote:
> Hello Yeong,
>
> >>What is "/\s+$//;" ?<<
>
> It means "Trailing spaces". $formdata =~ s/\s+$//; means "delete
trailing
> spaces".
>
> \s means any space, \s+ means space at least once, and $ means
> end of the string.
>
> Regards,
> Joachim
> (Joachim.Pimiskern@de.bosch.com)
>
>


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


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

Date: Thu, 28 Oct 1999 15:34:26 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: [off topic] What makes the web go?
Message-Id: <FKBKLE.GpJ@presby.edu>

 Kent Perrier  <kperrier@blkbox.com> wrote:
>Blue goo.

Rubber bands, paper clips and duct tape.

Gerbils spinning their exercise wheels.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
        [     Information about newsgroups for beginners:     ]            
        [ http://www.geocities.com/ResearchTriangle/Lab/6882/ ]


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

Date: Thu, 28 Oct 1999 07:48:35 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: adding data to beginning of file
Message-Id: <MPG.12820214ce859fef98a14b@nntp.hpl.hp.com>

In article <38182649.46A8B65C@gate.net> on Thu, 28 Oct 1999 06:32:41 -
0400, Aaron Walker <amwalker@gate.net> says...
> First of all, I have not read the Perl FAQ. I thought we were just supposed to
> read the comp.lang.perl.misc FAQ.

So now you know.  Or do you?

>                                     Anyways, so I headed over to section 5 of
> the Perl FAQ and checked out the appropriate section.  The way I am currently
> accomplishing this is follows: (no error checking for simplicity)
> --
> #!/usr/bin/perl -w
> 
> $datafile = "/www/cgi-bin/file.dat";
> 
> open(FILE, "$datafile");
> @data = <FILE>;
> close(FILE);

It had better not be too large a file, because there is it, all in mmory 
at once.

> open(FILE, ">$datafile");
> print FILE "Entry 1";

The system just crashed.  Hardware failure, or power failure, or 
whatever.  Oops, no more data!

> print FILE @data;
> close(FILE);
> -
> 
> Is this the wrong way to go about accomplishing this task?  It seems much
> easier (or at least, easier to read).

It is a much easier way to lose your data.  Read that FAQ again.

<Jeopardectomy>

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Oct 1999 07:56:52 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: adding data to beginning of file
Message-Id: <MPG.1282041046ccc29398a14c@nntp.hpl.hp.com>

In article <Pine.GSO.4.10.9910280845540.2694-100000@crusoe.crusoe.net> 
on Thu, 28 Oct 1999 08:52:19 -0400, Jeff Pinyan <jeffp@crusoe.net> 
says...
> On Oct 28, Govindaraj blah blah blah:

 ...

> Again, I would simplify this as:
> 
>   # note:  this is not a while loop, this is a naked block
>   {
>     local $/;
>     print OUTFILE <INFILE>:
>   }

I wouldn't simplify the loop that way, lest the file not fit into 
memory.

    print OUTFILE while <INFILE>;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Oct 1999 14:42:37 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Banner Rotation Theory
Message-Id: <xhZR3.1135$jn3.59351@typhoon01.swbell.net>

In article <slrn81fplk.66b.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Benjamin Franz (snowhare@long-lake.nihongo.org) wrote on MMCCXLVII
>September MCMXCIII in <URL:news:xJkR3.20$Ha7.2774@typhoon01.swbell.net>:
>"" In article <cukR3.1583$LR3.273227@news.shore.net>,
>"" Scratchie  <AgitatorsBand@yahoo.com> wrote:
>"" >
>"" >Am I missing something? Is there some reason why he can't just run a cron
>"" >job regularly to update the static HTML pages with new banners and links?
>"" 
>"" Because you have a race condition.
>"" 
>"" 1. User browses page with ad banner and is served banner-a
>"" 2. Server rotates to banner-b
>"" 3. User reads page
>"" 3. User clicks on banner-a with fixed link to ad-link script
>"" 4. ad-link script serves link to banner-b
>"" 5. User goes 'Huh?'
>
>
>Huh?
>
>Why on earth should clicking on banner-a bring you to the link to
>banner-b?  After you server the page to the customer, it's quite
>irrelevant if you update the page on the server.

That is part of the problem - the original poster indicated that 
he _isn't allowed to_. It's a restriction in the problem typical of 
third party banner systems. He needs a static chunk of HTML
of the general form
<a href="/cgi-bin/banner-link.cgi"><img src="/cgi-bin/banner-image.cgi"></a> 
and can't use SSI or other server-side dynamic generation to alter 
the code fragment to include a banner id on the fly.

This, of course, runs head on into synchronization issues with
the banner rotation scheme on the server since the HTML
fragment has no idea of the match up between image and link.
I suggested using cookies (which is the usual solution) but
he didn't like that either.

>The only stupid thing you could do is not update the HTML page,
>but update the image. But that wasn't suggested.

Actually, it _was_ suggested in the original question.

  Craig Vincent wrote:
    "Although SSI I feel would be the best alternative unfortunately 
     this script will be going I was specifically requested not to use 
     SSI in this project :("

(Static_HTML_code + banner_rotation - cookies) == pain_in_the_nether_regions

>Of course, banner ads are evils, and people putting up banner
>ads are the devils minions.

http://www.devilbunnies.org/irc-night/devilbunnies-large-banner.jpg

 >:)

-- 
Benjamin Franz


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

Date: Thu, 28 Oct 1999 14:43:26 +0200
From: Mats JANSSON <Mats.Jansson@cern.ch>
Subject: CGI Fileupload using cgi-lib
Message-Id: <381844EE.13E35F5@cern.ch>

Hi, 

I have a problem with uploading files using cgi-lib. 
My question is: How to control if the client send a file that doesn't
exists. The user might just put a singel character instead of the path
to a file. The cgi-lib always spool the file to disk even if it has 0
size. 

Best regards 
Mats


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

Date: Thu, 28 Oct 1999 07:30:22 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Circular buffering
Message-Id: <MPG.1281fddd28685d398a14a@nntp.hpl.hp.com>

In article <slrn81gh51.dv5.njc@dmc.uucp> on Thu, 28 Oct 1999 12:43:28 
GMT, Neil Cherry <njc@dmc.uucp> says...
> On 27 Oct 1999 22:49:38 -0700, Greg Andrews wrote:
> >ncherry@home.net writes:

 ...

> >>I see I have caused some confusion but I have gained further knowledge
> >>in the process. I was unaware of push/pull shift/unshift etc.

That's 'push/pop'.

 ...

> Just memory cells, usually one after another (a lifo). Which makes me
> think that I need to reread the books to get a better understnading of
> the pointers, arrays and the push/pull (etc) commands.

That's still 'push/pop'.

Shades of Dr. Doolittle.  :=)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Oct 1999 15:06:22 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Circular buffering
Message-Id: <381b659f.944710@news.skynet.be>

Neil Cherry wrote:

>What I meant by circular buffers is a fixed size array were a pointer
>points to the current position in the array to put new characters and
>a pointer that points to the last read character. I come from an
>assembly/C background and these are common in interrupt routines.

	my @array = ('A'..'H');
	my $pointer = 0;
	for my $i (1..50) {
	    print $array[$pointer];
	} continue {
	    $pointer++; $pointer %= 8;
	}

You can do
	
	$array[$pointer] = 'blah!';

too. So, what's the problem?

-- 
	Bart.


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

Date: Thu, 28 Oct 1999 16:57:29 +0200
From: Domenico Viggiani <viggiani@hotmail.com>
Subject: COM automation server in Perl?
Message-Id: <38186459.C7BCCFB4@hotmail.com>

Can I use COM automation server with Activestate Perl?
I'm not speaking about OLE but another kind of object (thanks Bill :-( )

Domenico Viggiani




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

Date: Thu, 28 Oct 1999 14:40:38 GMT
From: srinvas@my-deja.com
Subject: Difference btw PerlDBD and DBD::Oracle
Message-Id: <7v9n95$thc$1@nnrp1.deja.com>

Hello Guys,
I am a sqa engineer. I have been assigned two products PerlDBD and
DBD::Oracle  to test, I am done with DBD::Oracle but did not find any
info on PerlDBD on the net, I have a feeling that both are same. If any
guys know more info on PerlDBD and the place where I can download it
please let me know, my email is srinvas@hotmail.com.
thank you very much
Srinivas


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


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

Date: Thu, 28 Oct 1999 11:08:23 -0500
From: Alla Gribov <alla.gribov@metatel.com>
Subject: Re: EXECUTE <procname> with Oraperl
Message-Id: <381874F7.7FDC4CD3@metatel.com>

Try this:

  $stmt = $db->prepare(q{
    BEGIN	
	procedure_name(:param1, :param2);
    END;
  });

  $stmt->bind_param(":param1", $param1);
  $stmt->bind_param(":rapam2", $param2);

  $stmt->execute;


Alla Gribov

NetComrade wrote:
> 
> DOes anybody know how to EXECUTE procedures from ORAPERL?
> A piece of code would be nice....
> We had been experience a problem where the scripts simply exits
> 
> Thanx


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

Date: Thu, 28 Oct 1999 11:09:07 -0500
From: Alla Gribov <alla.gribov@metatel.com>
Subject: Re: EXECUTE <procname> with Oraperl
Message-Id: <38187523.443D9CD3@metatel.com>

Try this:

  $stmt = $db->prepare(q{
    BEGIN	
	procedure_name(:param1, :param2);
    END;
  });

  $stmt->bind_param(":param1", $param1);
  $stmt->bind_param(":rapam2", $param2);

  $stmt->execute;


Alla Gribov

NetComrade wrote:
> 
> DOes anybody know how to EXECUTE procedures from ORAPERL?
> A piece of code would be nice....
> We had been experience a problem where the scripts simply exits
> 
> Thanx


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

Date: Thu, 28 Oct 1999 14:25:02 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: How di I join a string together?
Message-Id: <381d5c05.1979067238@news.ford.com>

[poster cc'd in e-mail]

On Thu, 28 Oct 1999 15:52:24 +0200, Steven Filipowicz
<steven@*REMOVE*filipowicz.com> wrote:
>$FORM{'domain1'} = hello
>$FORM{'domain2'} = bye
>
>Now I want to join 'hello' and 'bye' together and put them in $hostname.
>Like hostname = 'hello' + 'bye'

ETOOMUCHJAVASCRIPT

The concatenation operator in Perl is ".", not "+".  

$hostname=$FORM{domain1} . $FORM{domain2};

or, simply use them together in a double-quoted string:

$hostname="$FORM{domain1}$FORM{domain2}";



-- 
   Clinton A. Pierce       "If you rush a Miracle Man, you
 clintp@geeksalad.org       get rotten Miracles."  -- Miracle Max,
http://www.geeksalad.org                       The Princess Bride


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

Date: Thu, 28 Oct 1999 15:01:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How di I join a string together?
Message-Id: <381a64ff.784933@news.skynet.be>

Steven Filipowicz wrote:

>I'm a webpage I have a form with 2 text fields. 1 called domain1 and the
>other domain2
>For example :
>
>$FORM{'domain1'} = hello
>$FORM{'domain2'} = bye
>
>Now I want to join 'hello' and 'bye' together and put them in $hostname.
>Like hostname = 'hello' + 'bye'

Er... "join"?

	$hostname = join '', 'hello', 'bye';
	print $hostname;

Otherwise, do "perldoc perlop" and search for ".".

-- 
	Bart.


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

Date: 28 Oct 1999 15:09:16 GMT
From: hm@sik-gmbh.de (Holger Marzen)
Subject: How parse a,b,"x,y",c
Message-Id: <7v9ous$7n$1@sally.sik-gmbh.de>

How can I split a line into words. The word separator is ,
However it can be part of words if they are surrounded with "

Any ideas?


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

Date: Thu, 28 Oct 1999 06:55:00 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: How to divide output records per page ?
Message-Id: <MPG.1281f58f5ec00aa5989821@nntp1.ba.best.com>

Yeong Mo/Director Hana co. (hmaster@factory.co.kr) seems to say...
> How to divide output records per page Like every search engine does ?
> What is the basic ?

I just print 20 at a time.

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Thu, 28 Oct 1999 10:26:08 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: How to divide output records per page ?
Message-Id: <38186B10.B870C063@texas.net>

"Yeong Mo/Director Hana co." wrote:
> 
> Hi,
> How to divide output records per page Like every search engine does ?
> What is the basic ?
> 
> Thanks in advance.

Randal did a Web Techniques column on this.

Check out:

http://web.stonehenge.com/merlyn/WebTechniques/

- Tom


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

Date: Thu, 28 Oct 1999 14:55:10 GMT
From: Yuan Yao <yaoy@law.georgetown.edu>
Subject: how to reformat a multiline string
Message-Id: <38186297.A52C541F@law.georgetown.edu>

I tried to convert the attached txt file to an html file by using the
following script.

while (<IN>) {
# GET RID OF NEW LINE CHARACTER
 chop;
# PRINT SUBJECT, WITHOUT LABEL
 if (/SUBJECT = /) {
  $x=$';
  $x=~ tr/a-z/A-Z/; #uppercase subject
  print OUT "<b>$x</b>\n";
  }
# PRINT TITLE, WITHOUT LABEL
 elsif (/TITLE = /) {
  $x=$';
  print OUT "<br>$x\n";
  }

>>>>>>>txt
SUBJECT = Administrative law -- Germany -- Rheinland--Palatinate --
History.
TITLE = 50 Jahre Verfassungs- und Verwaltungsgerichtsbarkeit in
Rheinland -
Pfalz : eine Chronik / herausgegeben von Karl-Friedrich Meyer ;
Redaktion:
Joachim Hennig.
IMPRINT = Frankfurt : Lang, 1997.
CALL # = KKC271 .F54 1997.
OCLC # = 40303464.

>>>>>html

ADMINISTRATIVE LAW -- GERMANY -- RHEINLAND--PALATINATE -- History.
50 Jahre Verfassungs- und Verwaltungsgerichtsbarkeit in Rheinland -
Pfalz : eine Chronik / herausgegeben von Karl-Friedrich Meyer ;
Redaktion:
Joachim Hennig.
Frankfurt : Lang, 1997.
KKC271 .F54 1997. Click here to view the Full catalog record.
>>>>>>>>>>>>>>>>>>>>>

However, the carriage return in the subject field in the txt file cause
problem.  The $' postmatch variable only contains the string up to the
first line so I could not reformat the whole SUBJECT field (the word
"History" wasn't capitalized and bolded)

I tried some scripts in perl faq (extracting a range of lines, matching
more than one line, etc.) but none seems to work the way I desire.

Any suggestions?

Thanks in advance.

Yuan Yao




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

Date: Thu, 28 Oct 1999 10:38:04 -0400
From: Kerry Allsup <kerry.allsup@eds.com>
Subject: Re: HTML Table to Array?
Message-Id: <38185FCC.BEEEDEB4@eds.com>



Hank Marquardt wrote:
> 
> Is there a function/module that takes a html file, looks for tables and then
> will return an array of values based on individual rows/cell contents?  I
> started to write code in my head, decided it was non-trivial and thought I'd
> see if it had been done already?
> 
> Any ideas/pointers?
> 
> Hank

*delurking*

I found that for my limited needs, it was easier to open a pipe from
lynx, ie:

open (NOSPWEB, "/usr/local/bin/lynx -dump -width 300 -force_html $name
|") 
	or die "couldn't spawn lynx $! $?\n\n";

where $name is the webpage in question, and then parse the output as a
normal file.   YMMV.  With some fiddling, this approach works on Windows
also.


Kerry Allsup


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

Date: Thu, 28 Oct 1999 10:30:26 -0500
From: "Hank Marquardt" <hmarq@interaccess.com>
Subject: Re: HTML Table to Array?
Message-Id: <s1gr8hr1r0862@corp.supernews.com>

Thanks Tom,

I found that already .... I was being lazy <- a programmer is supposed to do
that, right?;)

Guess I'll have to write the code anyway.

This is probably heresy in this group given the number of *NIX folks around,
but I solved the immediate need by opening the html file in MS Excel 2000
and Excel did all the work for me.   Still I'll need to do this again in an
automated fashion so I'm not out of the coding woods.


Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.9910271946140.29843-100000@user2.teleport.com...
> On Wed, 27 Oct 1999, Hank Marquardt wrote:
>
> > Is there a function/module that takes a html file, looks for tables
> > and then will return an array of values based on individual rows/cell
> > contents?
>
> Sure there is. But maybe no one has written it yet. :-)
>
> But start with HTML::Parser from CPAN. Good luck!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Thu, 28 Oct 1999 04:47:10 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: HTML::Parser
Message-Id: <ei29v7.6of.ln@magna.metronet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote:
: David Cassell <cassell@mail.cor.epa.gov> wrote:
: > Tom Phoenix wrote:
: >> 
: >> Perlite?
: > 
: > Sure.  I've been using the term here for nearly a year, and
: > it still hasn't caught on.  Goes with 'Perlish', don't you think?
: > 

: I thought that is was a substance that was harmful to Perl programmers.
                                             ^^^^^^^


   unless it was shielded with lead.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 28 Oct 1999 11:00:31 -0400
From: herveus@Radix.Net (Michael Houghton)
Subject: Re: Learn to do deja searches was [Re: Perl vs. REBOL]
Message-Id: <7v9oef$pei$1@saltmine.radix.net>

Howdy!

In article <7v01f4$nhn$1@murdoch.acc.Virginia.EDU>,
Billy Zhao <bz9t@yahoo.com> wrote:
>What he said was close, but with a lot of unnecessary condescension.
>
                                           ^^^^^^^^^^^
If your request were one of the first dozen or so that had every 
appearance of asking the group to do your homework for you, you
might be able to make a case for "unnecessary". Constructive
criticism has been offered and apparently rejected.

yours,
Michael
-- 
Michael and MJ Houghton   | Herveus d'Ormonde and Megan O'Donnelly
herveus@radix.net         | White Wolf and the Phoenix
Bowie, MD, USA            | Tablet and Inkle bands, and other stuff
                          | http://www.radix.net/~herveus/


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

Date: 28 Oct 1999 14:40:09 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: length (number of items) of an array
Message-Id: <7v9n89$1pm$1@info2.uah.edu>

In article <3816E60E.1EAD5366@inx.de>,
	Daniel Krajzewicz <krajzewicz@inx.de> writes:

: How do I get the number of items (the length of) an array ?

    sub items {
        return 0 if $#_ == -1;

        shift;
        return 1 + &items;
    }

    my @array = qw( foo bar baz );
    print "number of items in \@array is ", items(@array), "\n";

Hope this helps,
Greg
-- 
Now let us retract the foreskin of misconception and apply the wire brush of
enlightenment. 
    -- Geoff Miller 


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

Date: Thu, 28 Oct 1999 09:58:50 -0500
From: "Lee Sharp" <lee@insync.net>
Subject: Re: linking to perl script to html page.
Message-Id: <KwZR3.10794$Ph7.73512@insync>

Abigail wrote in message ...
|Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCCXLVIII
|September MCMXCIII in <URL:news:38177775.E4DEE683@ccrs.nrcanDOTgc.ca>:

|!! I want to make an existing html page a derived-cgi page, however, I
|!! don't want people to update their links / bookmarks.

|!! The page lies at localhost:/http/docs/index.html

|!! I would like the address to stay the same, but for the file to point at:

|!! localhost:/http/cgi-bin/index.pl

|!! ..without a redirect, without the user knowing.

|!! Can this be done?

|Of course. But, unless you are writing a server in Perl, what has
|this to do with Perl?

   Lord people...  The hostility...  :-)  To a new user, it has a lot to do
with Perl.  Just slapping them down, while fun, doesn't help.  Look at this
thread...  One moderately off topic post, 2 flames, and an unclear <to a
newbie> suggestion that was just as off topic.  Actually, every post in this
thread is off topic, unless the charter now is Perl discussion and flames.
:-)  The quickest way to stop the off topic is to link them on out.  In this
case...

   "That depends on what web server you are running.  This is a server
issue, and it depends on that.  I recommend searching www.deja.com for "SSI
and CGI" or "Server Side Includes and CGI" as well as discussion lists for
your web server.  Good luck."

   Now he has places to go that won't bother us, and he won't hate Perl.
Admittedly, there are a lot of annoying newbies, and this takes time.  But a
flame takes time, and breeds ill will.  That ill will is why I have to hide
perl scripts from the "guys in the ties" upstairs. :-)  If you don't want to
help, at least try not to hurt.  Now excuse me while I get into this
asbestos suit. ;-)

            Lee

--
SCSI is *NOT* magic. There are *fundamental technical reasons* why it is
necessary to sacrifice a young goat to your SCSI chain now and then. * Black
holes are where God divided by zero. - I am speaking as an individual, not
as a representative of any company, organization or other entity.  I am
solely responsible for my words.





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

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 1211
**************************************


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