[17191] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4603 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 13 03:05:25 2000

Date: Fri, 13 Oct 2000 00:05:10 -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: <971420709-v9-i4603@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 13 Oct 2000     Volume: 9 Number: 4603

Today's topics:
    Re: about sendmail (Christopher Browne)
    Re: about sendmail <nospam@xepec.com>
    Re: Asyncronous Queue <uri@sysarch.com>
    Re: CGI.pm and Tables question <jeff@vpservices.com>
    Re: CGI.pm and Tables question <jeff@vpservices.com>
    Re: Difference between '=' and '.=' operators <uri@sysarch.com>
    Re: Difference between '=' and '.=' operators <jeffp@crusoe.net>
    Re: Difference between '=' and '.=' operators <ianb@ot.com.au>
        Finding Perl Modules installed on server <Jodyman@usa.net>
    Re: Finding Perl Modules installed on server <tommyau@dotexpress.com>
        GD install errors with CPAN.pm shell <robert_pearse@hotmail.com>
        Giant Array Delay (beginner) peliknish@my-deja.com
    Re: How can I add 5 hours to the time my server reports <mhofer@jpmorgan.com>
        MLDBM db Q. <cschwieterman@home.com>
    Re: perl cgi-bin error problem - beginner abevec@my-deja.com
    Re: Perl Watching Perl? rathmore@tierceron.com
        Plz help - Perl Q <mikecook@cigarpool.com>
    Re: Plz help - Perl Q <uri@sysarch.com>
    Re: Plz help - Perl Q <godzilla@stomp.stomp.tokyo>
        Re[2]: Invoking ssh from a script tokpela@my-deja.com
        search engine in perl? <yura@wsr.ru>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 13 Oct 2000 04:33:38 GMT
From: cbbrowne@knuth.brownes.org (Christopher Browne)
Subject: Re: about sendmail
Message-Id: <slrn8ud44j.7bc.cbbrowne@knuth.brownes.org>

In our last episode (Fri, 13 Oct 2000 11:43:57 +0800),
the artist formerly known as Lucas Gamp said:
>I used to send email in CGI by /usr/sbin/sendmail, but this time I must
>send a HTML that contains images, so how should I deal with the images,
>how to print to sendmail?

Simple Answer:  You can't.

This is more or like asking how you might use your refrigerator to bake
a pie.  I don't use my fridge for that; I use an oven.

Explaining...

-> Suppose your document contains the tag:
  <img src="local://myfilename.jpeg">

  That represents an image that must _already_ be on a local filesystem
  at the destination.

-> Suppose your document contains the tag:
  <img src="http://somehost.org/pictures/mypicture.jpeg">

  That represents an image that the web browser will try to access
  via the HTTP protocol.

Those are basically the two options you have.  Sendmail has no way
of indicating that a file be put into "myfilename.jpeg".  

And it is a server that uses the SMTP protocol, not the HTTP protocol,
so it can't serve up http://somehost.org/pictures/mypicture.jpeg

This is inherently outside the scope of anything Sendmail might be 
used to do.  Sendmail is used to send messages.  It doesn't
display images, or transfer anything using the HTTP protocol.  It is
not a program that is used to print things.

Note that if you use an image URL that references your favorite
web server, someone that is reading their email using a web browser
rather than a mail client will find that their web browser will head
to that web server and pull the image via HTTP.  Sendmail won't be
involved in the slightest.
-- 
cbbrowne@hex.net - <http://www.ntlug.org/~cbbrowne/internet.html>
Do not meddle in the affairs of dragons, for you are crunchy and taste
good with ketchup.


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

Date: Fri, 13 Oct 2000 05:31:22 GMT
From: "Andrew Serukov" <nospam@xepec.com>
Subject: Re: about sendmail
Message-Id: <K6xF5.4621$MK6.162380@newsread1.prod.itd.earthlink.net>


"Christopher Browne" <cbbrowne@knuth.brownes.org> wrote in message
news:slrn8ud44j.7bc.cbbrowne@knuth.brownes.org...
> In our last episode (Fri, 13 Oct 2000 11:43:57 +0800),
> the artist formerly known as Lucas Gamp said:
> >I used to send email in CGI by /usr/sbin/sendmail, but this time I must
> >send a HTML that contains images, so how should I deal with the images,
> >how to print to sendmail?
>
> Simple Answer:  You can't.
>
> This is more or like asking how you might use your refrigerator to bake
> a pie.  I don't use my fridge for that; I use an oven.
>
> Explaining...
>
> -> Suppose your document contains the tag:
>   <img src="local://myfilename.jpeg">
>
>   That represents an image that must _already_ be on a local filesystem
>   at the destination.
>
> -> Suppose your document contains the tag:
>   <img src="http://somehost.org/pictures/mypicture.jpeg">
>
>   That represents an image that the web browser will try to access
>   via the HTTP protocol.
>
> Those are basically the two options you have.  Sendmail has no way
> of indicating that a file be put into "myfilename.jpeg".
>
> And it is a server that uses the SMTP protocol, not the HTTP protocol,
> so it can't serve up http://somehost.org/pictures/mypicture.jpeg
>
> This is inherently outside the scope of anything Sendmail might be
> used to do.  Sendmail is used to send messages.  It doesn't
> display images, or transfer anything using the HTTP protocol.  It is
> not a program that is used to print things.
>
> Note that if you use an image URL that references your favorite
> web server, someone that is reading their email using a web browser
> rather than a mail client will find that their web browser will head
> to that web server and pull the image via HTTP.  Sendmail won't be
> involved in the slightest.
> --
> cbbrowne@hex.net - <http://www.ntlug.org/~cbbrowne/internet.html>
> Do not meddle in the affairs of dragons, for you are crunchy and taste
> good with ketchup.

There's MHTML, mime-based multipart HTML.
I'm not sure if it's Microsoft-proprietary (it feels like it's not) but MS
does
support it in newer apps. I haven't heard of Linux packages that would
handle MHTML but then I  haven't looked for them either.
If there's one, it may solve your problem just fine.

--Andrew




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

Date: Fri, 13 Oct 2000 04:17:29 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Asyncronous Queue
Message-Id: <x7d7h5xtlx.fsf@home.sysarch.com>

>>>>> "LS" == Logan Shaw <logan@cs.utexas.edu> writes:

  LS> Of course, then there is the issue of how to get that
  LS> queue-managing process to talk to several simultaneous connections
  LS> at once.  The only feasible Perl solution as far as I know is to
  LS> use select() (or the fancier IO::Select).  This can be done, but
  LS> it's a bit of a pain.  I once tried to implement this, and
  LS> although I got an early prototype working, I ended up practically
  LS> having to write a cooperative multitasking task switcher like
  LS> thing to make it happen.

  LS> Well, I hope that gives you some ideas.  I'd be very interested if
  LS> anyone has better ideas.  I have thought about a similar problem
  LS> quite a lot and that's the best I came up with.

Event.pm, POE and (soon) stem, a system i am developing which is network
application toolkit (see stemsystems.com).

all are much better and higher level than IO::Select. and all give you
safe signals and an event loop in their core.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 12 Oct 2000 21:12:11 -0700
From: Jeff Zucker <jeff@vpservices.com>
To: Kurt Wagner <Kurt@wagner.com>
Subject: Re: CGI.pm and Tables question
Message-Id: <39E68B9B.D26893A8@vpservices.com>

[courtesy cc emailed to Kurt]

Jeff Zucker wrote:
> 
> > Thanks for the tidbit, but is there a way to change the cell color
> > background that are on the same row, the tidbit does a column of a
> > single cell, say you have like a three by three table?
> 
> Have you no ability to generalize from an example?  

Gosh, that was rude of me, especially considering I was wrong, sorry.

>  What is it you are missing?

Apparently less than what I was missing.

David Efflandt posted a better response than mine showing how to do what
you asked for with a complicated period and comma method.  That works
but isn't necessary.  My first example to you was wrong because I
included square brackets around the th() calls.  Here is the example
again, without the square brackets, giving you what you actually (and
clearly) requested, a three by three table:

print 
    table(  {-border=>'1'},
        Tr( {-bgcolor=>'blue'},
           th({-bgcolor=>'red'},'red'),
           th('blue'),
           th('blue')
        ),
        Tr( {-bgcolor=>'orange'},
         th({-bgcolor=>'red'},'red'),
         th('orange'),
         th('orange')
        ),
        Tr( {-bgcolor=>'blue'},
           th({-bgcolor=>'red'},'red'),
           th({-bgcolor=>'white'},'white'),
           th('blue')
        ),
    )
;

Sorry again for my previous erroneous and rude reply.

-- 
Jeff


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

Date: Thu, 12 Oct 2000 21:17:53 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: CGI.pm and Tables question
Message-Id: <39E68CF1.C3956D54@vpservices.com>

David Efflandt wrote:
> 
> On Fri, 06 Oct 2000 20:46:29 -0700, Jeff Zucker <jeff@vpservices.com> wrote:
> >
> >    table(
> >        Tr( {-bgcolor=>'blue'},
> >        [
> >           th({-bgcolor=>'red'},'red'),
> >           th({-bgcolor=>'white'},'white'),
> >           th('blue')
> >        ])
> >    )
> 
> That will not work for cells in a row.  For the same row, append td or th
> for each cell that is different with a dot (.) instead of comma, like for
> a table with 3 columns:
> 
>     table(
>         Tr( {-bgcolor=>'blue'},
>         [
>            th([{-colspan=>3},'3 columns']),     # comma
>            td([{-bgcolor=>'red'},'red']).       # dot (next on same row)
>              td([{-bgcolor=>'white'},'white']). # dot (next on same row)
>              td(['blue']),      # comma (next on next row)
>            td(['col 1','col 2','col 3'])
>         ])
>     )
> 
> It took me some trial and error to figure this out since perldoc CGI does
> not explain tables and only has a brief example.

Thanks for the clarification, David.  Your example does what the OP
asked for and mine doesn't.  But here's an even better way: just omit
the square brackets and leave everything as a comma.  When you want to
switch rows, do a new Tr().  It has the same effect as yours and is (at
least for me) easier to grok.  Here's a 2 row by 3 column table:

        Tr( {-bgcolor=>'orange'},
         th({-bgcolor=>'red'},'red'),
         th('orange'),
         th('orange')
        ),
        Tr( {-bgcolor=>'blue'},
           th({-bgcolor=>'red'},'red'),
           th({-bgcolor=>'white'},'white'),
           th('blue')
        ),

-- 
Jeff


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

Date: Fri, 13 Oct 2000 04:28:59 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Difference between '=' and '.=' operators
Message-Id: <x7aec9xt2s.fsf@home.sysarch.com>

>>>>> "SM" == Sean McAfee <mcafee@waits.facilities.med.umich.edu> writes:

  SM> Some code I'm writing accumulates key-value pairs in a hash.  There can be
  SM> multiple values for a single key, but rather than use an array reference
  SM> for the hash value I'm using a single scalar with the multiple values
  SM> separated by newline characters.  My original implementation looked like
  SM> this:

  SM> while (($key, $value) = some_func()) {
  SM>     exists $hash{$key} ? ($hash{$key} .= "\n$value") : ($hash{$key} = $value);
  SM> }

you should really use an anon array like you said. it makes life so much
easier than a concatenated string of keys.

  SM> perl -le '$a{foo} = exists $a{foo} && "bar"; print $a{foo}'

  SM> ...prints nothing, as expected.  Even this prints nothing:

  SM> perl -le '$a{foo} = $a{foo} . (exists $a{foo} && "bar"); print $a{foo}'

  SM> So does anyone know why .= is so different?

remember, .= like other assignment ops are really not the same as their
logical expansion. they do internal shortcuts for speed as they know
stuff like in this case $a{foo} is going to be a string. so it needs to
have a string value to append to and it will coerce an undef value to
''. so it then has to set the key in the hash for that value of '' so
exists is now true. make sense? in your two examples above, $a{foo} is
not created until the full expression is evaluated and then the key is
made. with .= the left side is forced into a string before the
expression is evaluated as it know it will be one.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 13 Oct 2000 00:35:42 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Difference between '=' and '.=' operators
Message-Id: <Pine.GSO.4.21.0010130032550.14163-100000@crusoe.crusoe.net>

[posted & mailed]

On Oct 13, Sean McAfee said:

>while (($key, $value) = some_func()) {
>    ($hash{$key} .= exists $hash{$key} && "\n") .= $value;
>}
>
>I was surprised to find that this code didn't behave as I expected; the
>exists $hash{$key} expression always evaluated to true, so that after the
>loop completed every hash value had a "\n" prepended.  Somehow the .=
>operator causes $hash{$key} to spring into existence before the right-hand
>side is evaluated.  This doesn't happen with the = operator, though:
>
>So does anyone know why .= is so different?

  #!/usr/bin/perl -w
  $hash{this} .= "foo";
  $hash{that} = $hash{that} . "foo";

That warns me about an undef value in line 3.  The OP= operators give
their operand a non-undef value if necessary.  Perl used to NOT do this,
which would be very irritating in cases like:

  for (@list) {
    $hash{$_} += split //;  # over and over again!
  }

That's why the value is created.  A "quirk" of all the OP= operators.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Fri, 13 Oct 2000 16:04:28 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Difference between '=' and '.=' operators
Message-Id: <39E697DC.B99354E2@ot.com.au>

Sean McAfee wrote:

> I was surprised to find that this code didn't behave as I expected; the
> exists $hash{$key} expression always evaluated to true, so that after the
> loop completed every hash value had a "\n" prepended.  Somehow the .=
> operator causes $hash{$key} to spring into existence before the right-hand
> side is evaluated.  This doesn't happen with the = operator, though:
>
> perl -le '$a{foo} = exists $a{foo} && "bar"; print $a{foo}'
>
> ...prints nothing, as expected.  Even this prints nothing:
>
> perl -le '$a{foo} = $a{foo} . (exists $a{foo} && "bar"); print $a{foo}'
>
> So does anyone know why .= is so different?
>
> Since none of my $value scalars are undef, I can get my second code snippet
> above to do what I want by using defined() instead of exists(), but I'm
> still curious about .='s screwy behavior.

I haven't looked at the source code, but it doesn't seem unreasonable. "$a .= $b"
is
basically equivalent to "$a = $a . $b". Since there might be a resize, in general
it
wouldn't be possible to do it in-place within $a (unlike, say, += on an integer).

This means that in the general case, perl would have to evaluate $a and $b (from
left to right), then create a new variable big enough to hold the concatenated
version, then copy both into it, then point $a at it.

I guess you could try to optimise such a case, but probably to the general
detriment of the use of the operator (most of the time you won't be appending
to an undefined variable).

If my reasoning is correct, then $a will jump into existence before $b is looked
at (or
in your example, the LHS of the .= operator before the RHS).

Regards,


Ian




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

Date: Fri, 13 Oct 2000 00:42:59 -0400
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Finding Perl Modules installed on server
Message-Id: <8s640g$4ej$1@plonk.apk.net>

Can anyone help?

        I don't have telnet access to my unix server.  If I did, I could run
the following:

                find `perl -e 'print "@INC"'` -name '*.pm' -print

and receive a list of installed modules.  How can I do it from within
a perl script?

PS - I've run commands like $mysql = `which mysql` to find
if mysql was installed on the server.

Thanks,

Jody




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

Date: Fri, 13 Oct 2000 14:30:55 +0800
From: "Tommy Au" <tommyau@dotexpress.com>
Subject: Re: Finding Perl Modules installed on server
Message-Id: <8s6a6n$j8k$1@imsp026.netvigator.com>

CGI Helper:
http://www.groundbreak.com/cgi-bin/newsite/mailfile.cgi?to_download=CGI+Help
er

--
ICQ# : 497179




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

Date: Fri, 13 Oct 2000 05:16:39 GMT
From: "Robert Eric Pearse" <robert_pearse@hotmail.com>
Subject: GD install errors with CPAN.pm shell
Message-Id: <XUwF5.3000$7h7.61190@typhoon.austin.rr.com>

hmmmm, am i missing something? maybe i need to install some prereq's?

here's the error message. the entire session is below.

tia,

pearse

========================================================================

Running make test
PERL_DL_NONLAZY=1
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.005/i386-linux -I/us
r/lib/perl5/5.005 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0;
runtests @ARGV;' t/*.t
t/GD................Can't load './blib/arch/auto/GD/GD.so' for module GD:
 ./blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromWBMP at
/usr/lib/perl5/5.005/i386-linux/DynaLoader.pm line 169.

 at t/GD.t line 11
BEGIN failed--compilation aborted at t/GD.t line 11.
dubious
 Test returned status 2 (wstat 512, 0x200)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/5.005/Test/Harness.pm line 288.
make: *** [test_dynamic] Error 2
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force



========================================================================

cpan shell -- CPAN exploration and modules installation (v1.48)
ReadLine support enabled


cpan> install GD

Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
Scanning cache /root/.cpan/build for sizes

  There's a new CPAN.pm version (v1.57) available!
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Going to read /root/.cpan/sources/modules/03modlist.data.gz
Running make for L/LD/LDS/GD-1.30.tar.gz
CPAN: MD5 loaded ok
Checksum for /root/.cpan/sources/authors/id/L/LD/LDS/GD-1.30.tar.gz ok
GD-1.30/
GD-1.30/bdf_scripts/
GD-1.30/bdf_scripts/README
GD-1.30/bdf_scripts/cvtbdf.pl
GD-1.30/bdf_scripts/bdftogd
GD-1.30/demos/
GD-1.30/demos/shapes.pl
GD-1.30/demos/brushes.pl
GD-1.30/demos/gd_example.cgi
GD-1.30/demos/fonttest
GD-1.30/demos/font_list.png
GD-1.30/demos/copies.pl
GD-1.30/demos/transform.pl
GD-1.30/demos/truetype_test
GD-1.30/demos/tile.png
GD-1.30/demos/polys.pl
GD-1.30/demos/fills.pl
GD-1.30/demos/ttf.pl
GD-1.30/MANIFEST
GD-1.30/t/
GD-1.30/t/frog.xpm
GD-1.30/t/test.out.2.png
GD-1.30/t/Generic.ttf
GD-1.30/t/test.out.3.png
GD-1.30/t/test.out.4.png
GD-1.30/t/frog.jpg
GD-1.30/t/test.out.5.png
GD-1.30/t/test.out.6.png
GD-1.30/t/test.out.7.png
GD-1.30/t/test.out.8.png
GD-1.30/t/GD.t
GD-1.30/t/test.out.9.png
GD-1.30/t/tile.png
GD-1.30/t/test.out.10.png
GD-1.30/README.unix
GD-1.30/GD.pm
GD-1.30/README.QUICKDRAW
GD-1.30/README
GD-1.30/patch_gd.pl
GD-1.30/Makefile.PL
GD-1.30/qd.pl
GD-1.30/GD.xs
GD-1.30/ChangeLog
GD-1.30/typemap
Removing previously used /root/.cpan/build/GD-1.30

  CPAN.pm: Going to build L/LD/LDS/GD-1.30.tar.gz

NOTICE: This module requires libgd 1.8.3 or higher (shared library version
4.X).

Please choose the features that match how libgd was built:
Build JPEG support? [y]
Build FreeType support? [y]
Build XPM support? [y]

If you experience compile problems, please check the @INC, @LIBPATH and
@LIBS
arrays defined in Makefile.PL and manually adjust, if necessary.

Checking if your kit is complete...
Looks good
Writing Makefile for GD
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/GD
mkdir blib/lib/auto
mkdir blib/lib/auto/GD
mkdir blib/man3
cp patch_gd.pl blib/lib/patch_gd.pl
cp GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp qd.pl blib/lib/qd.pl
/usr/bin/perl -I/usr/lib/perl5/5.005/i386-linux -I/usr/lib/perl5/5.005
/usr/lib/perl5/5.005/ExtUtils/xsubpp -object_capi  -typemap
/usr/lib/perl5/5.005/ExtUtils/typemap -typemap typemap GD.xs >xstmp.c && mv
xstmp.c GD.c
cc -c -I/usr/local/include -I/usr/local/include/gd -Dbool=char -DHAS_BOOL -D
_REENTRANT -DDEBIAN -I/usr/local/include -O2    -DVERSION=\"1.30\" -DXS_VERS
ION=\"1.30\" -fPIC -I/usr/lib/perl5/5.005/i386-linux/CORE -DHAVE_JPEG -DHAVE
_TTF -DHAVE_XPM GD.c
GD.xs: In function `XS_GD__Image__newFromJpeg':
GD.xs:494: warning: assignment makes pointer from integer without a cast
GD.xs: In function `XS_GD__Image__newFromWBMP':
GD.xs:519: warning: assignment makes pointer from integer without a cast
GD.xs: In function `XS_GD__Image_newFromXpm':
GD.xs:539: warning: assignment makes pointer from integer without a cast
Running Mkbootstrap for GD ()
chmod 644 GD.bs
LD_RUN_PATH="/usr/lib:/lib:/usr/X11R6/lib" cc -o
lib/arch/auto/GD/GD.so  -shared -L/usr/local/lib
GD.o    -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/local/lib -lgd -lpng -lz -ltt
f -ljpeg -lm -lX11 -lXpm
chmod 755 blib/arch/auto/GD/GD.so
cp GD.bs blib/arch/auto/GD/GD.bs
chmod 644 blib/arch/auto/GD/GD.bs
Manifying blib/man3/GD.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.005/i386-linux -I/us
r/lib/perl5/5.005 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0;
runtests @ARGV;' t/*.t
t/GD................Can't load './blib/arch/auto/GD/GD.so' for module GD:
 ./blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromWBMP at
/usr/lib/perl5/5.005/i386-linux/DynaLoader.pm line 169.

 at t/GD.t line 11
BEGIN failed--compilation aborted at t/GD.t line 11.
dubious
 Test returned status 2 (wstat 512, 0x200)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/5.005/Test/Harness.pm line 288.
make: *** [test_dynamic] Error 2
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force


cpan> exit

Lockfile removed.





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

Date: Fri, 13 Oct 2000 04:51:26 GMT
From: peliknish@my-deja.com
Subject: Giant Array Delay (beginner)
Message-Id: <8s64cd$r3g$1@nnrp1.deja.com>

howdy,
Just starting to learn perl/cgi.

Got a script working (by Matt Wright) that picks random strings from a
list of strings in a text file delimited by whatever.

Here's the script:
http://www.worldwidemart.com/scripts/cgi-bin/download.cgi?
s=rand_text&c=txt&f=rand_text.pl

The problem is I want to use it with a huge file--60,000 words--and it
doesn't work.  The SSI returns nothing, I guess due to some kind of
time out.

So my question is:  How do i need to alter this script so that it will
work with a giant file like mine? It appears to me that the problem is
that the array of 60,000 is re-created with every call of the
script. True?  If so is there a way to make it persist?  Do I need to
hard code the array of words right into the .pl file?  Or would that be
just as
slow?

TIA
kurt

-------------------------
http://www.beagleton.com/
Cats Eating Leaves Well


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


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

Date: Thu, 12 Oct 2000 16:02:07 -0400
From: "Michael D. Hofer" <mhofer@jpmorgan.com>
Subject: Re: How can I add 5 hours to the time my server reports?
Message-Id: <39E618BF.7194EEAC@jpmorgan.com>

nobull@mail.com wrote:
> 
> "Ben Graves" <ben.graves@virgin.net> writes:
> 
> > How do I add five hours to the time it reports in a way that also changes
> > the date?
> 
> Set $ENV{TZ} to the appropriate zone before calling localtime().
> Details of the syntax/semantics of $ENV{TZ} are OS dependant but
> you'll probably find 'GMT0BST' works for the UK timezone.
> 
> > I would like it to display the date in the following format;
> > Mon 5th September, 2000

I'm probably missing something, but how about localtime(time + (5 * 60 *
60)) ??

Perhaps there was more requirement in the original message.

-- 
Michael D. Hofer
Internet Services


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

Date: Fri, 13 Oct 2000 06:24:01 GMT
From: "Schwieterman, Chad" <cschwieterman@home.com>
Subject: MLDBM db Q.
Message-Id: <5UxF5.139131$Qx4.4178788@news1.rdc1.il.home.com>

I am using the MLDBM module to store a hash of hashes in a database. The
problem is that I cannot delete the entries.

The entry looks like this:
$MlDbM{'Email' => ['test'],'Name' => ['testing'],'ICQ' => ['tester']}Testing

sub deleteProfile{
  # $db_loc is the location of the database
  # $mode is 0640
  # use MLDBM 'DB_File';
  # $user is the user I am trying to delete. In this case Testing.

  tie %DBMHASH, 'MLDBM', $db_loc, O_CREAT|O_RDWR, $mode or bail("Cannot
access the database, $!");

    if($DBMHASH{$user}){  #checks to see if user exists (this works)
       delete $DBMHASH{$user}; #does not delete the member.. why?
    }

  untie %DBMHASH;
}




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

Date: Fri, 13 Oct 2000 03:55:12 GMT
From: abevec@my-deja.com
Subject: Re: perl cgi-bin error problem - beginner
Message-Id: <8s612u$omh$1@nnrp1.deja.com>

In article <87y9zt25m2.fsf@limey.hpcc.uh.edu>,
  Tony Curtis <tony_curtis32@yahoo.com> wrote:
> >> On Thu, 12 Oct 2000 19:12:06 GMT,
> >> abevec@my-deja.com said:
>
> > I'm running Apache/Linux server and when my Perl cgi
> > script tries to execute I get the following error from
> > Apache error log any pointers to a begginer?
>
> > from error log:
>
> > [Thu Oct 12 15:00:12 2000] [error] (8)Exec format error:
>
> You haven't installed a perl compiled for another
> architecture have you?
>
> Try:     file /usr/bin/perl
>
> and see what it reports.  On my i386 linux box:
>
>   /usr/bin/perl: ELF 32-bit LSB executable, Intel 80386, \
>        version 1, dynamically linked (uses shared libs), not stripped
>
> Either that or /usr/bin/perl might not be what you think
> it is.
>
> >  #!/usr/bin/perl $temp=$ENV{'QUERY_STRING'};
>
> Ewwww.  Switch to CGI.pm, it'll make life a lot easier.
>
>     perldoc CGI
>
> hth
> t
> --
> Eih bennek, eih blavek.
>


Thanks for everyone's help. You guys are really kind and smart.   I
rewrote  the program slightly differently and also wrote a short script
to print out the environment variables.

I would like to pass this debugging trick to everyone who was so kind to
help.  I wrote a simple script to print out the environment variables
and then looked at my cgi-code and found out where I was scewing up.

Here's the script if you want to use to print out your environment
variables when testing cgi scripts, there's probably an easier way with
Objects:

env.pl:

!/usr/bin/perl

print "Content-type: text/html\n\n";
foreach $key (keys(%ENV)){
print "\$ENV{$key}=\"$ENV{$key}\"<br>\n";
}
exit

abevec
"Head Banging and Persistence Pays of in Programming But Causes
Headaches"


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


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

Date: Fri, 13 Oct 2000 04:19:08 GMT
From: rathmore@tierceron.com
Subject: Re: Perl Watching Perl?
Message-Id: <8s62fp$pj2$1@nnrp1.deja.com>


> The doc for Net::FTP indicates a timeout option to the 'new' method.
> Does that not work?  I'd also look at turning on the debug method and
> watching what is going on when the program hangs.

Trouble with the debugger is that it doesn't hang everytime, just
occassionally, and Net::FTP does a ton of stuff so stepping through the
code takes forever!

I'll reread the docs on Net::FTP and see what I missed.

Rathmore


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


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

Date: Thu, 12 Oct 2000 21:59:59 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Plz help - Perl Q
Message-Id: <5LwF5.2762$tA6.550549@news.uswest.net>

Hi folks,
    I have a Perl question & have read many many FAQs, books, web sites (TY
Godzilla), newsgroups, etc. I have almost got it, but am missing the last
piece.
    My question is: If I have to lock more than 1 file in a script, should I
undefine $OFH after each use? Or maybe use a different scalar designator for
the flush each use? Or do I need to only flush once per script?
    Below is the code I am using.
        Thanks a million!!!
            Michael

Fcntl qw(:DEFAULT :flock);
open (MEMBERS, "db/members") or die("Unable to open db/members: $!");
$OFH=select(MEMBERS); $| = 1; select($OFH);
flock(MEMBERS, LOCK_EX) or die "can't write-lock db/members: $!";
while ($line=<MEMBERS>)
{
  chomp $line;
  @line=split(/:/,$line);
  $userexists=$line[0];
  if ( ($userexists) eq ($regdata{"Pool Number"}) )
  {
    $rawinfo=$exists;
  }
}
close (MEMBERS);

--
== CigarPool ==
http://www.cigarpool.com



== CigarPool ==
http://www.cigarpool.com



--
== CigarPool ==
http://www.cigarpool.com





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

Date: Fri, 13 Oct 2000 05:13:05 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Plz help - Perl Q
Message-Id: <x74s2hxr19.fsf@home.sysarch.com>

>>>>> "MC" == Michael Cook <mikecook@cigarpool.com> writes:

  MC>     I have a Perl question & have read many many FAQs, books, web
  MC> sites (TY Godzilla), newsgroups, etc. I have almost got it, but am

you have a major mistake listed there. you accepted help from
moronzilla. you have to be decontaminated before any regulars can help
you. any help you got from her is wrong and useless. 

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 12 Oct 2000 22:42:43 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Plz help - Perl Q
Message-Id: <39E6A0D3.4A00F705@stomp.stomp.tokyo>

Uri Guttman wrote:
 
> > Michael Cook wrote:
 
> > I have a Perl question & have read many many FAQs, books, web
> > sites (TY Godzilla), newsgroups, etc. I have almost got it, but am
 
> you have a major mistake listed there. you accepted help from
> moronzilla. you have to be decontaminated before any regulars can help
> you. any help you got from her is wrong and useless.



Your claiming Perl Online Documentation to be
wrong and useless does help to explain why you
know so little about Perl and Perl Programming.


Godzilla!


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

Date: Fri, 13 Oct 2000 06:13:11 GMT
From: tokpela@my-deja.com
Subject: Re[2]: Invoking ssh from a script
Message-Id: <8s695j$ugl$1@nnrp1.deja.com>

Hi Dave,

Check out IPC::Session on search.cpan.org

The only thing that the module author didn't add in is the
password/challenge - so you will
have to enter your password manually or create a work-around using
rhosts or Expect or....?

Any suggestions on this end would be appreciated since this is exactly
what I would like to
automate myself ;-)

Sincerely,

Christopher Taranto

In article <slrn8u9rqe.5cc.esper@pchan.dojo>,
  esper@news.visi.com (Dave Sherohman) wrote:
> I'm trying to put together a utility script to do a little remote
maintenance
> via ssh.  My first attempt (included below) fails.  It invokes ssh,
but ssh
> refuses to allocate a pty because stdin isn't a terminal.  My script
then
> fails to recognize any data as being received from the ssh process, it
just
> blocks on the while(...<SSHREAD>).
>
> What do I need to do to get SSHREAD and SSHWRITE hooked up to ssh's
stdin and
> stdout?  (Oh, one other complication - although it's not present in
this
> example, the final version will need to manage multiple concurrent ssh
> sessions, so anything dependent on using specific file descriptiors
won't
> work in the long term.)
>
> ---
> #!/usr/bin/perl -w
> use strict;
>
> use IPC::Open2;
>
> # Read command line
> my $host = shift;
> my $user = shift;
> my $password = shift;
>
> my $ssh_prompt = undef;
> my $ssh_pid = open2(*SSHREAD, *SSHWRITE, "ssh $host -l $user")
>               || die "ssh invocation failed!  $!";

>

> while (!$ssh_prompt && <SSHREAD>) {
>   print;
>
>   print SSHWRITE "$password\n"  if /password:$/;
>   $ssh_prompt = $_              if /[\$#]$/;
> }
>
> print "\n(Found prompt: \"$ssh_prompt\")\n";
>
> print SSHWRITE "exit\n";
>
> --
> "Two words: Windows survives." - Craig Mundie, Microsoft senior
strategist
> "So does syphillis. Good thing we have penicillin." - Matthew Alton
> Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+
o+
> !K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++
y+
>



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


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

Date: Fri, 13 Oct 2000 12:52:03 +0600
From: "Yura N.Kryukov" <yura@wsr.ru>
Subject: search engine in perl?
Message-Id: <39E6B113.777178D0@wsr.ru>

somebody know how quickly search with template in more than 1000 files?

thaks



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

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


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