[6792] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 417 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 2 21:07:19 1997

Date: Fri, 2 May 97 18:00:23 -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           Fri, 2 May 1997     Volume: 8 Number: 417

Today's topics:
     Re: CGI and ftp <anirvan@crl.com>
     Re: compiling perl5.003 <rra@stanford.edu>
     Re: Creating files (jp)
     Re: Help... How do I Install Perl 5 for NT and MIIS? <amias@amias.prestel.co.uk>
     Re: How do I round things off? (jp)
     Re: How to do a "less" on a file. <anirvan@crl.com>
     Re: MacPerl <-> text editor? (Douglas P. McNutt)
     map() from many to fewer <gtk@walsh2.med.harvard.edu>
     Re: map() from many to fewer (Ilya Zakharevich)
     Re: Multi line matching problem.  Should be simple?!? <tom@geronimo.uit.no>
     newbee <gaustin@camcomp.com>
     Re: newbee <anirvan@crl.com>
     Newbie confused by all those slashes <amias@amias.prestel.co.uk>
     Re: Newbie confused by all those slashes <pmerle@france.sun.com>
     Re: Notice to antispammers <mcampbel@tvmaster.turner.com>
     Re: Perl auto-replier (jp)
     Re: Perl auto-replier (jp)
     perl/html STDIN pb, help !!!!!!! <pmerle@france.sun.com>
     Re: Perl4 script under Perl5 interpreter (Chipmunk)
     Poor performance isqlperl vs perl5+dbi+dbd (Nathan Neulinger)
     Re: program for perl? (Craig Berry)
     Re: Q: How do I ... (Chipmunk)
     Re: Regexp bug or feature? (perl claims null string mat (Chipmunk)
     scalar holds compiled code <guffey@anpi.com>
     Re: SIMPLE REG-EXP Please Help! (Chipmunk)
     Re: Undefined subroutine &main::AF_INET <tom@geronimo.uit.no>
     use statements and multiple module calls <chris@ixlabs.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 2 May 1997 22:42:45 GMT
From: Anirvan Chatterjee <anirvan@crl.com>
Subject: Re: CGI and ftp
Message-Id: <5kdql5$og6$2@nnrp1.crl.com>

-----BEGIN PGP SIGNED MESSAGE-----

Phil Williams <williams@irc.chmcc.org> wrote:
: I want to be able to have a form that once filled out properly will ftp
: a file to the user.
: I've searched around and have come up empty with how to implement this.

Your question seems a bit ambiguous to me. Do you mean that your
script will FTP a file from another site, and deliver it to the user
via HTTP? Or do you mean that it will upload a file via FTP to a
server and directory location of the user's choice?

In the first case, I believe you should be able to do it using CPAN's
LWP; in the latter, look at CPAN's Net::FTP module.

_______________________________________________________________
Anirvan Chatterjee . anirvan@crl.com . <URL:http://www.mx.org/>
PGP 0x93C5C165 . finger for PGP/geek . encrypted mail preferred
http://www.mx.org/bookfinder/ : online book comparison shopping 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM2ptXWTQ0LuTxcFlAQFcfAP6A04251WxN+WBlhxZWrzvYK7sOJonglqQ
KtzldsYrq4kYlR+IQSQAdP1lNUc1I9rpmysMoq6NFjVe+zt42aHt6f5Prga+beCX
+apNDRsWZdmS3jLFE/1dmSZuY0sUDoLFoc3spYqkMz8hKheODkor5sKqGMV36lAv
+Zxg0TDCAfQ=
=Rqk9
-----END PGP SIGNATURE-----


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

Date: 02 May 1997 14:13:41 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: compiling perl5.003
Message-Id: <qumbu6tk262.fsf@cyclone.stanford.edu>

Johann du Preez <jcdup@ats.sani.org> writes:

> When running "make" after "Configure" in an attempt to compile Perl
> 5.003 on a Digital Alpha Station 200 under Digital Unix, I get the
> following:

> 	Writing Makefile for DynaLoader
>       >>> Your Makefile has been rebuilt. <<<
>       >>> Please rerun the make command.  <<<

Umm...does rerunning the make command help?  Seriously.  I've gotten that
message before and just running make again results in a clean build.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>


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

Date: Fri, 02 May 1997 17:06:24 GMT
From: jp@here.com (jp)
Subject: Re: Creating files
Message-Id: <336e1ec3.3546662@news.cent.com>

On Sun, 27 Apr 1997 21:37:12 -0700, Darren Weiner
<weinerd@ucsub.colorado.edu> wrote:

>Another one of those "I thought I knew what I was doing, but" questions.
>
>I've been trying to create a file, using either sysopen or open.
>
>When I run the script via telnet, everything works fine.
>
>When I run the script via my browser, I DO NOT get an error, yet the
>file is not created.
>
>Thanks in advance for helping to make my world sane again...
>
>-Darren
>weinerd@ucsub.colorado.edu


Darren:
Double check your path and that you are looking for the new file in
the right directory.

Also, ignore that Tad guy,  he's a pain.


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

Date: Fri, 02 May 1997 23:43:15 +0100
From: Amias Channer <amias@amias.prestel.co.uk>
Subject: Re: Help... How do I Install Perl 5 for NT and MIIS?
Message-Id: <336A6E03.7BCA@amias.prestel.co.uk>

Gordon McDorman wrote:
> 
> "Network/Systems Technician" <support@cyberglobe.net> writes:
> 
> > I need help to install Perl 5 on Windows NT and MIIS.  I have tried and
> > still does not work.
> 
> See the Win32Perl FAQ:
> 
> <URL:http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html>
> 
> Specifically, the sections on "Availability and Installation" and
> "Web Server Configuration and Troubleshooting" are of significance.
> 
> --
> --------------------------------------------------------------
> The opinions expressed above are mine, not my employer's.
> 
> gordon.leslie.mcdorman@sap-ag.de

are you using the activeware version of Perl 5 ? if so get the IIS .DLL
addon , i can't remeber the archive name but it's in the same directory.
then follow the instructions .

Toodle-pip
Amias




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

Date: Fri, 02 May 1997 17:41:32 GMT
From: jp@here.com (jp)
Subject: Re: How do I round things off?
Message-Id: <33742690.5543601@news.cent.com>


Try this:

$thenumberiwant = sprintf("%.2f", $thenumberiwantroundedup);

On Fri, 2 May 1997 01:48:46 -0400, "Tom Kruk" <tomkruk@perfekt.net>
wrote:

>Have 
>you ever had this problem?
>
>You are doing some kind of math procedure in perl and you are
>multiplying decimals like (tax) .0825 and the result is an answer
>with as many decimals. I was wondering if someone could help
>me or point me in the right direction,
>
>If I get something like 80.0456 how do I round it to 80.05 or how do I cut
>off the 56
>to get 80.04 ???
>
>If anyone could answer I would greatly appreciate it!!
>
>Thanks 
>
>Tom
>
>
>



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

Date: 2 May 1997 22:39:30 GMT
From: Anirvan Chatterjee <anirvan@crl.com>
Subject: Re: How to do a "less" on a file.
Message-Id: <5kdqf2$og6$1@nnrp1.crl.com>

-----BEGIN PGP SIGNED MESSAGE-----

John Liao <johnliao@cs.buffalo.edu> wrote:
: open (FILE, "hugefile")|| die "can't open";
: open (OUTPUT, "less |");
: while (<FILE>){
: 	print OUTPUT $_;
: }
: close FILE;

You've got the right idea. Change that second line to

	open(OUTPUT, "| less");

and you've got yourself a working script.

_______________________________________________________________
Anirvan Chatterjee . anirvan@crl.com . <URL:http://www.mx.org/>
PGP 0x93C5C165 . finger for PGP/geek . encrypted mail preferred
http://www.mx.org/bookfinder/ : online book comparison shopping 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM2psmmTQ0LuTxcFlAQGLXgQAqAzBY6tKKg5jP8JnAzYl+LHxMvvmOodE
3GPfaXDR1EjF3kxplQ2m5gYArFHgiuqGDGEKEeuMV7YikoYW7SQ5/8wasyG1G/b+
T+7a298cKVUOCxHAstr8bUSdppoTvkgaPZkpep8/DMpzfuQQYZeBAM+1AJ0y3QpC
e4YNHXl8DFE=
=feeK
-----END PGP SIGNATURE-----


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

Date: Fri, 2 May 97 13:30:43 GMT
From: dmcnutt@macnauchtan.com (Douglas P. McNutt)
Subject: Re: MacPerl <-> text editor?
Message-Id: <dmcnutt.1212967483D@news-2.sni.net>


In Article <acs-2904971312300001@port117.bitstream.net>, acs@bitstream.net
(Adam Schneider) wrote:
>I just installed MacPerl 5 (I'd been using version 4).  My text editor of
>choice is Tex-Edit 1.8.5,

If you can come up with a few bucks for Apple get MPW - Macintosh
Programmer's Workshop. The MacPerl "tool" works the way UNIX perl is
expected to work. Also the newest MPW will highlight perl reserved words in
color. You also get the advantage of shell scripting in MPW to handle
command line arguments to Perl.

Stand-alone applications can be created using the ToolServer feature of MPW.

-> From the USA. The only socialist country that refuses to admit it. <-


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

Date: 02 May 1997 16:54:49 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: map() from many to fewer
Message-Id: <w2u3kl1tnq.fsf@walsh2.med.harvard.edu>


I've been listening to the "map is your friend" exhortations of some
of the perl experts on c.l.p.m, and have been trying to integrate the
use of map() into my programs.  For instance, I started with:

  @current = grep { $_->fragment() == $ssnum  } @atoms;
   foreach $spin (@current) {
     $current{$spin->name()} = $spin;
   }

which I could change to 

  @current = grep { $_->fragment() == $ssnum  } @atoms;
  %current = map { $_->name(),$_ } @current;

but if I tried

  %current = map { ($_->name(),$_ ) 
	if ($_->fragment() == $ssnum) } @atoms;

it doesn't work.  I've perused the FAQs, the perlfunc man page, and the
camel book, but I still don't get it.  I thought this should be doable
in a single map() statement.  Any thoughts are appreciated.

TIA,

Greg

--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro"    Finger for PGP info



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

Date: 2 May 1997 21:30:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: map() from many to fewer
Message-Id: <5kdme0$akr$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Gregory Tucker-Kellogg 
<gtk@walsh2.med.harvard.edu>],
who wrote in article <w2u3kl1tnq.fsf@walsh2.med.harvard.edu>:
> but if I tried
> 
>   %current = map { ($_->name(),$_ ) 
> 	if ($_->fragment() == $ssnum) } @atoms;
> 
> it doesn't work.  I've perused the FAQs, the perlfunc man page, and the
> camel book, but I still don't get it.  I thought this should be doable
> in a single map() statement.  Any thoughts are appreciated.

Looks like you do not know that is the value of
	A if B;
in the case when B is false ;-).  I use a ?: in such cases:

	map { $_->fragment() == $ssnum ? ($_->name(),$_ ) : () } @atoms;
	
Ilya


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

Date: 03 May 1997 00:01:19 +0200
From: Tom Grydeland <tom@geronimo.uit.no>
Subject: Re: Multi line matching problem.  Should be simple?!?
Message-Id: <ofb911xjzyo.fsf@geronimo.uit.no>

Ronald.J.Kimball@dartmouth.edu (Chipmunk) writes:

> I suppose you could do something like this:
> 
> $var =~ s/s\n?o\n?m\n?e\n?t\n?h\n?i\n?n\n?g/blablabla/;

gah.

> Or, you could do this:
> 
> $var =~ tr/\n//d;
> $var =~ s/something/blablabla/;
> 
> if you don't mind losing all your newlines.

And if you do, try

($tmp  = $var) =~ tr/\n//d;
$tmp =~ s/something/blablabla/;

> Chipmunk

-- 
//Tom dot Grydeland at phys dot uit dot no
- I don't write children's books or "Crotch Sniffing for Dummies" - E. Naggum
        The case of Randal Schwartz - http://www.lightlink.com/fors/


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

Date: 2 May 97 22:37:09 GMT
From: "Gary Austin" <gaustin@camcomp.com>
Subject: newbee
Message-Id: <01bc5749$18e63360$974c05d0@gaustin.camcomp.com>


OK I figure this is probably been covered before but I missed it since I
just started reading this group today.  What is the best way to install
perl5.  I have windowsNT 4.0 sp2.  I need to know the steps required to
install perl5 and what kind of access to the directory to insure security
concerns are taken care of the best way.  Thanks in advance.



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

Date: 2 May 1997 22:49:00 GMT
From: Anirvan Chatterjee <anirvan@crl.com>
Subject: Re: newbee
Message-Id: <5kdr0s$og6$3@nnrp1.crl.com>

-----BEGIN PGP SIGNED MESSAGE-----

Gary Austin <gaustin@camcomp.com> wrote:
: OK I figure this is probably been covered before but I missed it since I
: just started reading this group today.  What is the best way to install
: perl5.  I have windowsNT 4.0 sp2.  I need to know the steps required to
: install perl5 and what kind of access to the directory to insure security
: concerns are taken care of the best way.  Thanks in advance.

You mention you just started reading the group today, and that the
topic you're dealing with may have been dealt with before.

Why don't you take a look at DejaNews, a web-based searchable archive
of usenet postings, available at <http://www.dejanews.com/>. More
likely than not, you'll find an answer there much more quickly than if
you post a question to the group. Have you also looked at some of the
online documentation for NT Perl? The Perl Language home page
<http://www.perl.com/> has info on and links to relevant information
about NT Perl.

The denizens of this group will be much more happy to help you if
you've already done some of the basic online research by yourself.

_______________________________________________________________
Anirvan Chatterjee . anirvan@crl.com . <URL:http://www.mx.org/>
PGP 0x93C5C165 . finger for PGP/geek . encrypted mail preferred
http://www.mx.org/bookfinder/ : online book comparison shopping 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM2pu02TQ0LuTxcFlAQHMVAP/Tru+qPuJVJ/t+h6AZ+tC2zwfvMypFOXd
X71qTGA35xsLZBrw3hrHSePnF3xDajz0V5vgLMXSMuoDQWMHxgxJcyxGDrYT9kqX
q+ZV9MOEdK+sB37yhcCIxyXd2kaAwMD07UJR6Jgd+gG62+kKCBmznKTiwK9xdLnc
BemFUv2qQw4=
=5jKX
-----END PGP SIGNATURE-----


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

Date: Fri, 02 May 1997 23:51:51 +0100
From: Amias Channer <amias@amias.prestel.co.uk>
Subject: Newbie confused by all those slashes
Message-Id: <336A7007.66A5@amias.prestel.co.uk>

I am having a problem trying to get a true response after searching a
string for a keyword and finding it . I have read the documentation of
Perl 5 that came with the NT version i'm using and couldn't make head
nor tale of the endless slashing and pointy bracketing .
	The code i have tried and failed with is as follows

if ($prodname eq qw{$values[2]}){
	do stuff
}

where prodname is a string containg the keyword i wish to find in
values[2] wich contains a description of something e.g. 'large wolly
jumper with hole in it' . I have checked the variable contents and they
contain what they should .
	If any PERL gurus feel like lending a hand to a confused newbie it
would be appreciated

Toodle-pip
Amias



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

Date: Fri, 02 May 1997 16:37:51 -0700
From: Pierre Merle <pmerle@france.sun.com>
Subject: Re: Newbie confused by all those slashes
Message-Id: <336A7ACF.5E06@france.sun.com>

Hi,
I'm not sure to anderstand what you wanna do.
Do you want to find the $prodname in the string pointed value[2] ?
If yes I'll try something like $resu=grep(/$prodname/,$value[2]);

Pierre


Amias Channer wrote:
> 
> I am having a problem trying to get a true response after searching a
> string for a keyword and finding it . I have read the documentation of
> Perl 5 that came with the NT version i'm using and couldn't make head
> nor tale of the endless slashing and pointy bracketing .
>         The code i have tried and failed with is as follows
> 
> if ($prodname eq qw{$values[2]}){
>         do stuff
> }
> 
> where prodname is a string containg the keyword i wish to find in
> values[2] wich contains a description of something e.g. 'large wolly
> jumper with hole in it' . I have checked the variable contents and they
> contain what they should .
>         If any PERL gurus feel like lending a hand to a confused newbie it
> would be appreciated
> 
> Toodle-pip
> Amias


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

Date: 02 May 1997 18:40:17 -0400
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: Notice to antispammers
Message-Id: <r5ohatmram.fsf@tvmaster.turner.com>


kperrier@Starbase.NeoSoft.COM (Kent Perrier) writes:


> >Maybe... OTOH, it does not reflect too well on Tom either that he did
> >not respond to single substantial point in any of the replies to his
> >post. 
> 
> Well, the fact that he doesn't read this newsgroup anymore might
> have something to do with it.

Yes, and his little parting bombshell is analogous to deathbed
confessions - they serve only to pacify one's self and cause heartache
to all those around.  It was a childish move, but being that Tom's
behaviour for the past few months has become more and more moody and
infantile, not totally unexpected.


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

Date: Fri, 02 May 1997 17:23:35 GMT
From: jp@here.com (jp)
Subject: Re: Perl auto-replier
Message-Id: <33712301.4632222@news.cent.com>

As always there are ignorant selfish people around. It is very easy to
answer the question if you can and to also point them to a more
appropriate group in a not so insulting manner.

And as far as calling them clueless, those of you that think you can
answer the questions of the clueless, remember something, you once
were clueless too.

If you ignorant people are not yourselves clueless, perhaps you could
take a look at the name of the group and/or groups.
Maybe if you were not yourselves clueless you'd understand why the
clueless come here to find answers to their questions.

They may well be clueless as you put it, but at least they have common
sense, the common sense to ask the question that they need the answer
to in a group with a name that sounds like they'll find it there.

Most of you, when you do answer a question, only appear to know very
little yourselves. You never seem to get a grasp of what the person
realy wants to know and you rarely give the best answer to suit their
needs. So perhaps we are all a little clueless. ?



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

Date: Fri, 02 May 1997 17:31:13 GMT
From: jp@here.com (jp)
Subject: Re: Perl auto-replier
Message-Id: <33722494.5036081@news.cent.com>

Hi,
I have a CBF 600 and every time I rev the engine in the garage, perl
on my server dies. Can anyone help me please ? I really don't want to
sell my bike.


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

Date: Fri, 02 May 1997 15:47:46 -0700
From: Pierre Merle <pmerle@france.sun.com>
Subject: perl/html STDIN pb, help !!!!!!!
Message-Id: <336A6F12.4153@france.sun.com>

Hi,

I'm writing html pages using perl.
It work ok on my own network but if i use it on a machine not 
in my domaine (DNS), the 2nd page never arrive.
On my browser i have contacting toto.corp, please wait.
I reproduced the problem with two samlls scripts (un.pl call deux.pl
which never come)see below text.
If I comment $form = <STDIN>; then it woks !!!!!!
I repeat everything is ok on my domain.

I don't know how to solve it !

Pierre
pmerle@corp.sun.com

#!/usr/dist/pkgs/perl/5bin/perl
$| = 1;
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Rapport TZSE</TITLE></HEAD>";
print "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\">";
print "<CENTER><P><font size=+2><TT>un.pl</TT></font></P></CENTER>";
print "<form action=\"http://skool.corp/cbin/pierre/deux.pl\"
method=post>\n";
print "<input type=submit value=Deux>\n";
print "<input type=hidden ></form>\n";
print "</BODY></HTML>\n";



deux.pl =>

#!/usr/dist/pkgs/perl/5bin/perl
$| = 1;
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Rapport TZSE</TITLE></HEAD>";
print "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\">";
$form = <STDIN>;
print "<form action=\"http://skool.corp/cbin/pierre/un.pl\"
method=post>\n";
print "<input type=submit value=Deux>\n";
print "<input type=hidden ></form>\n";
print "</BODY></HTML>\n";


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

Date: 1 May 1997 14:13:06 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Perl4 script under Perl5 interpreter
Message-Id: <5ka8di$tun$2@dartvax.dartmouth.edu>

In article <336708FF.3965@aol.com>
LokiWebLtd <lokiwebltd@aol.com> writes:

> I'm having a problem with opening and writing files using perl5.
> The following command is what originally came with the script.
>      open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
> Of course this caused an error on the perl5 interpreter.
> I have fixed the line to
>      open(NEWFILE,">$basedir/$mesgdir/$num\.$ext" || die $!);
> this avoids the error however the file is not getting written.
>   Thanks in advance to anyone who can help with this..

I wouldn't really call that "fixing" the line.  Now it's doing
something completely different.
In the first case, it tries to open the file, and if it fails, it dies.
In the second case, it tries to open either the file or the return
value of die.  Since the filename will always evaluate to true, the
second case is equivalent to:
open(NEWFILE,">$basedir/$mesgdir/$num\.$ext");
Of course, with that code, if it can't open the file, you won't get an
error message, the program will keep executing, and the file will not
get written.

I don't suppose the error you get is anything like:
No such file or directory at xxx.pl line N.

Does the directory $basedir/$mesgdir actually exist?

Chipmunk


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

Date: Fri, 02 May 1997 18:08:10 -0500
From: nneul@umr.edu (Nathan Neulinger)
Subject: Poor performance isqlperl vs perl5+dbi+dbd
Message-Id: <nneul-0205971808100001@dialup-pkr-10-34.network.umr.edu>

I've been trying to convert to perl5 and DBI/DBD from using isqlperl, but
have noticed a major performance loss with perl5 for identical scripts...
(or functionally identically at least.)

Note the following timings:

-------------------------
gamma(76)>timex test-perl4.pl
0.02:0.02:0:0 before require
0.029999999999999999:0.029999999999999999:0:0 after require
0.14000000000000001:0.19:0:0 after open db
0.14000000000000001:0.20000000000000001:0:0 after open qry
0.62:0.56999999999999995:0:0 after fetches
0.62:0.56999999999999995:0:0 after close

real        2.35
user        0.62
sys         0.58

gamma(77)>timex test-perl5.pl
0.02:0.02:0:0 BEFORE REQ
0.34:0.09:0:0 before use dbi
0.34:0.09:0:0 after use dbi
0.38:0.1:0:0 after install driver
0.38:0.1:0:0 AFTER REQ
0.51:0.25:0:0 after open db
0.52:0.25:0:0 after open q
1.55:2.01:0:0 after fetches
1.55:2.01:0:0 after close db

real       10.01
user        1.56
sys         2.03
--------------------------------

The two scripts are almost identical. But one uses isqlperl, the other
uses perl5 w/ DBI(.78) and DBD-Informix(.53). 

I am using this with informix-se 7.10 on an HP-UX 9.05 machine, with perl
5.003_95.

If you have any suggestions, comments on why it is running so much slower,
please let me know.

---

On a side note, have you had any luck getting DBD-Informix built staticly
with an old informix (5.x) on HP-UX? I can get it built, and linked, but I
start getting all sorts of really weird symbol resolution errors when I
try to build modules after I have built the static perl binary. (problems
with things like IO, File, etc. pretty standard stuff.)

I'm trying to convince the parties involved to purchase the new informix
client support (for an Inf-Online server), but that'll take a while.

-- Nathan

------------------------------------------------------------
Nathan Neulinger                  Univ. of Missouri - Rolla
EMail: nneul@umr.edu                  Computing Services
WWW: http://www.umr.edu/~nneul      SysAdmin: rollanet.org


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

Date: 2 May 1997 22:53:15 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: program for perl?
Message-Id: <5kdr8r$t2b$1@marina.cinenet.net>

E. (erisson@kallisti.sw-tech.com) wrote:
: Randal Schwartz <merlyn@stonehenge.com> wrote:
: > >>>>> "Suzanne" == Suzanne L <suzanne@intrepid.axess.com> writes:
: > 
: > Suzanne> Is there a program that is needed to write in perl or can they be
: > Suzanne> written in any text editor?
: > 
: > Any text editor will do.  My favorite is:
: > 
: > 	$ cat >myscript
: > 	...
: > 	[runs perfectly]
: 
: Showoff.  :P

To me, the most impressive part is how the script runs perfectly without 
his ever having actually invoked it. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 1 May 1997 14:28:33 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Q: How do I ...
Message-Id: <5ka9ai$tun$3@dartvax.dartmouth.edu>

In article <3367640A.428@teir.com>
Gordon Lee <glee@teir.com> writes:

> convert a string to uppercase except for quoted text which may occur 0
> or more times within the string?  Example:
> 
> $line = <img src="image.gif" align="left">;
> 
> The following will work on the above:
> 
> $line =~ s/(.*?)(\".*?\")/\U$1\E$2/g;
> 
> but won't work on:
> 
> <img>
> 
> I could do it a character at a time using the quotes as flags, but I was
> wondering if there was a single expression to handle this.  TIA.

It won't work because your regexp matches a sequence of characters,
followed by a double quote, followed by a sequence of characters,
followed by a double quote.  <img> has no double quotes in it.

I suppose you could do:
$line =~ s/([^"]*)(\".*?\")?/\U$1\E$2/g;   # untested
which matches a sequence of non-double quote characters, optionally
followed by a double quote, a sequence of characters, and a double
quote.

Chipmunk


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

Date: 1 May 1997 14:52:57 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Regexp bug or feature? (perl claims null string match)
Message-Id: <5kaao9$tun$5@dartvax.dartmouth.edu>

In article <ucohawmnfb.fsf@pandora.Informatik.Uni-Mainz.DE>
Daniel Polani <polani@pandora.informatik.uni-mainz.de> writes:

> in a script I am testing for a match of lines of the form 
> 
>   10111010|10010110|01111111|10100101
> 
> and similar. I am using the following regexp
> 
>   /^[01]+(|[01]+)+/
> 
> for the match (which seems to work), however perl claims that
> 
>   (|[01]+)+ matches null string many times at 'pe' line 10.
> 
> I do not understand why that regexp should ever match a zero length
> string. Am I missing something, or is this a bug?

I'm afraid you're missing something.  | is a special character in
regexps, meaning match either what's on the left, or what's on the
right.  In this case, there is nothing on the left, so it matches the
null string.

Try /^[01]+(\|[01]+)+/ instead.

Chipmunk


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

Date: 2 May 1997 20:50:59 GMT
From: "Tom Vaughan" <guffey@anpi.com>
Subject: scalar holds compiled code
Message-Id: <01bc573a$6aac7ce0$228118ac@mtn_view_guffey>


given:

$stuff = << 'END_OF_STUFF';
[compiled program, eg. C]
END_OF_STUFF

how do I execute what $stuff holds?



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

Date: 1 May 1997 14:34:09 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: SIMPLE REG-EXP Please Help!
Message-Id: <5ka9l1$tun$4@dartvax.dartmouth.edu>

In article <3368C02B.4A47BA4C@iternet.it>
andrea <andrea@iternet.it> writes:

> I'm not a reg-exp guru but i think this one is too simple to fail.
> I've 600 html files with <\B> instead of </B> as it should be.
> i've done this:
> perl -p -i -e "s/<\\B>/<\/B>/i;" *.html
> doesn't work.

The above command worked fine for me...

One thing, you might need to do:
perl -p -i -e "s/<\\B>/<\/B>/gi;" *.html
in case you have more than one <\B> on a single line.

What happens when you try to use it?

Chipmunk


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

Date: 02 May 1997 23:54:55 +0200
From: Tom Grydeland <tom@geronimo.uit.no>
Subject: Re: Undefined subroutine &main::AF_INET
Message-Id: <ofbafmdk09c.fsf@geronimo.uit.no>

mcravit@shell3.ba.best.com (Matthew Cravit) writes:

> In article <3367B45F.328@spyglass.com>,
> Chris Mullendore  <cmullendore@spyglass.com> wrote:

[...]

> >  $us = pack($packing_template, &AF_INET, 0, $ouraddr);


> That should probably be either just AF_INET or $AF_INET.

Nope.  AF_INET is in fact &AF_INET, exported for your convenience.

Socket.pm contains the line(s)
@EXPORT = qw(
 ...
        AF_INET
 ...
);

and your /.../sys/socket.ph contains

    eval 'sub AF_INET {2;}';

or something similar.

> just do "use Socket;", you can let the Socket library module handle a lot
> of the packing stuff for you and not have to worry about it. Pages 348-355
> and 498-500 of Programming Perl, 2nd ed. are helpful as well.

Indeed.

> Matthew Cravit, N9VWG               | Experience is what allows you to

-- 
//Tom dot Grydeland at phys dot uit dot no
- I don't write children's books or "Crotch Sniffing for Dummies" - E. Naggum
        The case of Randal Schwartz - http://www.lightlink.com/fors/


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

Date: Fri, 02 May 1997 14:53:49 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: use statements and multiple module calls
Message-Id: <336A626D.86A@ixlabs.com>

We have large scripts with many of our own modules in use.

I recently did some profiling with DProf, and was alarmed that the same
module used in other module kept having its BEGIN block run each
instance, and that these BEGIN blocks were the biggest resource hogs.

I thought Perl did sort of an automatic #ifdef, and did not rerun BEGIN
blocks in modules which are 'use''d in different files within the same
script.

Does this add up compile time too? SHould I be doing some sort of
ifdef-like action to prevent redundant compiles or BEGIN block runs?


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 417
*************************************

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