[12574] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6174 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 30 03:07:17 1999

Date: Wed, 30 Jun 99 00:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 30 Jun 1999     Volume: 8 Number: 6174

Today's topics:
        Alternative to fork(2) in a socket-based server. <streaking_pyro@my-deja.com>
        ANN: ActiveState Build 518 Docs in HTMLHelp format (Doug Edmunds)
    Re: Apples and Oranges (William Herrera)
    Re: Filehandles, appending a file..why dosn't this work <adams1015@worldnet.att.net>
    Re: Foreach on hash gives undefined value <thomas@bibsyst.no>
    Re: Getting SIGALARM to break a blocked connect(), help (elephant)
        Help! Need a NON-SSI advertising script <michael@cermak.com>
        hiring perl programmers charliemcelfresh@my-deja.com
    Re: hiring perl programmers <nospam.newton@gmx.net>
    Re: How to convert a text file to 0-byte lenght? <nospam.newton@gmx.net>
    Re: if ($_ =~ /^$var/) always fails - why? <ptimmins@itd.sterling.com>
    Re: if ($_ =~ /^$var/) always fails - why? (Abigail)
    Re: killing subprocess ==> reproducible core dump <jwz@jwz.org>
        Large Volume sites using perl? (Jack Gardner)
    Re: Limits of Berkley DB/DB_File (Benjamin Franz)
    Re: looking for a key to octalcode list <jorp@cyberdude.com>
    Re: My First Perl error...I'm just learning. <JFedor@datacom-css.com>
    Re: Object persistence -- how to? (Steve Leibel)
    Re: Pattern matching $1-$n not being pulled (Tad McClellan)
    Re: Perl install prob (DISREGARD) <webmaster@ipom.com>
        Perl install prob <webmaster@ipom.com>
    Re: Perl install prob <ppjohn@ncs.com.sg>
    Re: POP3 and FTP by email in Perl <swiftkid@bigfoot.com>
    Re: regExpr question. ()
    Re: search and replace with <> <nospam.newton@gmx.net>
    Re: Search Engine Problem -- newbie question (Abigail)
    Re: Tied hash not scaling - advice? (Benjamin Franz)
    Re: Tied hash not scaling - advice? (William Herrera)
        troubling extra space when reading in a text file ... <mark_lafleche@bc.sympatico.ca>
    Re: yahoo like search engine (Abigail)
    Re: yahoo like search engine <uri@sysarch.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 30 Jun 1999 05:40:30 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Alternative to fork(2) in a socket-based server.
Message-Id: <7lcakd$5b8$1@nnrp1.deja.com>

I am writing a server using sockets, and I am writing this on a win95
machine using Active Perl.  Because of this, I cannot use the fork(2)
command, which I was going to use to handle multiple connections.  Is
there any way I can still handle multiple connections to the socket
without using fork(2).  I can get one connection...but no more.  Any
help is greatly apprectiated...thanks!

--
R.Joseph
http://www.24-7design.com
http://bowdown.to


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


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

Date: Wed, 30 Jun 1999 06:34:50 GMT
From: edmundsMUNGED@pacifierMUNGED.com (Doug Edmunds)
Subject: ANN: ActiveState Build 518 Docs in HTMLHelp format
Message-Id: <3779b259.44359393@news.pacifier.com>

NEW -- uploaded 6/29/99. 
Complete Build 518 docs in HTMLHelp file format
If you ever wanted fast Perl doc search capabilities, this is it. 
(text is binary indexed) FREE.

http://www.pacifier.com/~edmunds/perltools.html

Doug Edmunds



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

Date: Wed, 30 Jun 1999 05:33:18 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Apples and Oranges
Message-Id: <3779ab83.60369225@news.rmi.net>

On Tue, 29 Jun 1999 19:55:07 GMT, edmundsMUNGED@pacifierMUNGED.com
(doug edmunds) wrote:

>>You are doing the perl equivalent of an invalid pointer access. Don't
>>do that :)
>
>I was just trying variations on a theme from Perl Cookbook 
>section 11.5  :)

Actually, I spoke too soon. I'd thought the perl bytecode compiler was
translating your dereferenced reference into a reference to
SCALAR(0x2). Actually, it was translating it into a reference to $2,
or something like $2. Sorry :).


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Wed, 30 Jun 1999 00:12:44 -0700
From: "Jeremiah and Veronica Adams" <adams1015@worldnet.att.net>
Subject: Re: Filehandles, appending a file..why dosn't this work?
Message-Id: <7lc8vm$d3e$1@bgtnsc01.worldnet.att.net>

Thanks everyone for your help. I really apreciate it. Got it lined

Jeremiah and Veronica <adams1015@worldnet.att.net> wrote in message
news:7lb4vo$iuk$1@bgtnsc01.worldnet.att.net...
> I'm a newbie having a hardtime getting a script to append a file. I can
get
> the script to append just fine through telnet but cannot get it to work
from
> a browser. I've chomoded all the files to 777 out of shere frustration and
> still cannot get the script to append the file. Here is the file handle
> lines I am using
>
> open (ORDERLOG, ">>orderlog") or die "Can't open orderlog.\n";
> print ORDERLOG $adjective2, \n;
> print ORDERLOG $adjective3, \n;
> print ORDERLOG "***********************************************\n";
> close ORDERLOG;
>
> incidently, I am asuming that it is priniting the variables correctly
> because the variables are parsed from a form.The scripts writes the
> following to the ORDERLOG file:
> SCALAR(0x80c06b4)SCALAR(0x80c06cc)
>
>




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

Date: Wed, 30 Jun 1999 08:19:42 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: Re: Foreach on hash gives undefined value
Message-Id: <3779B6FE.AC72E403@bibsyst.no>

>
> Nobody knows because you didn't post the actual code you're using.

I used the code I the posting. You did see the perl-like text there didn`t
you?
Anyhow, I found out that the first value produced by the line

while ( my ($person, $tmp) = each %record_hash)

were an empty string.

If I did something like

if ($person ne "") {

# print persons data
}

it worked just fine.

PS! Posting in html was unintentional. I am sorry.

Thomas



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

Date: Wed, 30 Jun 1999 16:16:18 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Getting SIGALARM to break a blocked connect(), help!
Message-Id: <MPG.11e46140b1b3e1df989abb@news-server>

Peter Leonard writes ..
>I was trying to wrap the connect() code in a SIGALARM, but I can't
>seem to get it to work.  Here's the code block:
>
>    local $SIG{ALRM} = "print STDDERR 'SIGALARM on $site\n'";

you'll kick yourself .. you're printing to STDDERR .. there's no double 
'D' in STDERR

btw .. you probably want to actually do something there .. like:

local $SIG{ALRM} = 'die "alarm on $site\n"';

and lastly .. you're using single quotes in your internal print statement 
 .. so even if it had have succeeded neither $site nor \n would have been 
interpolated *8^)

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 30 Jun 1999 05:22:38 GMT
From: TechGuy <michael@cermak.com>
Subject: Help! Need a NON-SSI advertising script
Message-Id: <7lc9io$51v$1@nnrp1.deja.com>

I need to start an advertising campaign in JULY (tomorrow!!!), so I'm
up a creek on this one.  Any help/suggestions would be GREATLY
appreciated.  I've checked out my usual sources of wisdom (cgi-
resources.com, etc.) but haven't been able to come up with much in the
way of NON-SSI scripts that will randomly rotate an ad (and then let
the link follow properly to the random ad).  If anyone knows of any
good programs for this (free or reasonably priced), I'd greatly
appreciate it.  Thanks!

-Mike


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


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

Date: Wed, 30 Jun 1999 04:29:51 GMT
From: charliemcelfresh@my-deja.com
Subject: hiring perl programmers
Message-Id: <7lc6fm$47i$1@nnrp1.deja.com>

Free-PC is seeking a very smart programmer w/a BS in Computer Science or
equivalent experience/skills. Must be very strong in C/C++, Java, or
Perl.  Expertise and a deep belief in the power of Perl will win you
fame, glory, more money, & stock options.  You will write & maintain
code for any or all of the following:  A custom written ad server, a
large scale email system, two large scale websites, state of the art
statistics reporting, along with various utilities involved with our
nationwide isp and internal business tools.  You will be part of a
highly motivated team and you will be responsible in large part for the
company's success.  This position pays well, in salary, benefits, and
stock options.  Expect to submit samples of your code & to write a
sample routine at the interview.


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


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

Date: Wed, 30 Jun 1999 08:23:11 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: hiring perl programmers
Message-Id: <3779B7CF.9322EEBC@gmx.net>

charliemcelfresh@my-deja.com wrote:
> 
> Expect to submit samples of your code

What does this mean? Do programmers have to have a portfolio of code
snippets, the way artists do, these days? Or are you supposed to snip
some of the (presumably copyrighted, proprietary etc.) code you're doing
for a client at the moment? Or what?

Cheers,
Philip


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

Date: Wed, 30 Jun 1999 08:10:07 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <3779B4BF.6A4CF598@gmx.net>

Tad McClellan wrote:
> 
>    Thanks for conforming to Usenet convention.
> 
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas

How about that sigfile delimiter of yours, then? I don't see a space
after it.

Cheers,
Philip


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

Date: Wed, 30 Jun 1999 04:05:16 GMT
From: Patrick Timmins <ptimmins@itd.sterling.com>
Subject: Re: if ($_ =~ /^$var/) always fails - why?
Message-Id: <7lc51n$3qc$1@nnrp1.deja.com>

In article <7lbtfu$44l$1@news.iastate.edu>,
  "Darin Dugan" <s1dugan@exnet.iastate.edu> wrote:

> The if statement below always fails.  However, I've done almost
> identical statements in other perl scripts with no problems
> whatsoever. Even more confusing is that although $idcode contains
> "OMASVSLBF" at the start of the  while loop (yes, really), if I
> replace /^$idcode/ with the literal /OMASVSLBF/, the script works
> fine.
>
> CODE SNIPPET:
> open(TABLE, "$path/wx.descr") || die "Can't open wx.descr for
reading!\n\n";
> while (<TABLE>) {
>   if ($_ =~ /^$idcode/) {
>         ($junk, $title, $notedir) = split (/,/);
>         last; # Got idcode, leave loop.
>   }
> }
>         print "idcode is $idcode\n";
>         print "junk is $junk, title is $title, notedir is $notedir\n";
> END CODE

This worked fine for me, cutting and pasting the portion of the data
file you provided. But are you sure that your input file is ASCII vs
some BUFR or GRIB extract?

$monger{Omaha}[0]
Patrick Timmins
ptimmins@itd.sterling.com

(doing weather in Omaha,
 ... and wishing I didn't know what BUFR and GRIB were :)


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


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

Date: 29 Jun 1999 23:54:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: if ($_ =~ /^$var/) always fails - why?
Message-Id: <slrn7nj8o7.1gv.abigail@alexandra.delanet.com>

Darin Dugan (s1dugan@exnet.iastate.edu) wrote on MMCXXIX September
MCMXCIII in <URL:news:7lbtfu$44l$1@news.iastate.edu>:
__ The if statement below always fails.  However, I've done almost identical
__ statements in other perl scripts with no problems whatsoever. Even more
__ confusing is that although $idcode contains "OMASVSLBF" at the start of the
__ while loop (yes, really), if I replace /^$idcode/ with the literal
__ /OMASVSLBF/, the script works fine.
__ 


It works fine for me:

#!/opt/perl/bin/perl -w
use strict;

my  $idcode = 'OMASVSLBF';
my ($junk, $title, $notedir);
while (<DATA>) {
  if ($_ =~ /^$idcode/) {
        ($junk, $title, $notedir) = split (/,/);
        last; # Got idcode, leave loop.
  }
}
print "idcode is $idcode\n";
print "junk is $junk, title is $title, notedir is $notedir\n";
__DATA__
ZZZZZZZZZ,************************************,NULL
OMASVROFK,Severe Storm WARNING - Norfolk NE,NWS_NEBKAN
OMASVROMA,Severe Storm WARNING - Omaha NE,NWS_NEBKAN
OMASVSLBF,This is the title field,TEST_FOLDER
OMASVSLNK,Severe Weather Statement -Lincoln NE,NWS_NEBKAN
ZZZZZZZZZ,************************************,NULL



idcode is OMASVSLBF
junk is OMASVSLBF, title is This is the title field, notedir is TEST_FOLDER



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: Tue, 29 Jun 1999 22:18:32 -0700
From: Jamie Zawinski <jwz@jwz.org>
Subject: Re: killing subprocess ==> reproducible core dump
Message-Id: <3779A8A8.78540D99@jwz.org>

This is a multi-part message in MIME format.

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

Jason Reed wrote:
> 
> Jamie Zawinski <jwz@jwz.org> writes:
> 
> > What I am trying to do is, run a subprocess, and if it doesn't complete
> > in a few seconds, kill it and move on.
> One way that's worked for me in the past is not
> trapping a die() but rather killing the process,
> like so:

That's not working either -- interestingly, though, this version makes 
it dump core on Linux as well (instead of saying "out of memory") so 
this time I was able to get a stack trace:

    % /tmp/dumper.pl
    running perl -e '1 while 1;'...timed out (5) for perl -e '1 while 1;'
    timed out: killing 14412
    awaiting 14412 death...
    dead.
    timed out
    running perl -e '1 while 1;'...Segmentation fault (core dumped)
    ...
    #0  0x807e4cd in Perl_av_extend ()
    #1  0x807e66e in Perl_av_store ()
    #2  0x807e59f in Perl_av_fetch ()
    #3  0x807919e in Perl_my_pclose ()
    #4  0x80a50d9 in Perl_do_open ()
    #5  0x809c439 in Perl_pp_open ()
    #6  0x807ebba in Perl_runops ()
    #7  0x8057a3f in perl_run ()
    #8  0x8055f3b in main ()

-- 
Jamie Zawinski             jwz@jwz.org             http://www.jwz.org/

--------------4AB58DEFBAF30782B588922F
Content-Type: application/x-perl; name="dumper.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="dumper.pl"

#!/usr/local/bin/perl5

require 5;
#use diagnostics;
use strict;
use POSIX;

my $cvt_timeout = 5;

sub foo {
    my $cmd = "perl -e '1 while 1;'";
    my $body = "blah blah blah";
    my $pid;

    @_ = eval {
        local $SIG{ALRM}  = sub {
            print "timed out ($cvt_timeout) for $cmd\n";

        print "timed out: killing $pid\n";
        if ($pid) {
            kill ('TERM', $pid);
            print "awaiting $pid death...\n";
            waitpid ($pid, 0);
            print "dead.\n";
        }
            die "alarm\n"
            };
        alarm $cvt_timeout;
        
        print "running $cmd...";
        if (($pid = open(PIPE, "| $cmd"))) {
            print PIPE $body;
            close PIPE;
            return 1;
        } else {
            print "failed: $!\n";
            return 0;
        }
    };
    die if ($@ && $@ ne "alarm\n");       # propagate errors
    if ($@) {
        print "timed out\n";
        return ();
    } else {
        print "completed normally.\n";
        alarm 0;
        return @_;
    }
}

while (1) {
    $|=1;
    foo;
    sleep 2;
}

--------------4AB58DEFBAF30782B588922F--



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

Date: Wed, 30 Jun 1999 05:12:51 GMT
From: jjack100@yahoo.com (Jack Gardner)
Subject: Large Volume sites using perl?
Message-Id: <37799ffc.27650128@news.earthlink.net>


I'm interested to know which LARGE volume web sites people have heard
of/know of using perl.  I work for a development company that has
implemented CGI/database functionality using perl, asp & active X, and
Java.  The choice of language is often dependent on existing platforms
that the client has already implemented (in an intranet scenario).
But I have noticed that many large volume sites are using ASP (which,
granted,  technically means that they could still be using perl).

When I say "high volume," I am referring to Amazon caliber websites.
I've heard that amazon has a C code base that doesn't use perl at all.

Others: Dell, Barnes & Noble use ASP.

I have heard (not nec. correct) that sites like AOL and Yahoo etc have
"custom" setups with tcl scripts or C.

I am certainly not implying that perl is not being used on high volume
sites.  I am just interested to know of specific sites if any knows of
any.  I should also point out that I am not 'advocating' a particular
language over perl.

My definition of High Volume:  Airline sites, search engine sites,
large corporate e-commerce.

Thanks.

Jack Gardner 



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

Date: Wed, 30 Jun 1999 04:34:05 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Limits of Berkley DB/DB_File
Message-Id: <17he3.2502$Ig3.91663@typhoon-sf.snfc21.pbi.net>

In article <377862AC.3B19CBF4@bibsyst.no>,
Thomas Weholt  <thomas@bibsyst.no> wrote:
>
>Hi,
>
>As a follow-up to my posting yeasterday about storing complex
>datastructures, I was wondering about the limits of the Berkley DB. How
>big can a database be before the speed is affected? Hwo can I store the
>values most effectively?

Berkeley hashes remain essentially constant speed regardless of size.
Btrees inherently have log N speed properties at best - IOW it slows 
down roughly as the logarithm of the numer of keys.

Both statements are of course subject to degenerate cases such as having
every key identical - which pushes your time to order N to find a
*particular* record.

More likely to be encountered is breaking your filesystem. While
*Berkeley* has no practical top limit to the size of the database,
32 bit filesystems usually puke at either 2 or 4 gigabytes for
the database file.

-- 
Benjamin Franz


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

Date: Wed, 30 Jun 1999 07:20:19 -0700
From: slinden <jorp@cyberdude.com>
Subject: Re: looking for a key to octalcode list
Message-Id: <377A27A3.6AF9C4CC@cyberdude.com>



Tad McClellan schrieb:

> slinden (jorp@cyberdude.com) wrote:
>
> : i am looking for a key(board) to octalcode list
> : a list that contains e.g.
> : that the ESC-key is 033 in octal.
>
>    This is the Perl newsgroup.
>
>    We discuss Perl here.
>
>    What is your Perl question?
>

i want to send some charakters zu another program with perl.
--
sylvia linden
TMTOWTDI there's more than one way to do it!




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

Date: Wed, 30 Jun 1999 00:56:16 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <7lc66u$5gm$1@plonk.apk.net>


av8tor@flash.net wrote in message <7lb6l7$p66$1@nnrp1.deja.com>...
>I'm just starting to learn perl and CGI.


Do you have telnet access to the box or are you ftping your html/scripts?

Always send .pl or .cgi or .htm/l files as ascii.  After uploading test.cgi
did you chmod 755?

Don't forget to print "Content-type: text/html\n\n";  before printing
anything to the browser.

Jody




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

Date: Tue, 29 Jun 1999 21:00:00 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: Object persistence -- how to?
Message-Id: <stevel-2906992100000001@192.168.100.2>

In article <7lbaem$cu9$1@towncrier.cc.monash.edu.au>,
damian@cs.monash.edu.au (Damian Conway) wrote:

> "David L. Nicol" <david@kasey.umkc.edu> writes:
> 
> >Steve Leibel wrote:
> > 
> >> if I define a class and then create an instance of that
> >> class, can I store the instance on disc for later retrieval?
> 
> You've already been offered some very good suggestions. 
> 
> But if you want more guidance on implementing persistence, Sriram
> Srinivasan's "Advanced Perl Programming" (published by O'Reilly)
> has a good discussion of the theory and practicalities of persistence.
> My forthcoming book "Object Oriented Perl" (published by Manning
> in August) also describes a range of OO persistence techniques.
> 

Thanks, I will be looking forward to that book!


Steve L


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

Date: Tue, 29 Jun 1999 18:48:49 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Pattern matching $1-$n not being pulled
Message-Id: <hgibl7.712.ln@magna.metronet.com>

e_broyles2@my-deja.com wrote:

: This is seemingly consistent in all that I am trying, so I am sure I am
: missing something.


   You are missing the several followups that explain what is
   happening.

   Wait for them, or try a Usenet archive.


: Every time I try to match n parenthetical elements, I am only able to
                                                                ^^^^^^^
: access, $1 through $(n-1) but never $n.
  ^^^^^^


: In article <7lb40k$o2h$1@nnrp1.deja.com>,
:   e_broyles2@my-deja.com wrote:
: > Can someone tell me why when I do this:
: >
: > $myvar = "134:00:34:56";
: >
: > if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
: >      print "$1\n";
: >      print "$2\n";
: >      print "$3\n";
: >      print "$4\n";


   If $4 was not initialized, you would be getting a warning
   message from the -w switch that you surely use on all of
   your perl programs.

   $4 *is* initialized. Its value is the empty string.

   So you can _access_ it fine, though it may not contain the
   value that you want it to contain.


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


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

Date: Tue, 29 Jun 1999 20:01:15 -0400
From: Phil Dibowitz <webmaster@ipom.com>
Subject: Re: Perl install prob (DISREGARD)
Message-Id: <37795E4B.89FAED3B@ipom.com>

Sorry, I got it, it was a problem in my path variable.. spend two days
trying to figure out what isntallation error occured, and it turns out to
be something dumb. Sorry about that ...


Phil



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

Date: Tue, 29 Jun 1999 19:13:34 -0400
From: Phil Dibowitz <webmaster@ipom.com>
Subject: Perl install prob
Message-Id: <3779531E.A15C904F@ipom.com>

I managed to install Perl successfully (ha) on my Solaris machine, but
when I type "perl filename.pl" I get the error "perl: cannot
execute".... the wierd thing is, even if I type "perl -w" I get the same
error.

I think that Solaris isn't able to execute the interpreter, but I'm not
sure. I can read the man pages jut fine though. Any ideas? Any help
would be appreciated. Thanks.


Phil



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

Date: Wed, 30 Jun 1999 13:26:03 +0800
From: John Paopeng <ppjohn@ncs.com.sg>
To: Phil Dibowitz <webmaster@ipom.com>
Subject: Re: Perl install prob
Message-Id: <3779AA6B.EAF4EB5E@ncs.com.sg>

Phil Dibowitz wrote:
> 
> I managed to install Perl successfully (ha) on my Solaris machine, but
> when I type "perl filename.pl" I get the error "perl: cannot
> execute".... the wierd thing is, even if I type "perl -w" I get the same
> error.
> 
> I think that Solaris isn't able to execute the interpreter, but I'm not
> sure. I can read the man pages jut fine though. Any ideas? Any help
> would be appreciated. Thanks.
> 
> Phil

Hi

Make sure that 'perl' is executeable file.
try "$ chmod +x perl"

John
-- 
It's true that we don't know what we've got until we lose it, 
but it's also true that we don't know what we've been missing until it
arrives.
Always put yourself in other's shoes.  
If you feel that it hurts you, it probably does hurt the person, too.


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

Date: Wed, 30 Jun 1999 11:48:46 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: POP3 and FTP by email in Perl
Message-Id: <7ldht9$5if10@news.cyber.net.pk>

Jordan Hiller <hiller@email.com> wrote in message
news:37794AEE.F3FFC7A7@email.com...
> I am writing a "Web by email" program in Perl. I was wondering if there is
a
> FTP-by-email program written in Perl for me to take a look at.
>
> Also, I'm not sure how to read email from a POP3 server in perl. Any
pointers or
> sample code?


Mail::POP3Client

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift  ICQ: 4265451
FAX: (815) 846-2877






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

Date: 30 Jun 1999 04:44:35 GMT
From: redmondm@yahoo.com ()
Subject: Re: regExpr question.
Message-Id: <slrn7nj85m.b5a.redmondm@kells.kells>

Think of $foo as a string not a list of lines. Newline, \n, is just another
characteri, though a little special.  So leave $foo a scalar and use the
/s modifier to tell . to match newline.

$foo =~ /<!-- something unique 1 -->(.*?)<!-- something unique 2 -->/s;
print $1;

Martin
mpr@webcamnow.com

In article <Pine.BSF.3.96.990629180249.4862A-100000@soda.CSUA.Berkeley.EDU>, 
 marlon wrote:
>Im all FAQed out, I've spent some time on cpan and the examples dont seem
>to work for my task:
>
>I have:
>
>$foo   equal to
>" a whole lot of html
>  spanning several lines, there are 2 specific unique
>  strings like <!-- something unique 1 --> and a 
>  bunch of html in between <!-- something unique 2 -->
> and then a whole lot more stuff"
>
>so that's what $foo looks like.
>And what I want is to capture all the text INBETWEEN the 2 unique strings.
>It doesn't matter if I get the 2 unique strings (they're just HTML
>comments) but I dont know if I have to turn $foo into a file handle,
>if so then what?
>If I leave $foo as a scalar how do I apply a regexp accross it?
>Thanks in advance,			marlon
>
>
>_
>


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

Date: Wed, 30 Jun 1999 08:14:12 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: search and replace with <>
Message-Id: <3779B5B4.6A92A25@gmx.net>

Anno Siegel wrote:
> 
> While there are ways to tell them apart (see
> the __FILE__ token) it would be tedious to do so here.

The __FILE__ token? Not $ARGV, or ARGV?

(Hint: __FILE__ refers to the *source* file, not to anything you may
read in.)

Cheers,
Philip


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

Date: 30 Jun 1999 01:57:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Search Engine Problem -- newbie question
Message-Id: <slrn7njfv2.1gv.abigail@alexandra.delanet.com>

Z. Pham (z_pham@ix.netcom.com) wrote on MMCXXIX September MCMXCIII in
<URL:news:37798F29.1BB551BC@ix.netcom.com>:
;; I have a search engine for my database that works well.   When I go into
;; my browser and type
;; "http://www.mywebpage.com/cgi-bin/DB_Search/db_search.cgi?setup_file=sample.setup.cgi"
;; and enter some values in the frontend form, the engine displays 10 hits,
;; then I can click the "see next # hits" button and get my next 10 hits.
;; Perfect.
;; 
;; However, if I try putting code into my HTML page for the frontend form
;; on "http://www.mywebpage.com" and then test it as a client, the first 10
;; hits display, but the next hits do not.  The page says,  "The document
;; contained no data."
;; 
;; What's wrong?  I'm getting only 10 hits and that's it.


Ah yes. This is a task for the crystal ball. Please do sit down, this
might take a while. *light in the room dims* *sinister music starts
playing* *hand waving; lots of hand waving* Ah, there's the smoke.
Now all we need to do is wait for the smoke to clear.... handing another
25 dollars might help. Thank you. *smoke in crystal ball floats to the
bottom* Well, well, well, what do we have here? A Perl program! A Perl
that uses the CGI protocol! Am I right so far? I'll contine for another
25 dollars. Thank you. *more handwaving* *more music* Lets look inside
the program. Oh, dear. Hard to see, the dark side is. Perhaps another 25
dollars? Thank you. Look there, in the middle of the dark side, there's
the bug. Don't be afraid! Fear is the path to the dark side. Fear leads
to anger. Anger leads to hate. Hate leads to suffering. I sense much
fear in you. *smoke rises in the ball* *music stops* *light brighten*. I
think your session is over. Please come again.


Next!



Abigail
-- 
sub A::FETCH{Just   }$_.='print+"@{[map';sub A::TIESCALAR{bless\my$y,A}
sub B::FETCH{Another}$_.='{tie my($x),$';sub B::TIESCALAR{bless\my$y,B}
sub C::FETCH{Perl   }$_.='_;$x}qw/A B C';sub C::TIESCALAR{bless\my$y,C}
sub D::FETCH{Hacker }$_.=' D/]}\n"';eval;sub D::TIESCALAR{bless\my$y,D}


  -----------== 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: Wed, 30 Jun 1999 04:54:32 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Tied hash not scaling - advice?
Message-Id: <cqhe3.2509$Ig3.95690@typhoon-sf.snfc21.pbi.net>

In article <7lbp4n$2d0$1@shell2.ba.best.com>,
K. Krueger <kirbyk@best.com> wrote:
>
>I've got a CGI tool that can search for a particular IP in the audit trail.
>As time went by, using File::find for this got really slow, unsurprisingly.
>So, I learned about tied hashes, and made an index file.  All was well,
>and it was blazingly fast.
>
>Much more time has passed, and now it's completely broken.  And when I
>look at the index file:
>-rw-r--r--   1 kirbyk   user     594935808 Jun 28 13:55 audit.index
>
>Yikes!  That's one big file!
>
>I've deleted it and regenerated it, and it's still doing this.
>
>So, clearly, I need to change something.  I'm not sure if there's an
>easy solution, or if I'll have to dig in and run something like a 
>mySQL database for the backend.  It's really useful to be able to pull
>up the reason we're blocking someone when an angry ISP is on the other
>line. :-)

[snip]

>    $fileList = $main::files{$ip};
>    return if $fileList && $fileList =~ /$file/;
>    $fileList .= " $file";
>    $main::files{$ip} = $fileList;

At a guess, you are using Berkeley DB 1.x. I've provoked core dumps
using 1.x and code similiar to the lines above - in addition to having
it swallow the disk wholesale (and wastefully). That was just
doing something like

 for (my $count=1;$count<10000;$count++) {
 	my $value = ' ' x $count;
	$hash{'0'} = $value;
 }

It exploded into the tens of megabytes and core dumped at slightly over 
5000 on my machine.  Berkeley 1.x *DOESN'T LIKE* progressively extending 
the length of values. The same program on 2.x only ran in to a few dozen
Kbytes of storage and ran perfectly.

The best fix is to get Berkeley DB 2.x installed. Work arounds could 
include 'pre-allocating' large records or making *two* passes - one
to determine the size of the needed records and the second to actually
do the load with the storage being pre-allocated to the final size 
and using 'substr' to slot in each record. 

Another possibility is to use 'Search::InvertedIndex' from CPAN. 
Its 'preload' methods *don't* progressively grow the records and 
so shouldn't tickle the bug in Berkley DB 1.x. And it runs in NlogN 
time for loads where your approach runs in N^2 time during loads. 

-- 
Benjamin Franz



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

Date: Wed, 30 Jun 1999 06:20:59 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Tied hash not scaling - advice?
Message-Id: <3779aff7.61509051@news.rmi.net>

On 29 Jun 1999 17:41:59 -0700, kirbyk@best.com (K. Krueger) wrote:


>Much more time has passed, and now it's completely broken.  And when I
>look at the index file:
>-rw-r--r--   1 kirbyk   user     594935808 Jun 28 13:55 audit.index

>sub add_file {
>
>    $file = $File::Find::name;
>    return if -d $file;
>    return if $file eq $indexFile;
>    ($site) = ($file =~ /.*\/.*\/(.*)$/);
>    ($ip) = ($site =~ /(\d*\.\d*\.\d*\.\d*).*/);
>    return if !$ip;
>    $fileList = $main::files{$ip};
>    return if $fileList && $fileList =~ /$file/;
>    $fileList .= " $file";
>    $main::files{$ip} = $fileList;
>    
>}

>From my own (limited) experience with this one, I think there is a bug
in certain DB_File db databases when the values are repeatedly
modified by extending their length. It seems that maybe the db file
then grows by adding on the new value to its file-on-disk tables
without recycling the (sizeable) disk space of the old value in the
file! 

There ought to be some way to force a 'database  compaction ' for this
'garbage collection'  problem but I do not know how. You might try to
copy the database record by record to another (new) tied db_file hash
and see what the size of the resulting new file is then (and compare
the file contents of old and new).


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Tue, 29 Jun 1999 18:48:48 -0700
From: Mark La Fleche <mark_lafleche@bc.sympatico.ca>
Subject: troubling extra space when reading in a text file ...
Message-Id: <37797780.609E@bc.sympatico.ca>

Hi,

Yes, a bit of a newbie.

I have a script that saves several lines of text from a form using a
html input=textarea into a .txt file. When I read the .txt file back
into an input=textarea box the original input has extra spaces (?) in
it.

For example:

If the original data its typed into the text area like this (and is
correctly save into the .txt file):

1. test line one
2. test line two
3.
4. test line four

the data read back in from the text file into the textarea box looks
like this:

1. test line one
 2. test line two
 3.
 4. test line four

The problem is not only the troubling spaces.  I offer an option that
resaves this data (spaces and all!).  The next time the data is read
into the textarea it looks like this:

1. test line one
  2. test line two
  3.
  4. test line four

I can't seem to figure out a way to prevent the data from reading in
with the extra space.

If anyone would like to help me with this I would appreciate it.  Let me
know what you need to know to solve this problem.

Thanks in advance,

Glen

P.S.  I've been reading stuff and working on this for a while.  I
already eliminated a troubling extra line feed problem, but I'm at a
loss for this one.  G.




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

Date: 29 Jun 1999 23:57:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: yahoo like search engine
Message-Id: <slrn7nj8sk.1gv.abigail@alexandra.delanet.com>

Big Poppa (bigpun@mindspring.com) wrote on MMCXXIX September MCMXCIII in
<URL:news:3kee3.318$ue4.17867@typ32b.nn.bcandid.com>:
** Hello....I need a cgi script that is like Yahoo.  Where you can type in
** keywords or select from groups or categories.....

Did you contact the Yahoo sales department?

What has your question to do with Perl? Doesn't Yahoo use Python?


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\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: 30 Jun 1999 01:37:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: yahoo like search engine
Message-Id: <x790925jvj.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Did you contact the Yahoo sales department?

  A> What has your question to do with Perl? Doesn't Yahoo use Python?

jeff friedl works for yahoo and hacks perl for them. i think they use
perl a great deal.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 V8 Issue 6174
**************************************

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