[7740] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1365 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 25 09:17:47 1997

Date: Tue, 25 Nov 97 06:01:06 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 25 Nov 1997     Volume: 8 Number: 1365

Today's topics:
     Re: Any Perl-compatible database available <andrewe@technologyXchange.com>
     Re: compiling perl & mod's on HP-UX <soney@1y.com>
     Re: dbmopen? can't make it work (Jeffrey R. Drumm)
     Re: Deleting 2 or more spaces anywhere.. (Tad McClellan)
     Re: Deleting 2 or more spaces anywhere.. <h.b.furuseth@usit.uio.no>
     Re: Detecting Memory Leaks in Perl <gmarzot@baynetworks.com>
     Re: getting output from system (Tad McClellan)
     GUID bit <jjv@caesun.msd.ray.com>
     Help me!!! In Win NT 4.0 Don't work but in Unix it is w <drzikhil@chollian.net>
     Re: How do you export a variable from module? <zenin@best.com>
     Re: How secure is Perl for Win32 under IIS 3.0 and WinN (Albert D. Cahalan)
     Re: How secure is Perl for Win32 under IIS 3.0 and WinN (Jeremy D. Zawodny)
     Re: How to determine if a value is "readonly"? (E.None Archibald)
     Re: How to: GD-1.14, Perl 5.004.01 & OS/2? (Ilya Zakharevich)
     Re: How to: GD-1.14, Perl 5.004.01 & OS/2? (Ilya Zakharevich)
     Re: How to: push (condition ? @this : @that),$value; <Matthew.Rice@ftlsol.com>
     Re: is it possible to reference a sub-array? <zenin@best.com>
     MailTools problems <lonewolf@compulink.gr>
     Re: Message Board Scripts Help (Jeremy D. Zawodny)
     Re: multi line pattern matchin (John Moreno)
     Re: nt build of perl5.004_04 (Danny Aldham)
     problem with perl or Solaris? <jbbernar@midway.uchicago.edu>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: sum in assoc array (Eric Bohlman)
     Using PL/SQL in Oraperl (Wei Tang)
     Re: win32 and SIG's <bowlin@sirius.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 24 Nov 1997 12:20:40 +0800
From: Andrew Ellerton <andrewe@technologyXchange.com>
Subject: Re: Any Perl-compatible database available
Message-Id: <34790098.F2C668DB@technologyXchange.com>

Thomas Beardshear wrote:
> 
> Does ANYONE know of a Linux database compatible with Perl, CGI.pm and
> Apache.
> 

Checkout http://www.hermetica.com/technologia/perl/DBI/index.html

> I want to query data from a database from a browser and I can't find
> anyone or any support for the database I'm using.

Which Database is it? Which platform are you using? There's bound to be
a way to do it, or at least kludge it.


> 
> I'm trying to find ANY database engine that will output database queried
> data to a browser via a Perl CCI script successfully.

It shouldn't be too hard! There's plenty around, including free or cheap
ones. 

Andrew

--
Andrew Ellerton                          andrewe@technologyXchange.com
Software Engineer                                      +61 8 9367 7006
International Technology Exchange                  Fax +61 8 9367 7343
Australia                             http://www.technologyXchange.com


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

Date: Sun, 23 Nov 1997 22:01:22 -0500
From: Steven Oney <soney@1y.com>
Subject: Re: compiling perl & mod's on HP-UX
Message-Id: <3478EE02.D0E6C135@1y.com>

Dave,
have you tried to compile any of the additional mod's.
I'm trying to compile wais.pm and have trouble getting it to
compile. This is the first module I'm trying to add and I'm wondering
if there is any order that i have to add modules in. Right now I'm
get error about inconsistant parameters for getopt. I already have
perl compiled and working but I'm have trouble adding this first
module.

Steve


>





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

Date: Mon, 24 Nov 1997 15:01:46 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: dbmopen? can't make it work
Message-Id: <34797916.933733738@news.mmc.org>

On Sun, 23 Nov 1997 11:09:22 -0700, autopen@autopen.com (Laurel Shimer) wrote:

>I have been trying to figure out how to use dbm files in my perl script
>using both the camel book and the man page.  But there are several things
>I cannot figure out the answer to. BTW I'm a C non-expert, though I have
>tried looking at 'man dbm' to try to get some more clues about what dbm
>is.
>
>1) How to create and write to a dbm file. In the following logs you can
>see what I've tried - both of which I knew didn't make sense (but I have
>to start somewhere especially if I'm going to ask for help!).

Your understanding of exactly what dbmopen does is, hmmm, how can I put it,
less than complete(?).

dbmopen simply allows you to 'tie' an associative array (hash) to a dbm file
(and you should really be using Perl's 'tie' support anyway . . . dbmopen is in
Perl5 for backward compatibility with Perl 4).

Add keys and values to the hash, and you build the dbm file. If you think of a
hash as a uniquely keyed, in-memory database and dbmopen as a way to make that
database persistent across invocations of your application, you'll quickly get
the hang of it.

>In Thing 1 I tried issuing a dbmpopen and just writing data out to it. I
>realize that the OUTPUT file handle should actually be a hash so I
>understand why it didn't work.

Good, you're making progress, and you've allowed me to completely disregard
Thing 1.

>2) In Thing 2 I tried setting up a hash to associate with the dbmopen,
>filling the hash with data, and writing the hash out along with some
>keys.However I couldn't figure out what filehandle I should print to -
>since the dbmopen is connected to a hash and not a filehandle. What should
>I use as a filehandle to print to. As you can see I just tried printing to
>the hash - which I realized wouldn't work, and sure enough it didn't.

Closer . . . but you don't "print" to a dbm. You create hash keys and their
associated values with straightforward assignments; the dbm is automagically
populated for you.  Hope you understand the concept of a hash/associative
array; it's gonna be difficult for you until you've figured out what they are.

>3) The other thing I don't get is why  - since I 'rm' these files each
>time, then open them as '0666' - why do the empty .dir and .pag files show
>up as being -rw-r--r--? Is that because they are pointer files and not
>really the actual data? If I actually managed to create data would those
>files be -rw-rw-rw-? 

The mode you set in dbmopen is modified by your umask. Check that.

>4) How should I REALLY write to these files from my perl script?

You might want to start with the modifications I've made below Thing 2.

(Thing 1 deleted) . . .

>------------------Thing 2 ----------------
>shellx 16% perl5

Ouch. Did you really do this all at the command line? Use an editor . . .

>dbmopen (OUTPUT, 'dbtype.data',0666)|| die 'cannot open dbtype.data\n';
>@OUTPUT =("dog","frog","log","bog");
>                while (($output) = each %OUTPUT) {
>                        $i++;
>                       print OUTPUT "$i=$output\n";
>               }
>
>
>dbmclose(OUTPUT);

How about:

#!/usr/bin/perl -w
# dbtest.pl - JRD 19971124

#open the database
dbmopen(%MYDB, 'mydb',0666) or die "cannot open: $!";

# make an array to fool around with
@array = ('dog','frog','log','hog');
#alternately, with less typing: @array = qw(dog frog log hog);

#step through it, assigning each element as a key to the hash
#and set it's associated  value to the element plus 'gy'
foreach $element (@array) {
  $MYDB{$element} = $element . 'gy';
}

# print out a list of the keys and their values, sorted by key. function "keys"
# returns the keys from your hash and sort sorts 'em
foreach $key (sort keys %MYDB) {
  print "$key = $MYDB{$key}\n";
}
dbmclose %MYDB

__END__

~/testit $ perl dbtest.pl
dog = doggy
frog = froggy
hog = hoggy
log = loggy

Lastly, I can't stress enough the need for you to get your hands on "Learning
Perl" and "Programming Perl" from O'Reilly and Associates.  These are the
definitive publications for getting started with Perl. You also should spend
some time reading the Hashes section of Perlfaq 4 . . .

Have fun!

-- 
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
420 Cumberland Ave, Portland, Maine 04101
Voice: 207-871-2150 Fax: 207-871-6501 Email: drummj@mail.mmc.org


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

Date: Sun, 23 Nov 1997 21:13:56 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Deleting 2 or more spaces anywhere..
Message-Id: <kdra56.uc3.ln@localhost>

Thomas Munn (munn@bigfoot.com) wrote:
: I have used the regular expression to remove 2 or more spaces:

: s/\s{2,}/\s/

: This causes only spaces that aren't bounded by numbers, letters etc. to be 
: replaced.  


No it doesn't.

It replaces (only) the first substring of two or more spaces 
with the letter 's'

If it does not do that for you, then you have found a bug in Perl.
Please report it using the perlbug program.


: Could someone post how to get ALL examples of two or more spaces, 


   s/\s{2,}//g;  # remove sequences of two or more white space characters


: accounting for word boundaries, numbers letter, and alphas, in a regular 
  ^^^^^^^^^^^^^^

What do you mean there? Sorry, I'm not following what you want...


: expression and replace them with just space??

   s/\s{2,}/ /g;  # replace sequences of two or more white space characters
                  # with a single space


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 24 Nov 1997 05:30:05 +0100
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
Subject: Re: Deleting 2 or more spaces anywhere..
Message-Id: <HBF.971124hjf5@bombur2.uio.no>

munn@bigfoot.com (Thomas Munn) writes:

> I have used the regular expression to remove 2 or more spaces:
> 
> s/\s{2,}/\s/

That repaces the first string of whitespace with 's'.  You probably meant
  s/(\s)\s+/$1/g;  or
  s/\s+(\s)/$1/g;  or simply
  s/\s{2,}/ /g;

> This causes only spaces that aren't bounded by numbers, letters etc. to be 
> replaced.

 ...unless there are two or more spaces between them:-)

> Could someone post how to get ALL examples of two or more spaces, 
> accounting for word boundaries, numbers letter, and alphas, in a regular 
> expression and replace them with just space??

I think you misunderstand what is going on.  Maybe one of my suggestions
above are OK.  But if your strings are from a text file and can contain
e.g. newline and formfeed, you probably only want to remove duplicate
SPACE and TAB:

	s/[ \t]{2,}/ /g;    or
	s/[ \t]+|\t/ /g;

If you also want to preserve double spaces after sentences, try:

	s/([.?!][\"\'\)]*  |[ \t])[ \t]+/$1/g;

-- 
Regards,

Hallvard


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

Date: 24 Nov 1997 10:14:04 -0500
From: Joe Marzot <gmarzot@baynetworks.com>
Subject: Re: Detecting Memory Leaks in Perl
Message-Id: <pdk9dycojn.fsf@baynetworks.com>

dudley@msi.umn.edu writes:

> 
> Hello,
> 
> I am writing in the hope that there is someone that can help with a
> rather large memory leak problem that I have in one of my perl scripts.
> 
> The Problem:
> 
> I have a (somewhat large) perl script - about 1300 lines - that has
> several large memory leaks. I've seen it grow from 4 Meg to 20 Meg in only
> a few days. I am using perl 5.004_01 on an IRIX 6.3 OS.
> 
> What I have already tried:
> 
> I have already nailed down a few leaks using the Devel::Peek module
> by monitoring a few suspicious variables closely. I have also used the
> -Dm command line option to no avail.
> 
> What I am looking for:
> 
> Even though I was able to fix a few leaks with the Devel::Peek module,
> the program is just too large to go through and closely observe every
> single variable. Might there be a program or module that will do this? Or
> maybe the Devel will work and I'm just unaware.

One thing to look at is a define in the perl source, LEAKTEST. I would
imagine if you recompiled perl with this defined it enables some leak
testing code. Never used it - thought it was worth a mention.

-GSM

> 
> Thanks very much in advance!
> 
> Jennifer Dudley
> dudley@msi.umn.edu
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

-- 
 G. S. Marzot <gmarzot@baynetworks.com>   Network Management Development
 Bay Networks Inc.                        (508)670-8888 x63990
--


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

Date: Sun, 23 Nov 1997 21:05:41 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: getting output from system
Message-Id: <5uqa56.0c3.ln@localhost>

Michael R. Harper (mikihasa@worldnet.att.net) wrote:
: I would like to capture (save as a variable) the output (STDOUT) from a
: program that I execute (using the system command) during a Perl script.
                                    ^^^^^^^^^^^^^^


Uhhh.

The very first paragraph of the description of system() given in
the 'perlfunc' man page tells how to do this.

Does that solution not work for you?



: Can anyone give this Perl newbie some help?


Productive programmers get the answer in about 60 seconds by looking
in the docs rather than waiting hours, days, or forever by asking on
Usenet...


[ We don't mind newbie questions here. We do mind not even trying
  to get the answer yourself first. The docs were created to help
  you.

  Use them.
]


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 24 Nov 1997 11:23:43 -0500
From: Jason Varsoke <jjv@caesun.msd.ray.com>
Subject: GUID bit
Message-Id: <3479AA0F.2FAA@caesun.msd.ray.com>

So this is only partially a Perl question, but I'm having the problem
only in perl.  I don't have the problem in my C code.  So here it goes. 
I've got a program which needs to run with the GUID bit set so it can
create a file with the correct group, which the user may not belong to. 
When I run the program I get the following error message:

Insecure dependency in open while running setgid at /dev/fd/3 line 206.

There are two strange things about this 
   1) I'm supplying an argument on the command line which tells me which
file to write (There are some database calls to find out the filename
from the input).  But when Hardcode the argument in the program, as it
would be in from the command line, the program doesn't produce the
error.  if  @ARGV = (ID=10);  works, but ./foo.pl ID=10 does not
   2) the second part that makes this unusual is that I have another
perl program with the exact same function (the one that creates the
file) and it works all the time, taking stuff from the command line and
all.  

So I guess this is my question, what are the requirements to make sure
that a GUID bit program can write out a file?  What creates the Insecure
Dependency error?  I know a $ENV{PATH} with a relative address will do
this, but I've already locked that down.

Please e-mail me with any suggestions: jjv@caesun.msd.ray.com
thanks,

-j
-- 
________oOOOo__/~~~~\__oOOOo_________________________________
Jason Varsoke                            jvarsoke@bigfoot.com
For good mental hygiene, shave with Occam's Razor twice a day


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

Date: Tue, 25 Nov 1997 02:07:16 +0900
From: "JungWon LEE" <drzikhil@chollian.net>
Subject: Help me!!! In Win NT 4.0 Don't work but in Unix it is working
Message-Id: <65cc8n$drp$1@newstmp1.bora.net>

Hi~

I have some headache about this situation.

In Unix it's fine. no problem.

But Windows NT 4.0, it reports "Can't locate...CGI error..."

I have known...the Perl nice working in any platform...Unix, Windows NT,
etc.

What makes this happen ?...

Immediately anwser me, please!

I have a important demonstration in front of my boss!!!

This situation must fix...get the solution...

I wait your nice answer...Thanks...

P.S: Reply to my e-mail address, I very much appreciate!





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

Date: 24 Nov 1997 17:43:09 GMT
From: Zenin <zenin@best.com>
Subject: Re: How do you export a variable from module?
Message-Id: <880393530.71394@thrush.omix.com>

[ posted & mailed ]

Alexander Farber <eedalf@eed.ericsson.se> wrote:
	>snip<
: The function eed_p works fine in my scripts, but how do i export the
: variable $today ? I have tried @EXPORT = qw(eed_p today); or
: @EXPORT_OK = qw($today); but it doesnt help.

	Close.  Really, really close:

	use vars qw($today);
	@EXPORT = qw(eed_p $today);
	                  /|\
	     Needed This---|

-- 
-Zenin
 zenin@best.com


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

Date: 23 Nov 1997 23:06:25 -0500
From: acahalan@mercury.cs.uml.edu (Albert D. Cahalan)
Subject: Re: How secure is Perl for Win32 under IIS 3.0 and WinNT4.0?  (Luddites at work gotta know!)
Message-Id: <vc7zpmv6im6.fsf@mercury.cs.uml.edu>


>> I have used Perl for year and am entirely convinced that properly
>> administered, perl is one of the safest and most useful tools in
>> existence today.
>>
>> However, I am trying to convince the sysadmin folks (I am a developer)
>> at work that Perl is safe to put on the new WindowsNT 4.0 webserver so
>> we can setup some Perl scripts to streamline our webpages (among other
>> things).

>> They have some idea that Perl will enable a user to write to
>> the registry accidentally or on purpose, and they have
>> restricted those permissions (even for us developers).

Perl can do what the user can do. If you can't write to something,
then your perl script can't either. If the web server _does_ have
that permission and runs the perl script as itself, then of course
the perl script could too. That applies to C++ and Visual Basic too.

> Do they have other specific objections (that they can document), or is
> it more a matter of "Well, we've heard that perl..." and "I dunno.
> What's so special about this Perl thing?"

I know what is special. Perl has been in CERT alerts because some
people think they can put perl.exe in an accessable directory.
That would be very wrong! Instead, associate *.pl with perl.
You can find insecure web sites by searching for perl.exe.


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

Date: Mon, 24 Nov 1997 01:44:51 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: How secure is Perl for Win32 under IIS 3.0 and WinNT4.0?  (Luddites at work gotta know!)
Message-Id: <3478d92e.178117279@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Sat, 22 Nov 1997 22:17:55 GMT, #my din#@pobox.com (Myrddin) wrote:

>I have used Perl for year and am entirely convinced that properly
>administered, perl is one of the safest and most useful tools in
>existence today.

Well, I'd say that it's far more important that the computer you're
running Perl on needs to be properly administered.

There's little administration that needs to be done with Perl. Perl
doesn't run with any special privileges, so on a multi-user OS it is
more a matter of the security model the OS uses.

>However, I am trying to convince the sysadmin folks (I am a developer)
>at work that Perl is safe to put on the new WindowsNT 4.0 webserver so
>we can setup some Perl scripts to streamline our webpages (among other
>things).

>Nothing fancy, no setuid scripts.

Well, NT really doesn't have a concept of SUID scripts anyway. At
least not that I'm aware of.

>They have some idea that
>Perl will enable a user to write to the registry accidentally or on
>purpose, and they have restricted those permissions (even for us
>developers).

Perl will enable the user to anything--anything they could to with any
other decent programming language. However, the OS security is what
limits how far a user can go.

Are they not properly administering registry security? If so, you have
larger problems.

Do they have other specific objections (that they can document), or is
it more a matter of "Well, we've heard that perl..." and "I dunno.
What's so special about this Perl thing?"

>I am looking for something (prefereably a memo from a well-known
>company or agency) that can help prove to them that Perl is safe.

Depends a lot on what you mean by safe.

What you're more likely to find is that a lot of people will tell you
that Perl is no more dangerous that any other tool. That they've been
using it for years to do things that would have taken longer in more
"traditional" languages.

It's been my experience that if someone doesn't want to believe you,
you need to work EXTREMELY hard to change that. :-(

Good Luck,

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 24 Nov 1997 06:20:08 GMT
From: yevgene@xochi.tezcat.com (E.None Archibald)
Subject: Re: How to determine if a value is "readonly"?
Message-Id: <65b6ao$eq3$1@tepe.tezcat.com>

A much simpler solution:

Place the optional element -LAST- in the argument list.

Thus:
Debug($thisvalue,$thatvalue);
Debug($thisvalue,$thatvalue,1);

Thus, if you have N required parameters, the N+1th parameter is optional;
if it exists, yay! it was passed in. Otherwise, it wasn't, and you can
handle that case with an hardcoded value in the Debug() function.

--eugene

Toutatis <toutatis@no.mail.please> wrote:
: For a function, I want to determine if the 1st element
: in @_ is readonly (hardcoded in the program) or passed
: as a variable. Actually, it is for a debugging program 
: I use, and I optionally want to pass one parameter,
: without being forced to always pass it a first parameter.

: Debug($thisvalue,$thatvalue);
: Debug(1,$thisvalue,$thatvalue);

: sub Debug {
:      if(readonly(@_){
:          $thoroughly = shift;
:      }
:      #print @_ fancy and deep $thorougly
: }

: sub readonly {
:      ?????????
: }


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

Date: 24 Nov 1997 04:37:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to: GD-1.14, Perl 5.004.01 & OS/2?
Message-Id: <65b09v$2hd$1@agate.berkeley.edu>

In article <65atge$1g1$1@agate.berkeley.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> Btw, doing (after finally understanding what was a problem with CPAN
> here - some obsolete sticking entries in CPAN::Config)
> 
> 	perl -MCPAN -e shell
> 	cpan> test GD
> 
> I see:
> 
> [...]
> emxomfar cr libgd.lib gdfontg.obj gdfontmb.obj gdfontt.obj gdfontl.obj gdfonts.obj libgd.obj
> : libgd.lib
> make[1]: :: Command not found

Well, in fact this is the only problem I found.  After cd-ing into the
directory and running make in the subdirectory manually all tests
pass.

So apparently the configuration of the machine of the original poster
is completely goofed.

I'm already reporting bug in recursive make to its porter, however, I
know he has no big wish to support this port any more (and I can
understand him, having looked into the source of GNU make - and other
fine GNU tools).

Ilya


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

Date: 24 Nov 1997 03:49:34 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to: GD-1.14, Perl 5.004.01 & OS/2?
Message-Id: <65atge$1g1$1@agate.berkeley.edu>

In article <347898a6$5$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>,
 <samdie@ibm.net> wrote:
> > In article <34786ef9$3$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>,
> >  <samdie@ibm.net> wrote:
> > > In the specific case of GD, however, emxomfar refuses to build a library with
> > > the same extern defined in more than one member. Seems to me it's right to
> > > refuse and I'll have to redo the source code (it's not really an os/2 issue at
> > > all). 
> 
> > Thanks, I hope you send a patch to the author.
> Well I've been operating on the assumption that my configuration is not
> sufficiently *nix-like for Perl's tastes (or that my almost non-existent
> understanding of *nix is the root of the problem). 

Having two externs of the same name is a bug notwithstanding any goofs
you could make configuring your system.

Btw, doing (after finally understanding what was a problem with CPAN
here - some obsolete sticking entries in CPAN::Config)

	perl -MCPAN -e shell
	cpan> test GD

I see:

[...]
emxomfar cr libgd.lib gdfontg.obj gdfontmb.obj gdfontt.obj gdfontl.obj gdfonts.obj libgd.obj
: libgd.lib
make[1]: :: Command not found
make[1]: *** Deleting file `libgd.lib'
make[1]: Leaving directory `/home/.cpan/build/GD-1.15/libgd'
make: *** [libgd/libgd.lib] Error 1
  F:\EMX.ADD\BIN/make  -- NOT OK

Which is obviously not what doctor would recommend...

> What I meant was line 482 of perl.h There is, however, a complication that
> I'll have to investigate. I've installed Perl at home (Warp 4) and at work
> (Warp 3). The two installations were unrelated (except that *I* did them) and,
> though I intended them to be logically equivalent, I did enough fiddling with
> them that there are bound to be some inconsistencies. When I (now, at home)
> look at line 482, it's fine (includes dirent.h, as seems reasonable in the
> given context). Last Thurs/Fri (at work) I was doing a compare of perl.h
> (yours) with the one in the 5.004.04 release and noticed that the line was
> different (direct.h vs dirent.h). So I'll have to go back and unzip perl_blb
> again (at work).

cpan> !print ord('n') - ord 'c'
11

They are not a bit apart, but 3 bits ;-).  I would suspect some human
intervention...  Any saboteurs around?  ;-) 

Ilya


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

Date: 23 Nov 1997 23:21:44 -0500
From: Matthew Rice <Matthew.Rice@ftlsol.com>
Subject: Re: How to: push (condition ? @this : @that),$value;
Message-Id: <m3g1omaplz.fsf@hudson.ftlsol.com>

toutatis@no.mail.please (Toutatis) writes:

> my $value = "some_value";
> if (condition){
>    push @this, $value;
> else {
>    push @that, $value;
> }
> 
> I'd like to write something like
> push (condition ? @this : @that),$value;

There's:
$ref = condition ? \@this : \@that;
push @$ref, $value;

or
push @{condition ? \@this : \@that}, $value;
-- 
Matthew Rice                             e-mail: matthew.rice@ftlsol.com


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

Date: 24 Nov 1997 17:31:32 GMT
From: Zenin <zenin@best.com>
Subject: Re: is it possible to reference a sub-array?
Message-Id: <880392833.144752@thrush.omix.com>

[ posted & mailed ]

	Uhg...people, if you are going to CC a copy of your reply to the
	author, PLEASE MAKE A NOTE TO THE EFFECT such as I have above.  This
	saves much time in having to replay TWICE when we see the same thing
	posted that we just replied to in email... :-/

	BTW Mark, I mistyped my email reply to you.  Recheck my function()
	code, I goffed the deref. :-)

Mark Mielke <markm@nortel.ca> wrote:
> It doesn't work:

	Yes, it does.

> try this...

	You're right, this code won't work.  But that's because it's
	not correct.  You've got the whole idea backwards.

	When using the \(@slice[...]) construct, the function gets
	passed an _array of references_, and not a reference to an
	array.

>    sub function

	Try this as:

	sub function {
	    my @array = @_;
	    foreach (@array) { ${$_} = uc ${$_} }
	}

	function (\(@ARGV));

> It doesn't work i tell you... 

	It does, just not in the way you think it should.

> perl doesn't even claim to be able to do such a thing :-)

	It doesn't?  Then what is this out of the perlref man page:

          "Note that taking a reference to an enumerated list is
           not the same as using square brackets--instead it's
           the same as creating a list of references!

               @list = (\$a, \@b, \%c);
               @list = \($a, @b, %c);      # same thing!

           As a special case, \(@foo) returns a list of
           references to the contents of @foo, not a reference to
           @foo itself.  Likewise for %foo."

> The interesting part is that \(@b[...]) seems to
> return a ref to a scalar?

	That's because, as the above states, \(@b[...]) will return
	a list of scalar references to the contents of @b.  You
	only pulled the first ($_[0]) out from the stack which is a
	scalar reference to the contents of the first element of
	the slice you passed.

	Simple, huh? :-)

--
-Zenin
 zenin@best.com


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

Date: Mon, 24 Nov 1997 15:34:12 +0200
From: Kostas Vlassis <lonewolf@compulink.gr>
Subject: MailTools problems
Message-Id: <34798254.4D2F4033@compulink.gr>

    Well I tried to use perl with the Send module as described in the
book
"Web Programming with Perl 5" and the latest MailTools package I got
from my closest cpan mirror, it was 1.X and installed it succesfully,
I think....

    The book gives the following listing that does not seem to work:

use Mail::Send

$msg = new Mail::Send
$msg->from($info{'email'});
$msg->to("myself@some.com");
$msg->subject("Sample mail");
print $fh "This is a sample mail line 1.\n";
print $fh "This is a sample mail line 2.\n";
$msg->close();

    The to email I get from a form... Any ideas why I never get any mail
?

    Thanks in advance,
                    Kostas Vlassis (lonewolf@compulink.gr)



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

Date: Mon, 24 Nov 1997 14:43:56 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Message Board Scripts Help
Message-Id: <34799290.343358313@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Mon, 24 Nov 1997 09:23:48 -0500, Evan Connor <econnor@usa.net>
wrote:

>I am having problems with the CGI file on the server.  I get a server
>config error whenever I try to post a test message.  If anyone is
>willing to help me install this or at least talk me through the process,
>I would gladly repay you by doinf some advanced HTML or graphic for you
>in return. Plus, I will publicly thank you for your help.

I'm curious as to what you mean by "advanced HTML"...

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 24 Nov 1997 10:12:48 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: multi line pattern matchin
Message-Id: <1d07vuy.n2ai9i1qa7z7yN@roxboro-172.interpath.net>

Hans Leichtl <leichtl@mro.dec.com> wrote:

> Hi,
> 
> i have not done too much perl so far, so sorry if this is a rtfm.

Yes this is a RTFM question.

It's also a rtffaq question.

"I'm having trouble matching over more than one line.  What's wrong?

Either you don't have newlines in your string, or you aren't using the
correct modifier(s) on your pattern."


> i would like to write a script that replaces parts of a file (or deletes
> parts). my problem is that the parts are spanning multiple lines.
> 
> is there a way to do this 'quickly' in perl or do i have to write the
> loops for matching the whole search pattern myself (i.e. comparing line by
> line if i actually get the complete part i'd like to rip out of the file?)

No, so long as you can read all of the lines into one string this is as
easy as pie.

Look into undef $/ - this makes <> slurp in the whole file.

-- 
John Moreno


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

Date: 23 Nov 1997 20:18:49 -0800
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: nt build of perl5.004_04
Message-Id: <65av79$ade$1@lennon.postino.com>

Thomas Lockney (tlockney@tivoli.com) wrote:
: Ok, supposedly perl5.004_04 should build on an nt box with cygnus' gnu
: utilities, right?

Perl builds fine with Microsoft's Visual C++ 5. Use that if you can.
If you use Cygnus's kit, there are patches to be applied, but first
you must patch the patch program. No kidding.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I wak'd, she fled, and day brought back my night. jm


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

Date: Mon, 24 Nov 1997 17:24:26 GMT
From: Jon Bernard <jbbernar@midway.uchicago.edu>
Subject: problem with perl or Solaris?
Message-Id: <Pine.GSO.3.95.971124111323.4947A-100000@mach.uchicago.edu>

I have a script which runs with MacPerl, but causes a segmentation fault
when run with perl 5.003 under Solaris 2.5.  The offending part of the
script seems to be (ie, it fails at this line)

   pos $str = $nextpos;

When the script fails, both pos $str and $nextpos are 1.  Other values
cause problems as well, although $nextpos is always <= pos $str.

Any ideas about what's going on?

Jon Bernard




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

Date: 24 Nov 1997 15:54:58 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <65c80i$3rb$2@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 15 Nov 1997 11:27:37 GMT and ending at
22 Nov 1997 06:02:55 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.
    - Original Content Rating is the ratio of the original content volume
      to the total body volume.
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.

Excluded Posters
================

perlfaq-suggestions@mox.perl.com

Totals
======

Total number of posters:  470
Total number of articles: 1089 (439 with cutlined signatures)
Total number of threads:  392
Total volume generated:   1751.2 kb
    - headers:    738.2 kb (15,143 lines)
    - bodies:     933.5 kb (30,422 lines)
    - original:   647.4 kb (22,131 lines)
    - signatures: 76.7 kb (1,582 lines)
Original Content Rating: 0.6936

Averages
========

Number of posts per poster: 2.32
    median: 1.0 post
    mode:   1 post - 324 posters
    s:      4.99 posts
Number of posts per thread: 2.78
    median: 2.0 posts
    mode:   1 post - 125 threads
    s:      2.52 posts
Message size: 1646.7 bytes
    - header:     694.2 bytes (13.9 lines)
    - body:       877.8 bytes (27.9 lines)
    - original:   608.8 bytes (20.3 lines)
    - signature:  72.2 bytes (1.5 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   61    96.4 ( 42.6/ 44.1/ 22.3)  zawodny@hou.moc.com
   57    87.6 ( 40.1/ 36.2/ 18.0)  brian d foy <comdog@computerdog.com>
   34    56.3 ( 20.4/ 35.9/ 21.7)  Tad McClellan <tadmc@flash.net>
   31    46.4 ( 20.7/ 24.9/ 16.5)  Zenin <zenin@best.com>
   31    47.9 ( 25.4/ 16.0/ 10.4)  Tom Phoenix <rootbeer@teleport.com>
   23    36.2 ( 16.0/ 15.2/ 10.6)  Martien Verbruggen <mgjv@comdyn.com.au>
   19    42.0 ( 22.8/ 19.2/ 11.0)  Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
   19    28.6 ( 10.0/ 18.1/ 13.0)  Andrew M. Langmead <aml@world.std.com>
   16    37.6 ( 10.5/ 27.1/ 17.7)  Mark Mielke <markm@nortel.ca>
   13    14.9 (  7.0/  7.8/  3.9)  Eric Bohlman <ebohlman@netcom.com>

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  96.4 ( 42.6/ 44.1/ 22.3)     61  zawodny@hou.moc.com
  87.6 ( 40.1/ 36.2/ 18.0)     57  brian d foy <comdog@computerdog.com>
  56.3 ( 20.4/ 35.9/ 21.7)     34  Tad McClellan <tadmc@flash.net>
  47.9 ( 25.4/ 16.0/ 10.4)     31  Tom Phoenix <rootbeer@teleport.com>
  46.4 ( 20.7/ 24.9/ 16.5)     31  Zenin <zenin@best.com>
  42.0 ( 22.8/ 19.2/ 11.0)     19  Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
  37.6 ( 10.5/ 27.1/ 17.7)     16  Mark Mielke <markm@nortel.ca>
  36.2 ( 16.0/ 15.2/ 10.6)     23  Martien Verbruggen <mgjv@comdyn.com.au>
  28.6 ( 10.0/ 18.1/ 13.0)     19  Andrew M. Langmead <aml@world.std.com>
  25.3 (  9.9/ 10.9/  5.8)     12  Randal Schwartz <merlyn@stonehenge.com>

Top 10 Posters by OCR (minimum of five posts)
==============================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.9986     3.5 /   3.5      5  John Moreno <phenix@interpath.com>
0.9756     7.6 /   7.8     13  Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh" <bsa@void.apk.net>
0.9473     1.9 /   2.0      5  I R A Aggie <fl_aggie@thepentagon.com>
0.8573     3.6 /   4.2      6  joseph@5sigma.com
0.8348     2.9 /   3.4      6  Richard Caley <rjc@liddell.cstr.ed.ac.uk>
0.7893     1.7 /   2.2      5  Casper K. Clausen <ckc@hobbes.ejoper.dmi.min.dk>
0.7762     5.0 /   6.4      7  tina@tech.scandinaviaonline.se
0.7324     3.2 /   4.3      5  sb@en.muc.de
0.7270     4.8 /   6.6      5  "James Richardson" <jamesr@aethos.co.uk>
0.7170     4.2 /   5.8     10  Bart Lateur <bart.mediamind@tornado.be>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.5054    22.3 /  44.1     61  zawodny@hou.moc.com
0.5004     3.9 /   7.8     13  Eric Bohlman <ebohlman@netcom.com>
0.4973    18.0 /  36.2     57  brian d foy <comdog@computerdog.com>
0.4950     5.0 /  10.2     11  Steve <syarbrou@ais.net>
0.4855     4.5 /   9.2      9  "Michael A. Chase" <mchase@ix.netcom.com>
0.4717     1.4 /   3.1      6  Ilya Zakharevich <ilya@math.ohio-state.edu>
0.4608     3.0 /   6.5      7  Gabor <gabor@vinyl.quickweb.com>
0.4417     2.5 /   5.7      5  Mike Heins <mheins@prairienet.org>
0.3564     1.1 /   3.2      6  abigail@fnx.com
0.2701     1.2 /   4.5      9  Jason Gloudon <jgloudon@bbn.com>

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   27  exclusive file rights
   19  An elegant solution wanted for removing .. in path
   14  Q: How many elements in a %HASH ?
   11  how do i append todays date to the end of a filename?
   11  Another s/// question
   11  -e switch
   11  Newbie Q. How to flush print output mid-script?
   10  sequence point?
    9  Tracking people leaving a website
    9  Regex for three equal characters

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  55.7 ( 21.5/ 31.1/ 16.9)     27  exclusive file rights
  32.2 ( 13.7/ 17.4/ 11.1)     19  An elegant solution wanted for removing .. in path
  20.5 (  8.6/ 11.6/  4.7)     11  Newbie Q. How to flush print output mid-script?
  19.9 (  8.7/  9.8/  6.4)     14  Q: How many elements in a %HASH ?
  18.7 (  5.7/ 12.8/  8.5)      9  giving up on flock
  18.5 (  8.1/  8.6/  4.8)      8  How to determine absolute file path on UNIX
  18.1 (  7.3/  9.8/  7.4)     11  -e switch
  17.7 (  8.4/  8.3/  5.1)     11  how do i append todays date to the end of a filename?
  17.6 (  6.5/  9.8/  6.8)     10  sequence point?
  16.9 (  4.0/ 12.7/ 11.1)      6  Statistics for comp.lang.perl.misc

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      33  alt.fan.e-t-b
      22  comp.lang.perl.modules
       7  comp.lang.perl
       5  comp.unix.questions
       4  comp.lang.python
       4  comp.lang.c
       3  comp.infosystems.www.browsers.misc
       3  rootbeer@teleport.com
       2  comp.sys.sun.apps
       2  comp.infosystems.wais

Top 10 Crossposters
===================

Articles  Address
--------  -------

      20  Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
      17  jeff777@netzone.com
       6  Jeffrey Kegler <cybersalem@algorists.com>
       5  brian d foy <comdog@computerdog.com>
       5  Zenin <zenin@best.com>
       5  "Steven D. Majewski" <sdm7g@Virginia.EDU>
       4  Tad McClellan <tadmc@flash.net>
       4  surabaia@hotmail.com
       4  David Condon <dcondon@cmnh.org>
       3  zawodny@hou.moc.com


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

Date: Mon, 24 Nov 1997 11:37:48 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: sum in assoc array
Message-Id: <ebohlmanEK5Ez1.46K@netcom.com>

Michael R. Harper (mikihasa@worldnet.att.net) wrote:
: I am a newbie having trouble with the following snippet:

: foreach $key (keys(%SUM)) {
:  ($RESULT{'R'},
:   $RESULT{'I'},
:   $RESULT{'A'},
:   $RESULT{'S'},
:   $RESULT{'E'},
:   $RESULT{'C'}) += split(" ", $SUM{$key});
: }

: %SUM contains one string:    "2 2 2 2 2 2"

The "+=" operator can't be used for list assignment (plain "=" is the 
only such operator).  As a result, both sides of the assignment are 
evaluated in scalar context; the left-hand side becomes $RESULT{'C'} 
(since it's treated as a bunch of comma operators, whose value is the 
last entry) and the right-hand side becomes the number of elements 
returned by the split(), which happens to be 6 in this case. 


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

Date: 24 Nov 1997 03:03:53 GMT
From: wtang@cs.ualberta.ca (Wei Tang)
Subject: Using PL/SQL in Oraperl
Message-Id: <65aqqp$7vp$1@scapa.cs.ualberta.ca>

Hi, there:

I am using old Oraperl module for Perl4 :-<. But I met trouble using
PL/SQL statement via Oraperl.

The PL/SQL statement is a "create trigger" command:
create or replace TRIGGER tri_test
before INSERT
on test
BEGIN
  update sometable set somecol=xxx where ...
END;

I stored the above statement in a scalar variable and deleted the last
";".

I tried functions &ora_open and &ora_do both. But I got Oracle error:ORA-06550
which is a PL/SQL compilation error.

Could some expert help me out?

Thanks.


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

Date: Mon, 24 Nov 1997 09:29:53 -0800
From: Jim Bowlin <bowlin@sirius.com>
Subject: Re: win32 and SIG's
Message-Id: <3479B991.FCD10CBE@sirius.com>

I've tried myself and have found no solution.  Nor could I get ALRM to
work on win32.

Bob wrote:
> 
> Dear All,
> 
> I'm trying to write a script, that should be non-interutptable from a
> dos window.
> 
> I've managed to trap ctrl_C, but is it possible to trap the break key?
> 
> so far I've tried;
> 
> $SIG{INT}='IGNORE';
> $SIG{QUIT}='IGNORE';
> $SIG{TERM}='IGNORE';
> $SIG{KILL}='IGNORE';
> $SIG{HUP}='IGNORE';
> $SIG{ABRT}='IGNORE';
> $SIG{STOP}='IGNORE';
> 
> Can I trap break, and how please?


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

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

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