[12855] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 265 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 26 20:07:18 1999

Date: Mon, 26 Jul 1999 17:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 26 Jul 1999     Volume: 9 Number: 265

Today's topics:
    Re: Accessing Oracle through Perl, win32 dzuy@my-deja.com
    Re: C & Perl... <belliott@buyitnow.com>
    Re: FAQ 8.45: How do I install a module from CPAN? (Bruce R Miller)
    Re: First script -- extracting part of a text file (Larry Rosler)
    Re: First script -- extracting part of a text file <gt7202e@prism.gatech.edu>
    Re: FormMail Year 2000 problem (I R A Darth Aggie)
    Re: FormMail Year 2000 problem (I R A Darth Aggie)
        How can I develop WinNT service program? (326899\)
    Re: HTML::Parser sample <afs@cape.com>
        I need fast help <thetaworld@magikomik.de>
    Re: LONG: Object oriented approach in perl <tchrist@mox.perl.com>
        newbie question: system ()/error message spicastretford@my-deja.com
        Perl API for mSQL Install error <jdmillr@cc.umanitoba.ca>
    Re: Perl API for mSQL Install error (Larry Rosler)
        Perl still doesnt work <thetaworld@magikomik.de>
        perl to interpret a XLS file? skao@my-deja.com
    Re: reg expression <llornkcor@llornkcor.com>
    Re: Regex-ing <emschwar@rmi.net>
    Re: Replacing and Stripping HTML (Abigail)
    Re: Server 500 error? <Stuart@worm.globalnet.co.uk>
    Re: Server 500 error? <kperrier@blkbox.com>
    Re: Server 500 error? <flavell@mail.cern.ch>
    Re: stopping email overflow on failure (Matthew Bafford)
    Re: stopping email overflow on failure <emschwar@rmi.net>
    Re: stopping email overflow on failure (Abigail)
    Re: stopping email overflow on failure <laurens@bsquare.com>
    Re: Text File Busy (errno = 26) (Abigail)
    Re: Won't read from STDIN inside html tags (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 26 Jul 1999 23:13:01 GMT
From: dzuy@my-deja.com
Subject: Re: Accessing Oracle through Perl, win32
Message-Id: <7niq1o$53r$1@nnrp1.deja.com>

In article <7mivkj$sud$1@nnrp1.deja.com>,
  mmixon@primacis.com wrote:
> I'm having trouble accessing Oracle running the
> simplest of scripts on a fresh installation.  I'm
> using win32.
>
> I'm using:
>    ActiveState Perl, build 518.
>    DBD::ORACLE (DBD-Oracle.zip, ppm module)
>
> To make things simple, I started with a fresh machine
> and installed Perl first followed by DBD::ORACLE.  The
> installation went smoothly.
>
> Then I ran this short script:
>
> use DBI;
> $dbh = DBI->connect('dbi:Oracle:MYTNS','TUCAN','SAM');
> $dbh = DBI->prepare('SELECT lastname FROM PERSON');
> $dbh = DBI->execute();
> while ( @row = $dbh->fetchrow_array ) {
>    print "@row\n";
> }
>
> These are the errors I got:
> Variable "%CreateKey_Opts" is not imported at
>    C:/Perl/site/lib/Win32/TieRegistry.pm line 1482.
> Global symbol "%CreateKey_Opts" requires explicit
>    package name at
>    C:/Perl/site/lib/Win32/TieRegistry.pm line 1482.
>                         :
>    <Snipped several Global symbol errors as above>
>                         :
> Can't locate auto/DBI/prepare.al in @INC
>    (@INC contains: C:/Perl/lib C:/Perl/site/lib .)
>    at ora7.pl line 3
>
> So, in spite of the 'Variable' and 'Global symbol'
> errors, it looks like it connected to the database
> only to fail on the prepare statement.
>
> Any ideas?
> TIA
> Marlin Mixon
>
> Everything that can be counted doesn't necessarily count;
> everything that counts can't necessarily be counted. (Einstein)
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
There are a couple of bugs in TieRegistry.  Change line 1482 from

use vars ( @CreateKey_Opts %CreateKey_Opts, %_KeyDispNames);

to

use vars( @CreateKey_Opts %CreateKey_Opts %_KeyDispNames);

and line ~1535 from

if( ! ref($$result) ) && $self->DualTypes ) {

to

if( ! ref($$result) && $self->DualTypes ) {

Good Luck.

Dzuy


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 26 Jul 1999 16:35:43 -0500
From: Brian Elliott <belliott@buyitnow.com>
Subject: Re: C & Perl...
Message-Id: <379CD4AF.1E652DFD@buyitnow.com>

Use SWIG: http://www.swig.org.

Brian
--
Brian Elliott
New Product Development
BuyItNow.com, L.L.C
belliott@buyitnow.com
http://www.buyitnow.com
719-487-1437
719-440-1880 (cell)



Zeqing Xia wrote:

> Use Perl XS language you can do that easily in most cases. However
> the docs (perlxs, perlxstut) are in my view a bit difficult to
> comprehend. But once you get over it's mostly piece of cake.
>
> ZQX
>
> In article <3793F33F.CC9E4BF3@home.com>, Joan Richards  <richj@home.com> wrote:
> >> references to how to use the h2p stuff online?
> >>
> >> mitch
> >
> >hehe, i sent this from my sisters account...ooops.  my name is mitch
> >though.
> >






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

Date: 26 Jul 1999 22:57:18 GMT
From: miller@altaira.cam.nist.gov (Bruce R Miller)
Subject: Re: FAQ 8.45: How do I install a module from CPAN?
Message-Id: <7nip4e$dog$1@news.nist.gov>

In article <379CC1A6.CBA6EF1@venice.cas.utk.edu>,
	toby <toby@venice.cas.utk.edu> writes:
>>
>>
>> Or am I missing some clever alternative here?
>> thanks
>>
>> --
>> --
>> bruce.miller@nist.gov
>> http://math.nist.gov/~BMiller/
> 
> As I was throughly corrected by tom just recently, let me let you in on a
> not-so-secret :-).
> 
> shell>perl Makefile.PL LIB=~/lib

Thanks, I wasn't aware of the LIB option for make...
But, can you pass the same option  in to CPAN?

[The whole point was how much more convenient CPAN is than
make, make test, make install.... particularly for a long set of packages
that could install unattended.]
And, I kinda wanted to avoid having to "use lib ..." by puttin them in
a standard place ... typically owned by root (or  maybe by camel :> )

Thanks, though,  LIB's a good trick to know too.

--
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/


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

Date: Mon, 26 Jul 1999 15:42:05 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: First script -- extracting part of a text file
Message-Id: <MPG.1206841689b803ea989d4b@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <Pine.GHP.4.10.9907261357060.22041-
100000@rodolfo.ECE.ORST.EDU> on Mon, 26 Jul 1999 14:25:56 -0700, Jeff 
Bender <bender@ece.orst.edu> says...
> 
> Hi,
> 
> I've just created my very first Perl script, which:
> 
> 1.  scans an output file (given at CL) for a line which indicates the
> start of data;
> 2.  skips four lines of headings etc.;
> 3.  prints the contents of the next lines, removing multiple spaces, until
> 4.  it stops when it finds a 'y' as the first character in the line, and
> 5.  looks for more data.
> 
> The script included below does this just fine, and is actually a bit
> faster than an Awk script I've been using for a couple years.  But, I
> can't help thinking there are some better ways to do things:
> 
> 1.  Is there a better way to skip lines (eg "skip=" in Awk)?  The four
> '$in=' lines work, but look kind of ugly.

    <> for 1 .. 4; # Not too ugly, I hope.

> 2.  There must be a more attractive way to search for the start of the
> data and then actually extract the data than using the nested 'while (<>)'
> statements..

There is.  You could set up that string as the 'input record separator' 
$/, read one 'record' and go on.  You can find this in perlvar.

> 3.  Any other comments?  I've used what I could from Lemay's "Teach
> Yourself Perl in 21 Days" book and read the FAQ's on www.perl.com without
> finding anything that jumped out at me which would make this better.
> Unfortunately, all ~10 Perl books at our uni library are checked out or
> missing too :)  Eventually, though, I want to expand this script to take
> the data, do some transformations on it, cut some of the unneeded data
> lines (only about 10% of it is interesting; the rest should be thrown away
> to save disk space), and send it to gnuplot for plotting in a presentable
> form -- so I'd appreciate any help in getting this basic foundation part
> in a nice form.
> 
> Script:
> 
> #!/usr/local/bin/perl -w
> use strict;

You are off to an excellent start with those two lines!  If you found 
them in that book, my respect for it goes up a lot.  Otherwise, my 
respect for you.  :-)
 
> my $in = '';

Not needed, because you don't need to store the lines that you skip.

> while (<>) {
>         if ( /^  \*{6}  transient analysis/o) {

To avoid too many indented blocks, use 'next' (see below).  Your 
physical indents are way too deep in any case.  `perldoc perlstyle` says 
that Larry Wall uses four spaces.  The /o suffix isn't needed, because 
there is no interpolation into the regex.

>                 $in = <>;
>                 $in = <>;
>                 $in = <>;
>                 $in = <>;

Just eat them up, while counting to four (see below).

>                 TWO: while (<>) {
>                         if ( /^y/ ) {
>                                 last TWO;
>                         }
>                         else {

See above about indented blocks.  This time, it's 'last'.

>                                 s/[ \t\r\f]+/ /go;

For manipulations of individual characters out of context, thr 'tr' 
(translate) operator is tons faster than the 's' (substitute) operator.

>                                 print;
>                         }
>                 }
>         }
> }

First approach (line at a time):

while (<>) {
    next unless /^  \*{6}  transient analysis/;
    <> for 1 .. 4;
    while (<>) {
        last if /^y/;
        y/ \t\r\f/ /s;
        print;
    }
}

Second approach (record at a time):

{ local $/ = "\n  ******  transient analysis";
    <>; # Ditch all the stuff before the first marker.
    while (<>) { # Read until the next marker (if any).
       s/(.*\n){5}//; # Ditch the leading stuff.
       s/^y.*//ms;    # Ditch the trailing stuff.
       y/ \t\r\f/ /s;
       print;
    }
}

 ...

> Thanks in advance!

You're welcome.  You have demonstrated that a thoughtful programmer's 
first significant program can actually be quite acceptable. 

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


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

Date: Mon, 26 Jul 1999 18:56:25 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: First script -- extracting part of a text file
Message-Id: <379CE799.8C908A54@prism.gatech.edu>

Jeff Bender wrote:
> .. Eventually, though, I want to expand this script to take
> the data, do some transformations on it, cut some of the unneeded data
> lines (only about 10% of it is interesting; the rest should be thrown away
> to save disk space), and send it to gnuplot for plotting in a presentable
> form -- so I'd appreciate any help in getting this basic foundation part
> in a nice form.


while(<>) {
	next unless /^x/../^y/ and /\d\./;
	print;  # or whatever
}

This assumes your headers (time,vapp,etc) don't contain a digit followed
by a dot.

I recommend getting "Programming Perl" and "Perl Cookbook", both
published by O'Reilly.  :)





-- 
 andy barfoot


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

Date: 26 Jul 1999 23:32:41 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: FormMail Year 2000 problem
Message-Id: <slrn7pps4t.80l.fl_aggie@thepentagon.com>

On Mon, 26 Jul 1999 17:21:26 -0400, toby <toby@venice.cas.utk.edu>, in
<379CD156.D16B58E7@venice.cas.utk.edu> wrote:

+ > I think I'm going to take a stab at fixing formmail...tho the copyright
+ > may well induce me not to...

+ You will rewrite the entire friggin' thing

All too true.

James


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

Date: 26 Jul 1999 23:47:21 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: FormMail Year 2000 problem
Message-Id: <slrn7ppt0e.80l.fl_aggie@thepentagon.com>

On Mon, 26 Jul 1999 21:44:06 GMT, Alan Curry <pacman@defiant.cqc.com>, in
<GE4n3.112$m83.3047@news3.ispnews.com> wrote:

+ In article <slrn7ppjmn.7gq.fl_aggie@thepentagon.com>,
+ I R A Darth Aggie <fl_aggie@thepentagon.com> wrote:

+ >I think I'm going to take a stab at fixing formmail...tho the copyright
+ >may well induce me not to...

D*mn, I'm better connected than I think. Obviously my cancel didn't
get there in time... ;) v1.6 of formmail seems to be OK.

+ I've inherited some FormMail users, so I'd be interested in a replacement
+ that does not suck...It'll probably be at least a few days.

Yah, this is going on my 'round-tu-it' list. I would suggest a few
modules, tho:

use Mail::Mailer;
use CGI;

I'm open to suggestions regarding the mail API. IMHO, I think the easiest
solution is to bypass the local MTA and talk directly to the localized
SMTP server.

James


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

Date: Tue, 27 Jul 1999 07:58:28 +0900
From: "Park, Jong-Pork \(326899\)" <okpolis@okpolis.joo.net>
Subject: How can I develop WinNT service program?
Message-Id: <eozjpq71#GA.53@news.thrunet.com>

Hello.

What modules that I need to develop for WinNT service with ActiveState Perl?

I think PerlApp is great and it was long waitted for to release. But so big EXE file size when I trying to build with -freestanding
option. So, I will develop major WinNT service with -freestanding and minor connecting cgi program for it.

Thank you.





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

Date: Mon, 26 Jul 1999 19:40:02 -0400
From: Anthony Sadera <afs@cape.com>
Subject: Re: HTML::Parser sample
Message-Id: <379CF1D2.ACE0CE5D@cape.com>

Try something like this:

sub JustWhatIWant {
	my $incomingtag = shift;
	if (lc($incomingtag) =~ /^<\/*(b|i|font|a)[^\w>]*[^>]*>$/) {
		return $incomingtag;
	} else {
		return "";
	}
}

 ...

$myhtml =~ s/(<[^>]*>)/&JustWhatIWant($1)/eg;

Kin Lum wrote:
> 
> to use HTML::Parser, shouldn't the following code work?
> it seems that the method cannot be overridden...
> 
> #!/usr/local/bin/perl
> 
> require HTML::Parser;
> $p = HTML::Parser->new;
> 
> $p->parse("<b>hi</b><i><bbb>");
> $p->eof;
> 
> sub start {
>     print join(" ", @_), "\n";
> }
> 
> Kin Lum wrote:
> >
> > using HTML::Parser is fine.  but for such a simple task,
> > using it would be an overkill.  can it be done in 2, 3 lines
> > in Perl?
> >
> > Abigail wrote:
> > >
> > > Kin Lum (kin@0011.com) wrote on MMCLIV September MCMXCIII in
> > > <URL:news:379BA0E4.6A7A5127@0011.com>:
> > > {} can you easily kill all tags except the ones you want to keep:
> > > {}   <b>  <i>  <font  >  <a   >
> > >
> > > If you have simplistic HTML (the kind most browser can understand)
> > > you can use the horribly misnamed 'HTML::Parser' module.
> > >
> > > {} # now kill all tags
> > > {} s/<.*?>//g;
> > >
> > > This is too stupid to take seriously.  Please read the FAQ.
> > >
> > > Abigail
> > > --
> > > perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
> > > 0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
> > > =>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
> > > !$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
> > >
> > >   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
> > >    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> > > ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----

-- 
-----------------------------------------------
                                 Anthony Sadera
                          mailto:afs@sadera.com


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

Date: Tue, 27 Jul 1999 01:27:18 +0200
From: "Marko Cehaja" <thetaworld@magikomik.de>
Subject: I need fast help
Message-Id: <7niqsc$mg1$1@news.online.de>

I have PWS and Perl installed. Perl and PWS works both well, instead that
Perl cannot write onto the file. Here is the sample program that doesnt
work. I need fast help for that, as this program doesnt create any file, nor
shows any error:

#eval 'exec /usr/bin/perl -S -W -D $0 ${1+"$@"}'
# if $running_under_some_shell;

print"Testing screen output";

open(MY,"FILETST");
print MY "Testing file output\n";
close (MY);






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

Date: 26 Jul 1999 16:55:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: LONG: Object oriented approach in perl
Message-Id: <379ce76d@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Dermot Musgrove <dermot.musgrove@virgin.net> writes:
:Dear all, especially perl hackers,

You might look at the new perltootc manpage.  These days, I like assigning
closures to generate methods much more than AUTOLOAD().

--tom
-- 
   "Any technology distinguishable from magic is insufficiently advanced."


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

Date: Mon, 26 Jul 1999 22:42:14 GMT
From: spicastretford@my-deja.com
Subject: newbie question: system ()/error message
Message-Id: <7nio85$3uk$1@nnrp1.deja.com>

Hello,

I am trying to run a program with the system () function. My problem is
that after the program finishes (it correctly runs), I get this error
message that I don't understand:

Can't run CMMainSuite.s: The data area passed to a system call is too
small. , stopped at C:\dev\qa\ui\CAMPAI~1\AUTOTE~1.PL line 28, <STDIN>
chunk 1.

Here is the pertinent code:

#!/usr/bin/perl -w

# Variables:
 ....<snipped the variables>...

# Run the master test suite
print "\nRunning the CMMainSuite.s .... \n";
sleep 1;
@args = ("partner", "-q", "-resexport", "-r", "CMMainSuite.s");
system (@args) || die "Can't run CMMainSuite.s: $!, stopped";

print "Done.\n\n";

It never gets to print "Done.\n\n". What does the error message mean? I
looked at the error message list in the perl docs and couldn't find it.

Thanks in advance,
Spica


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 26 Jul 1999 17:02:20 -0500
From: Janice Miller <jdmillr@cc.umanitoba.ca>
Subject: Perl API for mSQL Install error
Message-Id: <379CDAEC.4AE086AC@cc.umanitoba.ca>


--------------F26CBA9BB8C0796887382351
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I have been trying to upgrade the MsqlPerl API. ( I have been told that
this is necessary since Perl has been upgraded.  The Perl scripts no
longer work with the new version of Perl.  Upgrade was from v. 5.004.01
to v. 5.005.02.)  Anyway I downloaded what I think is the latest version
of the API  (Msql-Mysql-modules-1.2201.tar.gz ) from the
website:http://www.perl.com/CPAN/modules/by-module/Msql/
I have followed the instructions in the file "What to do once you've
downloaded a module from the CPAN" at URL
http://18.85.40.23/INSTALL.html.
I am on a Unix machine and I get through the instructions A and B ok,
but when I build(instruction C) I get the following error.

I type perl Makefile.PL

Error:

Warning: prerequisite DBI 1.08 not found at (eval 9) line 226, <STDIN>
chunk2.
Warning:  prerequisite Data::ShowTable 0 not found at (eval 9) line 226,
<STDIN> chunk2.
Warning from evaluation for /local/..local dir
here../MsqlPerl/mSQL/Makefile.PL: Can't locate DBI/DBD.m in @INC (@INC
contains: lib /usr/local...more local directories...) at (eval 28 ) line
6.
Begin failed--complilation aborted at (eval 28 ) line 6.
Writing Makefile for Msql-Mysql-modules

Does anyone know what this message means.  It seems to me that I need
another file here?

-Jan


--------------F26CBA9BB8C0796887382351
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I have been trying to upgrade the MsqlPerl API. ( I have been told that
this is necessary since Perl has been upgraded.&nbsp; The Perl scripts
no longer work with the new version of Perl.&nbsp; Upgrade was from v.
5.004.01 to v. 5.005.02.)&nbsp; Anyway I downloaded what I think is the
latest version of the API&nbsp; (Msql-Mysql-modules-1.2201.tar.gz ) from
the website:<a href="http://www.perl.com/CPAN/modules/by-module/Msql/">http://www.perl.com/CPAN/modules/by-module/Msql/</a>
<br>I have followed the instructions in the file "What to do once you've
downloaded a module from the CPAN" at URL <a href="http://18.85.40.23/INSTALL.html">http://18.85.40.23/INSTALL.html.</a>
<br>I am on a Unix machine and I get through the instructions A and B ok,
but when I build(instruction C) I get the following error.
<p>I type <i>perl Makefile.PL</i><i></i>
<p>Error:
<p>Warning: prerequisite DBI 1.08 not found at (eval 9) line 226, &lt;STDIN>
chunk2.
<br>Warning:&nbsp; prerequisite <A HREF="Data::ShowTable">Data::ShowTable</A> 0 not found at (eval 9)
line 226, &lt;STDIN> chunk2.
<br>Warning from evaluation for /local/..<i>local dir here</i>../MsqlPerl/mSQL/Makefile.PL:
Can't locate DBI/DBD.m in @INC (@INC contains: lib /usr/local...<i>more
local directories...</i>) at (eval 28 ) line 6.
<br>Begin failed--complilation aborted at (eval 28 ) line 6.
<br>Writing Makefile for Msql-Mysql-modules
<p>Does anyone know what this message means.&nbsp; It seems to me that
I need another file here?
<p>-Jan
<br>&nbsp;</html>

--------------F26CBA9BB8C0796887382351--



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

Date: Mon, 26 Jul 1999 15:55:33 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl API for mSQL Install error
Message-Id: <MPG.12068744fa425d66989d4c@nntp.hpl.hp.com>

In article <379CDAEC.4AE086AC@cc.umanitoba.ca> on Mon, 26 Jul 1999 
17:02:20 -0500, Janice Miller <jdmillr@cc.umanitoba.ca> says...
 ...
> Warning:  prerequisite Data::ShowTable 0 not found at (eval 9) line 226,
> <STDIN> chunk2.
> Warning from evaluation for /local/..local dir
> here../MsqlPerl/mSQL/Makefile.PL: Can't locate DBI/DBD.m in @INC (@INC
> contains: lib /usr/local...more local directories...) at (eval 28 ) line
> 6.
> Begin failed--complilation aborted at (eval 28 ) line 6.
> Writing Makefile for Msql-Mysql-modules
> 
> Does anyone know what this message means.  It seems to me that I need
> another file here?

As it says:  Install Data-ShowTable-3.3 from CPAN first.

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


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

Date: Tue, 27 Jul 1999 01:37:55 +0200
From: "Marko Cehaja" <thetaworld@magikomik.de>
Subject: Perl still doesnt work
Message-Id: <7nirg8$mnm$1@news.online.de>

I have PWS and Perl installed. Perl and PWS works both well, instead that
Perl cannot write onto the file. Here is the sample program that doesnt
work. I need fast help for that, as this program doesnt create any file, nor
shows any error:

#eval 'exec /usr/bin/perl -S -W -D $0 ${1+"$@"}'
# if $running_under_some_shell;

print"Testing screen output";

open(MY,"FILETST");
print MY "Testing file output\n";
close (MY);








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

Date: Mon, 26 Jul 1999 22:52:45 GMT
From: skao@my-deja.com
Subject: perl to interpret a XLS file?
Message-Id: <7niorr$4b0$1@nnrp1.deja.com>

The following task has been posed to me:

They want the ability to extract certain graphs from an Excel Spreadheet
and saved to gif files.  Catch though, this must be performed on the web
server, instead of by the user on her native system (probably Windows
95).  This would seem to be an extremely hairy task, if it could be
done.  I would have to interpret the excel spreadsheet, first of all.
After that is done, I would have to determine which objects to extract,
and then somehow convert it to an acceptable file format
(gif/jpg/etc...).  Does anyone have any opinions/suggestions on how this
could be accomplished?

Are there currently any Perl scripts that would point me in the right
direction?  Or even something written in Java/C++/or existing unix
utilities?

Thanks.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 26 Jul 1999 17:17:56 -0600
From: "llornkcor" <llornkcor@llornkcor.com>
Subject: Re: reg expression
Message-Id: <7niq9i$fbi$1@oak.prod.itd.earthlink.net>

    I don't think that this exact question IS asked several times a day,
yes, I have seen similar ones. If  you have a problem with answering these
newbie questions, why even take the time to read, and post , and with
insults?   You probably do know more about perl programming than I ( hence
this discussion) , but I know more about recording audio and video and
techniques involved with each. and if YOU were to want to learn recording
audio, and asked a question, that I would find stupid, or have seen/heard
several time, I wouldn't insult you. I would either ignore the question, or
answer it. In fact, I have done this in different groups.
    I have read the FAQ (s), and am struggling with regexs. Asking my stupid
questions on a newsgroup , is NOT my first line of defense. If I offended
you with asking such a simple question, I am sorry. I was only seeking help.
No need to insult me.

> Then read the FAQ again. Or read the newsgroup. The question is asked many
> times a day.






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

Date: 26 Jul 1999 16:17:10 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Regex-ing
Message-Id: <xkfso6bhx95.fsf@valdemar.col.hp.com>

David Cassell <cassell@mail.cor.epa.gov> writes:
> No, he'll hate that too.  I think we should recommend Intercal.
> There's never more than one way to do it in that language, is 
> there?  That should take care of his 'ambiguity' problem.

That's the beauty of intercal.  Not only is there more than one way to do 
something, there's an infinite number of ways to do it, all wrong.

-=Eric "you are in a maze of twisty DO statements, all weird"


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

Date: 26 Jul 1999 17:07:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Replacing and Stripping HTML
Message-Id: <slrn7ppmv0.lg7.abigail@alexandra.delanet.com>

Keith G. Murphy (keithmur@mindspring.com) wrote on MMCLV September
MCMXCIII in <URL:news:379CC5FD.6C64A697@mindspring.com>:
&& Abigail wrote:
&& > 
&& > Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLIV September
&& > MCMXCIII in <URL:news:7netc9$5hs$1@lublin.zrz.tu-berlin.de>:
&& > 
&& > Oh, sure it will. Don't forget HTML::Parser doesn't parse, and has no
&& > HTML knowledge. 
&& Well, HTML::TreeBuilder, which is built on it and what you'd actually
&& want to use, has *some* HTML knowledge.

I've tried using HTML::Treebuilder, and it couldn't parse nested tables
correctly. I've never used it again.

&& > Penguin::BBQ would have been a less confusing name.
&& You mean it will roast my Linux system?  I'll get it off of there
&& immediately.  Either that, or apply a good sauce.

No, I mean the bird that looks like a waiter.

&& > HTML::Parser tokenizes something. It has knowledge of tags with TAGO = '<',
&& > ETAGO = '</', TAGC = '>', and it knows how to deal with comments. But that'
&& > about it. It doesn't know about marked sections, nettags, and not even CDAT
&& > marked sections.
&& Marked sections?  Nettags?  CDATA marked sections?  Is this part of HTML
&& 4.0?

Marked sections and nettags have been there from the beginning; after all,
they are *SGML* constructs, not something HTML specific. And HTML has had
CDATA marked sections since HTML 3.2. The CDATA marked sections of HTML 4.0
(all variants) are SCRIPT and STYLE.

&& OK, I'll bite.  Are you working on something better?  I'd like to have
&& it in my hot little hands.  :-)

Just use the excellent smgl parsers out there.


Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 27 Jul 1999 22:59:03 +0100
From: "Stuart" <Stuart@worm.globalnet.co.uk>
Subject: Re: Server 500 error?
Message-Id: <7nim0k$2kr$1@gxsn.com>

Thank you for your reply's, I am sorry if I offended any of you with this
type of question, but I know that you were all very knowledgeable and could
probably have helped me.

p.s. I did not mean to imply that Perl was a cgi only language, it is a
powerful interpreted language and has many applications.

Stuart wrote in message <7nianm$9si$1@gxsn.com>...
>I am new to cgi programming and have written a script in Perl and placed it
>in the CGI-BIN directory in Personal Web Server. When ever running it
though
>I get a HTTP 500 server error, would anyone be kind enough to explain what
>this means as I can't find it in any documentation.
>--
> - Stuart
> - Newsgroups@worm.globalnet.co.uk
>Turner & King Communications
> - Web Design - takc@worm.globalnet.co.uk
>
>
>




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

Date: 26 Jul 1999 18:22:04 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Server 500 error?
Message-Id: <327FE55307395109.A6EFC8ADA15C2F5F.9C575C6A8583DDB4@lp.airnews.net>

"Stuart" <Stuart@worm.globalnet.co.uk> writes:

> I am new to cgi programming and have written a script in Perl and placed it
> in the CGI-BIN directory in Personal Web Server. When ever running it though
> I get a HTTP 500 server error, would anyone be kind enough to explain what
> this means as I can't find it in any documentation.

This is a server issue, not a perl issue.  Reread your server docs or ask
in a news group that handels it.

Kent


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

Date: Tue, 27 Jul 1999 01:35:32 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Server 500 error?
Message-Id: <Pine.HPP.3.95a.990727013414.4934B-100000@hpplus03.cern.ch>

On 26 Jul 1999, Kent Perrier wrote:

> This is a server issue, not a perl issue. 

Indeed it is, but there's still a perfectly good perl-based FAQ about
it.

-- 

                     "Bei dreibegriffigen mechanischen Vorsignalen ohne 
                      Doppelstellerhebel steuern zwei Fluegelkupplungen"



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

Date: Mon, 26 Jul 1999 22:09:06 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: stopping email overflow on failure
Message-Id: <slrn7ppm4a.1q4.*@dragons.duesouth.net>

[
    Your quoting was messed up.

    Most people read from top to bottom, not bottom to middle to top.
]    

On 26 Jul 1999 16:04:34 -0500, abigail@delanet.com (Abigail) wrote:
> Well, you could put two big aquaria in the server room. Put a goldfish
> in the right one. If the program finds a problem, it first looks where
> the goldfish is; if it's in the right aquarium, it sends out a message,
> and puts the goldfish in the left aquarium. If the goldfish is already
> in the left aquarium, doesn't do anything else anymore.
> 
> If there's no problem to be found, it also checks where the goldfish is.
> If it's in the left aquarium, it puts the goldfish back in the right
> aquarium.
> 
> This is a general coding problem, not a Perl specific one. I assume you
> can take the story above, and turn it into a solution more suitable for
> a computer. If not, go ask in a general programming group.

Which caused some fool known only as Steve to write:
> Whatever you looser.  And I say looser cause you have no clue what you
> are talking about and just wrote a page of crap.  Get a life.

Strange.

I just tried this, and it worked perfectly.

I was overjoyed.

My fish, however, was not to happy about the whole situation.

So, perhaps you need to explain what, exactly, caused you trouble.

Is the module Fish::Move poorly documented?

Is the module Fish::Move buggy?

Perhaps there is condensation on the camera lense?

Is the fish dead (which makes it difficult to find)?

Until you elaborate, I'm afraid we will be unable to help you.

You do realize that the fish, while the easiest route, are not necessary?

Best of Luck!

--Matthew


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

Date: 26 Jul 1999 16:12:58 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: stopping email overflow on failure
Message-Id: <xkfvhb7hxg5.fsf@valdemar.col.hp.com>

syarbrou@nospam.enteract.com (Steve .) writes:
> On 26 Jul 1999 16:04:34 -0500, abigail@delanet.com (Abigail) wrote:
> >Well, you could put two big aquaria in the server room. Put a goldfish
> >in the right one. If the program finds a problem, it first looks where
> >the goldfish is; if it's in the right aquarium, it sends out a message,
> >and puts the goldfish in the left aquarium. If the goldfish is already
> >in the left aquarium, doesn't do anything else anymore.
> >
> >If there's no problem to be found, it also checks where the goldfish is.
> >If it's in the left aquarium, it puts the goldfish back in the right
> >aquarium.
> >
> >This is a general coding problem, not a Perl specific one. I assume you
> >can take the story above, and turn it into a solution more suitable for
> >a computer. If not, go ask in a general programming group.
>
> Whatever you looser.  And I say looser cause you have no clue what you
> are talking about and just wrote a page of crap.  Get a life.

*snicker*

Um, you do realize, don't you, that Abigail is about as likely to have no 
clue as Sylvester Stallone is to have any clue?  You did read DejaNews
and figure out who your respondent was, right?  Oh, and as for your use
of "looser"... I do not think it means what you think it means.

In point of fact, she gave you the algorithm for doing what you want to
do exactly, which is more than I'd have expected her to do.  Assuming you 
know beans about programming, that is.  If you don't, well, hire a Perl
programmer.  I'll send you my rate card, if you like.

-=Eric


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

Date: 26 Jul 1999 17:24:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: stopping email overflow on failure
Message-Id: <slrn7ppo07.lg7.abigail@alexandra.delanet.com>

Steve . (syarbrou@nospam.enteract.com) wrote on MMCLV September MCMXCIII
in <URL:news:379cd3c9.286008804@news.enteract.com>:
-- Whatever you looser.  And I say looser cause you have no clue what you
-- are talking about and just wrote a page of crap.  Get a life.


You misspelled 'looser'.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 26 Jul 1999 15:24:39 -0700
From: "Lauren Smith" <laurens@bsquare.com>
Subject: Re: stopping email overflow on failure
Message-Id: <7nin7f$fp7$1@brokaw.wa.com>


Steve . wrote in message <379cd3c9.286008804@news.enteract.com>...
>On 26 Jul 1999 16:04:34 -0500, abigail@delanet.com (Abigail) wrote:
>
>>Steve . (syarbrou@nospam.enteract.com) wrote on MMCLV September MCMXCIII
>>in <URL:news:379cb90c.279163210@news.enteract.com>:
>>##Something like
>>## if problem found, keep checking, but do not warn again for like
>>## another hour.  Any ideas?  Thanks.
>>
>>Well, you could put two big aquaria in the server room. Put a goldfish
>>in the right one. If the program finds a problem, it first looks where
>>the goldfish is; if it's in the right aquarium, it sends out a message,
>>and puts the goldfish in the left aquarium. If the goldfish is already
>>in the left aquarium, doesn't do anything else anymore.
>>
>>If there's no problem to be found, it also checks where the goldfish is.
>>If it's in the left aquarium, it puts the goldfish back in the right
>>aquarium.
>>

>Whatever you looser.  And I say looser cause you have no clue what you
>are talking about and just wrote a page of crap.
>
Perhaps the CS departments of various universities aren't properly teaching
Computer Science these days?  Or maybe they aren't teaching problem solving
techniques to the students?  The least they could do is push for better
grammar and spelling.

The 'looser' you are bashing here Steve, just gave you a lesson in Computer
Science.  Not only that, your own question answered itself.  You outlined
exactly what you want the program to do:
if problem found
    report problem
    don't report same problem for one hour
end if

Now, looking at Abigail's response, she seems to have actually gone into a
lot of detail about how to implement your problem.  If you could see past
the metaphor, you would find a lot of insightful information in her answer.
Instead, you chose to make an ass of yourself, showing not only your lack of
knowledge, but also your unwillingness to learn.  Who is the real 'looser'?

Lauren




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

Date: 26 Jul 1999 17:11:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Text File Busy (errno = 26)
Message-Id: <slrn7ppn6h.lg7.abigail@alexandra.delanet.com>

Sohrab (sohrabSPAMSUX@d2c2.com) wrote on MMCLV September MCMXCIII in
<URL:news:bq4n3.3373$CK6.8247@client>:
// By the tone of your response I guess one of two things:
// 
// (1) You were insulted by my question (sorry, I didn't think you'd take it
// personally)
// (2) You're not familiar with the scenario/problem/solution and so you
// thought that a sharp note like the one you posted would help (??)
// 
// Anywho, after a bit of reading about modules in the Cookbook, I've ended all
// of my libraries with a "1;" hoping that the problem might be in their return
// values.  I've had no more errors since then today, but we'll see how things
// go during the week :)
// 
// I guess the question WAS a Perl question after all Abigail.


Ah, yes. How could I be so stupid. As 'man perldiag' tells us, the 
Perl error "Text File Busy" is caused by not having "1;" as last
line of the libraries.

Thanks for clearing up this issue!



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 26 Jul 1999 17:17:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Won't read from STDIN inside html tags
Message-Id: <slrn7ppnhu.lg7.abigail@alexandra.delanet.com>

Andy Collado (acollado@uiuc.edu) wrote on MMCLV September MCMXCIII in
<URL:news:379CCEC2.9868C713@uiuc.edu>:
// This is some of the code I am using to redirect my users to their home
// directories.
// The supply their username and that directs them to their home pages..
// 
//    &parse;
//    $yourpage=$FORM{yourpage};
// 
//    print "<frame src=\"/$yourpage/\" scrolling=auto noresize
// border=\"1\">\n";
// 
// But all it prints out is this:
// 
//   <frame src="//" scrolling=auto noresize border="1">
// 
// Please advise.


It looks like $FORM{yourpage} is either undefined, non existent,
or equal to "".



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


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