[10133] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3726 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 16 07:07:36 1998

Date: Wed, 16 Sep 98 04:00:20 -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, 16 Sep 1998     Volume: 8 Number: 3726

Today's topics:
        a big and incredible decriptor problem lamiral@mail.dotcom.fr
    Re: Any Perl 5.005 binary build for win32? dave@mag-sol.com
    Re: Determine NT Logon Server? (Willie Wanker)
    Re: Edit in place problem with ActivePerl 5.005_002 dave@mag-sol.com
        Get words out of a string. <bill@highwater.co.uk>
    Re: Get words out of a string. <egwong@netcom.com>
    Re: Help me with subroutine from "Learning Perl" book (David A. Black)
    Re: Help with Perl problem (Bob Trieger)
    Re: Help with Perl problem (Larry Rosler)
    Re: how safe is xor encryption ? (Allan Peda)
        image conversions <stuart@dune-concept.com>
    Re: image conversions <Tony.Curtis+usenet@vcpc.univie.ac.at>
        leading  space <sameers@ece.rutgers.edu>
    Re: leading  space <egwong@netcom.com>
        Mail::Internet <kar@webline.dk>
        pass dynamic output through ASP engine <mpryor@shareone.com>
        Perl and the GD-Library <internet@reimer.ch>
    Re: Perl and the GD-Library (Honza Pazdziora)
        perl5.004_04 make failed <bunnmeister@cyberdude.com>
    Re: Regex strange behavior (Patrick Timmins)
    Re: Searching a File for String (Lars Gregersen)
    Re: Shopping Cart Systems birgitt@my-dejanews.com
        STDOUT into array (Steffen Golz)
    Re: STDOUT into array <tom@smart.ruhr.de>
        to greg bacon (MercuryZ)
        Warning - completely non-PERL content - was Re: Shoppin <duff@duffduff.com>
        win32:ODBC/Oracle->terrible perormance <rottmar@deutschland.de>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 16 Sep 1998 10:26:53 GMT
From: lamiral@mail.dotcom.fr
Subject: a big and incredible decriptor problem
Message-Id: <6to3pc$j66$1@nnrp1.dejanews.com>

Hello,

I have got a big problem with Netscape binary files from the SuiteSpot
suite.   Yes,  stay here, it's    a  "perl" question,   perhaps a Unix
one. After a blind diagnostic (See  the details further) it seems that
those binary Netscape files  are ugly and  mess up their father's file
descriptors.

I run  them from a shell script.  I run the  shell script from MON.  I
would  like  to stop  the father  file   descriptor inheritance. Is it
possible ?

Here are the details :

I use MON http://www.kernel.org/software/mon  to monitor  Web servers,
News servers, messaging servers, ldap server, etc.

Servers can  go down so I restart  them automatically. I put an system
call   with backquote  `/opt/netscape/foo.sh` to  stop   and start the
servers (I like verbose output).

This is the same thing than a command line invocation, isn't it ?

The problem follows :

MON  run a client-server  mode on port 32777.  nothing  to do with the
system call, of course, but this detail is important.

Example: When MON detects a big problem on the mail  server it runs an
alarm (a  very simple shell  script). This alarm  stops and starts the
mail server like this :

#/bin/sh
# file  stop-start-NscpMail.sh

echo stopping Nescape Mail server
/opt/netscape-suiteSpot/bin/mail/server/NscpMail shutdown

echo starting Nescape Mail server
/opt/netscape-suiteSpot/bin/mail/server/NscpMail

echo Finished
# End of script

In  command ligne this  script runs very well  : The SMTP server start
listening on port 25 (smtp).

>From a perl script invocation  using sockets (for something else), the
SMTP server starts  listening the port  32777 (in MON case). Hopefully
lsof exists to see  that.   It is incredible  but  true and very  very
boring.

A solution ?

Thanks in advance.

Gilles. Rennes, France.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 16 Sep 1998 08:22:55 GMT
From: dave@mag-sol.com
Subject: Re: Any Perl 5.005 binary build for win32?
Message-Id: <6tnsgs$b48$1@nnrp1.dejanews.com>

In article <6tn5mb$ajl$1@netnews.csie.NCTU.edu.tw>,
  dennis@info4.csie.nctu.edu.tw (GEMINI) wrote:
> Hi all,
>   The newest binary build for win32 that I can find is 5.004,
> a binary distribution built by Borland C. I've tried to
> make one from the 5.005_02 source but got a failure.
> I am wondering if some one has made it? where can I get it?
> thanks.
>

Dennis,

Try ActiveState <http://www.activestate.com>.

hth,

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 16 Sep 1998 06:33:13 GMT
From: williw@wank.com (Willie Wanker)
Subject: Re: Determine NT Logon Server?
Message-Id: <35ff5b3e.92775706@enews.newsguy.com>

The logon server is in the enviroment. Open a dos window and type set.


LOGONSERVER=\\xxxxxxxxxxx

Should be easy to grab it.


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

Date: Wed, 16 Sep 1998 07:55:05 GMT
From: dave@mag-sol.com
Subject: Re: Edit in place problem with ActivePerl 5.005_002
Message-Id: <6tnqso$8ej$1@nnrp1.dejanews.com>

Ben,

Thinking further about it, I think that some PC versinos of Perl come come
with a file (glob.exe?) which simulates wildcard expansion. This may be what
you need.

Dave...


In article <6tm0f9$4g1$1@nnrp1.dejanews.com>,
  benday@c-bridge.com wrote:
> You were right about the wild card not expanding.  I tried running it under NT
> Korn Shell and it worked.
>
> The reason I say that this is ActivePerl is that I've run this type of perl
> program from the regular NT4 command line shell and it worked....but I was
> using a different flavor of perl.
>
> I've found a work around but I'd still like to run this using the regular NT
> shell.
>
> In article <6tl7nq$9pv$1@nnrp1.dejanews.com>,
>   dave@mag-sol.com wrote:
> > In article <6tjvrv$p4o$1@nnrp1.dejanews.com>,
> >   benday@c-bridge.com wrote:
> > > I've used the following command a billion times but never with ActivePerl
> > > for NT.
> > >
> > > perl -p -i.bak -e "s/foo/bar/g;" *.htm
> > >
> > > It says "Can't open *.htm: Invalid argument"
> > >
> > > I'm baffled.
> > >
> > > Does anyone what what I'm doing wrong?
> >
> > This isn't a Perl problem. You're using a shell that doesn't do automatic
> > wildcard expansion before passing the command line to a program. This is a
> > *bad* thing.
> >
> > Use Unix.

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 16 Sep 1998 09:33:45 +0100
From: Billy Bagshaw <bill@highwater.co.uk>
Subject: Get words out of a string.
Message-Id: <35FF77E8.697F704C@highwater.co.uk>

Hi,
    All I want is a list of words that, in the original string, were
seperated my any number of tabs or white space.

@words = split("fred\t \tjohn \t  Jane",?????);

Please email me if you can.
Thanks, Billy B.




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

Date: Wed, 16 Sep 1998 08:48:34 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: Get words out of a string.
Message-Id: <egwongEzDCGy.29n@netcom.com>

Billy Bagshaw <bill@highwater.co.uk> wrote:
: Hi,
:     All I want is a list of words that, in the original string, were
: seperated my any number of tabs or white space.

: @words = split("fred\t \tjohn \t  Jane",?????);

  @words = split( /\s+/, $string );

Use of split is detailed in the perlfunc manpage.  The
perlre manpage will explain the PATTERN.

Eric

[cc'd]


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

Date: Tue, 15 Sep 1998 17:16:10 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Help me with subroutine from "Learning Perl" book
Message-Id: <6tmleq$j1v$1@earth.superlink.net>

Hello -

sofianb@tc.umn.edu writes:

>	} elsif (($words{somename} || "groucho") eq $someguess) {
                        ^^
That should be $words{$somename}


David Black
dblack@saturn.superlink.net


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

Date: Wed, 16 Sep 1998 07:10:13 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Help with Perl problem
Message-Id: <6tno88$sms$3@strato.ultra.net>

[ posted to usenet and courtesy e-mail sent ]

mike @debtware.co.uk wrote:
-> Can anyone kelp me please. I am trying to write a perl program where I
-> pass two arguments on then command line. The first is the input file
-> the second is the output file.
-> 
-> The command line reads:
-> 
-> perl myprog.pl filename1 filename2
-> 
-> In the code I have:
-> 
-> $file1 = @ARGV[0]
-> $file2 = @ARGV[1]
-> 
-> open (InFile, $file1);
-> open (OutFile, $file2);
-> 
-> When I run it OutFile will not open. I am running perl 5 under dos.

What do you mean it isn't opening? How can you tell? You should always 
check the status of your opens. 

Do you mean to say that you can't write to it because you are opening it 
for reading?

Try changing the line where you open it to:
        open OutFile,">$file2" or die "Can't open $file2: $!";

The greater than thingie says that the file is to be opened for writing.
If the open fails, $! will contain the error message.
 

HTH 

Bob Trieger              | `Sparks International' is spamming and 
sowmaster@juicepigs.com  | trying to help us lose weight. Let's do 
                           them a favor. Call to let the know that
                           spamming is evil and do it on their dime.

                           Call 1-888-689-3097


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

Date: Wed, 16 Sep 1998 00:30:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help with Perl problem
Message-Id: <MPG.106909063b1673bb98985d@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35ff46d5.1266349@news.netkonect.co.uk> on Wed, 16 Sep 1998 
05:10:56 GMT, mike @debtware.co.uk <mike @debtware.co.uk> says...
 ... 
> The command line reads:
> 
> perl myprog.pl filename1 filename2
> 
> In the code I have:
> 
> $file1 = @ARGV[0]
> $file2 = @ARGV[1]

Bob Trieger took care of the rest (the 'open's), so I will focus here.

First of all, this cannot be what your program says, because it doesn't 
compile as written.  So let's add the required semicolons.

Now it compiles, but it still isn't quite right.  Use the '-w' flag 
(ALWAYS use the '-w' flag) to see why.  You can learn more about this in 
perlfaq4:  "What is the difference between $array[1] and @array[1]?"

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


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

Date: Wed, 16 Sep 1998 09:28:41 GMT
From: allan@interport.net (Allan Peda)
Subject: Re: how safe is xor encryption ?
Message-Id: <35ff839e.21743886@news.interport.net>

As a first guess... look into calling crypt() on a key generated by a
call to rand().  Save the encrypted key in another database, perhaps
on another machine?  There is also a module called Crypt.

In any event it's a heck of a lot better than XOR

On Wed, 16 Sep 1998 00:49:34 -0400, rjk@coos.dartmouth.edu (Ronald J
Kimball) wrote:

><beyret@my-dejanews.com> wrote:
>
>> I am about to write a simple script to encrypt/decrypt credit card numbers
>> using xor and a key supplied by credit card owner. I wanted to learn your
>> thoughts about it:
>
>What exactly is your Perl question?
>
>If I'm not mistaken, xor encryption could be implemented in any
>programming language.  Thus, this is not a Perl issue at all.  Try a
>security or encryption newsgroup.
>
>-- 
> _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
>( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
>    /                                  http://www.ziplink.net/~rjk/
>        "It's funny 'cause it's true ... and vice versa."



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

Date: Wed, 16 Sep 1998 09:34:16 +0200
From: "Stuart" <stuart@dune-concept.com>
Subject: image conversions
Message-Id: <6tnplt$64$1@buggy.easynet.fr>

Hello,

I've been asked to write a module to convert any uploaded image file to .gif
or .jpeg

My first thought was a Java servlet but performance worries make that
impossible. Has anyone tried such a thing in Perl. Any ideas for an
implementation would be welcome.

cheers,
Stuart.







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

Date: 16 Sep 1998 09:38:40 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: image conversions
Message-Id: <83af405wxr.fsf@vcpc.univie.ac.at>

Re: image conversions, Stuart <stuart@dune-concept.com>
said:

Stuart> Hello, I've been asked to write a module to convert
Stuart> any uploaded image file to .gif or .jpeg

Stuart> My first thought was a Java servlet but performance
Stuart> worries make that impossible. Has anyone tried such
Stuart> a thing in Perl. Any ideas for an implementation
Stuart> would be welcome.

A few ideas come to mind specifically for perl (although you
might like to try asking this question more generally in a
graphics related newsgroup):

1. use the ImageMagick module

2. run ImageMagick's `convert' program via system().

3. system() with any other suitable convertor.

#1 would be my favourite if there was a compelling reason to
use perl (but then, there always is :-)

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Wed, 16 Sep 1998 04:29:10 -0400
From: Sameer Sharma <sameers@ece.rutgers.edu>
Subject: leading  space
Message-Id: <35FF76D6.3D25@ece.rutgers.edu>

Hi,
When i read an entire file into an array 
@array = <FILENAME>
and then print this array into another file FILENAME1
print FILENAME1(@array)
after doing some modifications on the array, I get a leading  space 
in the lines written to FILENAME1. Why is this happening? Can it be
avoided?
-- 
________________________________________________________________
   Sameer Sharma (Teaching Assistant-Electrical and Computer 
   Engineering)  Rutgers-The State University of New Jersey
   Tel(O):732-445-0598 (Lab):732-445-0570 (H):732-878-1815
     Address:(for correspondence)  23853 BPO WAY 
  Piscataway NJ 08854-8138 (Residence) Apt # 385 Buell Apartments 
    Busch Campus (Rutgers University)  Piscataway NJ 08855
                E-Mail:sameers@ece.rutgers.edu     
________________________________________________________________


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

Date: Wed, 16 Sep 1998 08:54:38 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: leading  space
Message-Id: <egwongEzDCr2.35q@netcom.com>

Sameer Sharma <sameers@ece.rutgers.edu> wrote:
: Hi,
: When i read an entire file into an array 
: @array = <FILENAME>
: and then print this array into another file FILENAME1
: print FILENAME1(@array)
: after doing some modifications on the array, I get a leading  space 
: in the lines written to FILENAME1. Why is this happening? Can it be
: avoided?

Yes, it can be avoided.  As to why it's happening, I suspect
you ought to see what the "modifications" that you mention
are doing.

A quick fix is to run the array through a foreach loop and
just remove the leading space before you print it out again:
  foreach (@array) { s/\s+//; }

Eric
[cc'd]




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

Date: Wed, 16 Sep 1998 09:11:12 +0200
From: Kaare Rasmussen <kar@webline.dk>
Subject: Mail::Internet
Message-Id: <35FF648F.C1A80FA8@webline.dk>

Anything wrong with this?

#!/usr/bin/perl -w
use Mail::Internet;
use Mail::Util qw(read_mbox);

$wrkfile="a_mailbox";
@mails=read_mbox($wrkfile);
for $mails (@mails) {
 $m = Mail::Internet->new($mails);

 $m->remove_sig;
 $m->tidy_body;
 $m->print_header;
 $m->print_body;
}

I get what I expect for the most part. But in a mailbox with 8
messages,  only get 6 printed with this approach. A mailbox with 98
messages is down to 92.



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

Date: Tue, 15 Sep 1998 15:45:09 -0500
From: Mark Pryor <mpryor@shareone.com>
Subject: pass dynamic output through ASP engine
Message-Id: <35FED1D5.7FCD@shareone.com>

I have a cgi script that does a bunch of proprietary database queries
and dynamically produces an html page containing ASP tags.  

The problem is that the output is just thrown to STDOUT leaving the ASP
tags intact.  Is there a way to send the dynamically created contents
through the ASP engine?

TIA!


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

Date: Wed, 16 Sep 1998 12:02:11 +0200
From: Patrick Stalder <internet@reimer.ch>
Subject: Perl and the GD-Library
Message-Id: <35FF8CA3.BEA8A73E@reimer.ch>

Hi,

Has anyone experience with the GD library for graphics?
I can create a graphic and save this as gif-file. But when I would load
a gif-file (I try several files), the system gives an error message an
crash. I can load and use a gd file without problems.
I use Perl 5.004_02 with Windows 95 / NT. The system crash on both
systems.

Thanks for any help


Patrick




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

Date: Wed, 16 Sep 1998 10:31:25 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Perl and the GD-Library
Message-Id: <slrn6vv4rt.adc.adelton@aisa.fi.muni.cz>

On Wed, 16 Sep 1998 12:02:11 +0200, Patrick Stalder <internet@reimer.ch> wrote:
> Hi,
> 
> Has anyone experience with the GD library for graphics?
> I can create a graphic and save this as gif-file. But when I would load
> a gif-file (I try several files), the system gives an error message an
> crash. I can load and use a gd file without problems.

If we knew the error message, we could come from just plain guessing
to some analysis of what is going on in your computer.

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 15 Sep 1998 17:41:02 -0500
From: bunn <bunnmeister@cyberdude.com>
Subject: perl5.004_04 make failed
Message-Id: <35FEECFD.C127CA6E@cyberdude.com>

I hope someone can help me out with this make failing problem.  Anyway,
am trying to build perl on a solaris 2.6 with the compiler from sun.
Below is the errors that I got.  I also included my 'myconfig'.  Any
help or suggestion would be appreciated.

myconfig file:
-------------
#!/bin/sh

# This script is designed to provide a handy summary of the
configuration
# information being used to build perl. This is especially useful if you

# are requesting help from comp.lang.perl.misc on usenet or via mail.

if test -f config.sh; then TOP=.;
elif test -f ../config.sh; then TOP=..;
elif test -f ../../config.sh; then TOP=../..;
elif test -f ../../../config.sh; then TOP=../../..;
elif test -f ../../../../config.sh; then TOP=../../../..;
else
        echo "Can't find the perl config.sh file produced by Configure";
exit 1
fi
 . $TOP/config.sh

# Note that the text lines /^Summary of/ .. /^\s*$/ are copied into
Config.pm.
# XXX Add d_sigaction (?) once it's defined.

$spitshell <<!GROK!THIS!

Summary of my $package ($baserev patchlevel $PATCHLEVEL subversion
$SUBVERSION)
configuration:
  Platform:
    osname=$osname, osvers=$osvers, archname=$archname
    uname='$myuname'
    hint=$hint, useposix=$useposix, d_sigaction=$d_sigaction
    bincompat3=$bincompat3 useperlio=$useperlio d_sfio=$d_sfio
  Compiler:
    cc='$cc', optimize='$optimize', gccversion=$gccversion
    cppflags='$cppflags'
    ccflags ='$ccflags'
    stdchar='$stdchar', d_stdstdio=$d_stdstdio, usevfork=$usevfork
    voidflags=$voidflags, castflags=$castflags, d_casti32=$d_casti32,
d_castneg=
$d_castneg
    intsize=$intsize, alignbytes=$alignbytes, usemymalloc=$usemymalloc,
prototyp
e=$prototype
  Linker and Libraries:
    ld='$ld', ldflags ='$ldflags'
    libpth=$libpth
    libs=$libs
    libc=$libc, so=$so
    useshrplib=$useshrplib, libperl=$libperl
  Dynamic Linking:
    dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun,
ccdlflags='$ccdlflags'
    cccdlflags='$cccdlflags', lddlflags='$lddlflags'

!GROK!THIS!


my make error:
---------------
 ...
cd x2p; make depend
sh ../makedepend MAKE=make
make: Warning: Both `makefile' and `Makefile' exist
Current working directory /block1/perl/perl5.004_04/x2p
echo hash.c malloc.c str.c util.c walk.c | tr ' ' '\012' >.clist
Finding dependencies for hash.o.
Finding dependencies for malloc.o.
Finding dependencies for str.o.
Finding dependencies for util.o.
Finding dependencies for walk.o.
make: Warning: Both `makefile' and `Makefile' exist
Current working directory /block1/perl/perl5.004_04/x2p
echo Makefile.SH cflags.SH | tr ' ' '\012' >.shlist
Updating makefile...
Now you must run a make.
# # # # # # mak
mak: not found
# make
make: Warning: Both `makefile' and `Makefile' exist
`sh  cflags libperl.a miniperlmain.o`  miniperlmain.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a perl.o`  perl.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O

 ...

          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a taint.o`  taint.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a deb.o`  deb.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a universal.o`  universal.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a globals.o`  globals.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
`sh  cflags libperl.a perlio.o`  perlio.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
rm -f libperl.a
ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o
pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o globals.o
perlio.o
cc  -L/usr/local/lib -o miniperl miniperlmain.o libperl.a -lsocket -lnsl
-ldl -lm -lc -lcrypt
Undefined                       first referenced
 symbol                             in file
__builtin_next_arg                  libperl.a(util.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'
#





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

Date: Wed, 16 Sep 1998 06:49:03 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Regex strange behavior
Message-Id: <6tnn0v$33h$1@nnrp1.dejanews.com>

In article <6tnfqg$rhi$1@nnrp1.dejanews.com>,
  filippomorelli@my-dejanews.com wrote:
> I'm trying to match tags in a document and am having no luck:
>
> For example, say you want to match <FOO_*> in a line that contains
> <FOO_BAR></FOO_BAR>
>
> $tag = '<FOO';
> $line = '<FOO_BAR></FOO_BAR>junk';
>
> $line =~ /($tag.*)>/;
> print "Found [$1]\n";
>
> This will print out, [<FOO_BAR></FOO_BAR]. What I want is [<FOO_BAR]. It
> seems that .* matches all the characters up until the last occurance of the
> remaining expression (which is the above case, is simply a greater than
> character '>').
>
> I can not finding any explanation in Larry Wall's book or on the newsgroup of
> how to match n or more non-whitespace up until the first instance (rather than
> the last) of a specific character. The above results, IMHO, are counter
> intuitive.

Page 63 of the Camel, 2nd Edition, or perlfaq6 - Regexps:
What does it mean that regexps are greedy? How can I get around it?

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 16 Sep 1998 08:16:22 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Searching a File for String
Message-Id: <35ff7348.3350744@news.uni-c.dk>

[posted and mailed]
On Tue, 15 Sep 1998 06:55:04 GMT, "Steven McPherson"
<stevenmc@home.com> wrote:

>Hi all-
>
>I was wondering if anyone might be willing to give me a suggestion of how to
>open and read and file for a particular string and then display what is to
>the right of the search string.

This is a non perl answer - appologies to everyone!

Maybe you just need to use the programme "grep". This almost does what
you want. If you want to programme in perl you are welcome, but it
takes some time to learn how to write the line (yes, the programme can
be written in one line) that is needed.

  Happy programming!

Lars Gregersen, M.Sc., Chem. Engng.
Technical University of Denmark
Department of Chemical Engineering
E-mail  : lg@kt.dtu.dk
Homepage: http://www.gbar.dtu.dk/~matlg/


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

Date: Wed, 16 Sep 1998 09:34:59 GMT
From: birgitt@my-dejanews.com
Subject: Re: Shopping Cart Systems
Message-Id: <6to0o3$gbs$1@nnrp1.dejanews.com>

In article <35FF2F16.E232E6D5@bbnplanet.com>,
  Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
> Phil De Paulis wrote:
>
> > Does anyone know where i would be able to find any kind of free perl/cgi
> > shopping cart systems, on the internet???
>
> Well, Phil, considering that all of us work for a living, probably not.
> Why don't you email the webmaster at amazon.com and ask them for their
> source code. I'm sure that the 2.5 million they have spent on developing
> their shopping cart system won't bother them on giving you their source.
>

Considering that you can build sites like amazon.com with free
shopping cart systems, where is the wisdom to spend 2.5 million and
hide your source code ? :-)

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 16 Sep 1998 07:25:48 GMT
From: 100.12399@germanynet.de (Steffen Golz)
Subject: STDOUT into array
Message-Id: <6tnp5s$8n3$1@newshost.germany.net>

Hallo!

I had a compressed file called daten.gz.
I would like to expand this file with "zcat -c daten.gz".
zcat copy this uncompressed information to the STDOUT cannel.
I would like to copy this information into an array, which i can
work with.
If any person had an idea, to realized this problem with perl, please
help.

Tschue
   Steffen





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

Date: 16 Sep 1998 10:17:23 +0200
From: Thomas Neumann <tom@smart.ruhr.de>
Subject: Re: STDOUT into array
Message-Id: <87u328qxnw.fsf@smart.ruhr.de>

100.12399@germanynet.de (Steffen Golz) writes:


> I had a compressed file called daten.gz.
> I would like to expand this file with "zcat -c daten.gz".
> zcat copy this uncompressed information to the STDOUT cannel.
> I would like to copy this information into an array, which i can
> work with.
> If any person had an idea, to realized this problem with perl, please
> help.

Untested:

  use IO::File;
  my $fh = new IO::File "zcat daten.gz |" or die $!;
  my @a = <$fh>;
  $fh->close;


Lines should be in @a now.

-t



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

Date: 16 Sep 98 07:45:49 GMT
From: sf@sf.com (MercuryZ)
Subject: to greg bacon
Message-Id: <35ff6cad.0@news.ptw.com>

In article <6tmfsp$g8t$1@info.uah.edu>, gbacon@cs.uah.edu says...
>
>In article <35feb006.0@news.ptw.com>,
>        sf@sf.com (MercuryZ) writes:
>: I want to automate downloads through Perl.  Lynx is my choice
>: for this.
>
>You chose poorly.  You want to use LWP or perhaps Net::FTP, both of
>which are available on the CPAN.
>
>Greg


I appreciate your response greg, but I am more curious at this point
to make Perl automatically press "D" for me...I do know Perl quite well,
but for some reason I can't seem to figure out this simple dilemma.
Can you tell me how to make Perl automatically press a key so you
can control the behaviour of a program like lynx through a telnet
shell?  

Thanks, Sean



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

Date: Wed, 16 Sep 1998 09:39:20 +0100
From: "Gary Mc Closkey" <duff@duffduff.com>
Subject: Warning - completely non-PERL content - was Re: Shopping Cart Systems
Message-Id: <6tntj2$pt8$1@ezekiel.eunet.ie>

Elaine -HappyFunBall- Ashton wrote in message
<35FF3441.845A2128@bbnplanet.com>...
           ^^^^^^^^^^^^^^^ this is sarcasm, right?
[snip]
>Call me cranky, but the 'I'm too tired to write my own
>code' has gotten really old lately.
"Cranky". If it winds you up so much (a) don't reply (b) don't reply and
save some bandwidth. (c) breathe deeply, think calm thoughts and be
thanksful you're not a white-house intern or bill clinton. Isn't life better
now?


>I would slash a vein to see someone post something evocative enough to
>get me to post some code. I like to see people try. Maybe I'm a Jesuit
>in a womans' body.
Jesuits can't be women?

>e.
--
gmc_duff@indigo.ie. Remove underscoreduff to mail me.
NOTICE TO BULK E-MAILERS: Pursuant to US Code, Title 47, Chapter 5,
Subchapter
II, 227, and all unsolicited commercial e-mail sent to this address is
subject
to a download and archival fee in the amount of $500 US.



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

Date: Wed, 16 Sep 1998 10:25:15 +0200
From: Dirk Rottmar <rottmar@deutschland.de>
Subject: win32:ODBC/Oracle->terrible perormance
Message-Id: <35FF75EB.C3D14EBF@deutschland.de>

Hi,

I just developed a cgi script which runs under NT 4.0 and connects to an
Oracle 8.0 DB-Server (on the same machine) via ODBC (oracle driver) and
win32:ODBC.

My problem is, that my queries are incredibly slow, that means, that
there are about 4000 datasets in a table. I do a SELECT which should
return about 50 rows and it takes about 5 minutes to get the results
:-(

Do I realy have to use ASP to get my queries done? PLEASE HELP.

Dirk







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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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