[6977] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 602 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 11 23:07:20 1997

Date: Wed, 11 Jun 97 20:00:25 -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, 11 Jun 1997     Volume: 8 Number: 602

Today's topics:
     Re: [Q]. Replacing a carriage return <stein@seas.ucla.edu>
     Re: [Q]. Replacing a carriage return <jon@atwww.com.au>
     ANNOUNCE: New set of Perl docs in info format (Michal Jaegermann)
     Re: BSD3.0 and Perl <jeremy@exit109.com>
     Re: Can I user oraperl with perl 5? (Ken Fox)
     Re: crypt/decrypt in perl (Danny Aldham)
     Database with ODBC cwt1959@rit.edu
     Debugging Extensions <cameron@advancedsw.com>
     Re: error with 'tr' <rootbeer@teleport.com>
     Re: global regex in an "if" statement <wayne@amerisites.com>
     Re: How to call TELNET from within a script? (Huge Cajones Remailer)
     Re: multiple white spaces (Tung-chiang Yang)
     Re: multiple white spaces (Tri Duy Tram)
     Re: Newbie : FAQ location ?? ...can u solve my problem? <ajohnson@gpu.srv.ualberta.ca>
     Re: Parsing Comma Delemited Text DataBase <youngej@magpage.com>
     Re: Perl Database (Which is better) (Danny Aldham)
     Re: perl joke of the day ? (Steffen Beyer)
     Perl script to merge access/referrer/agent Common Logs  (Ken Yee)
     Re: PERL sorting algorithm (felix k sheng)
     Re: Regular expression with double bytes <dada@divinf.it>
     RFD: comp.lang.perl reorganization (A. Deckers)
     Shared DBM Files - anyone know?? (Sportsextra)
     Sorting within an object (JUMBO inc.)
     strings (Tri Duy Tram)
     Re: tie() not creating new database? <turloughg@aol.com>
     Re: tr problems with variables <stein@seas.ucla.edu>
     Re: What does "UNIX" stand for.. <ron@sensor.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 11 Jun 1997 02:52:18 GMT
From: "John L. Stein" <stein@seas.ucla.edu>
To: jon@atwww.com.au
Subject: Re: [Q]. Replacing a carriage return
Message-Id: <5nl3t2$12q0@uni.library.ucla.edu>

Isn't \cr the carriage return. 
And \n the newline.

Also you might need \< and \>.

Try 

$form_data{$message} =~ s/\\cr/\<BR\>/g;

-js



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

Date: Thu, 12 Jun 1997 10:11:55 +1000
From: Jon Hall <jon@atwww.com.au>
Subject: Re: [Q]. Replacing a carriage return
Message-Id: <339F3ECB.26B5@atwww.com.au>

Thanks,

It's one of those things that I was sure I tried first.

Jon


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

Date: 11 Jun 1997 16:21:00 GMT
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: ANNOUNCE: New set of Perl docs in info format
Message-Id: <5nmj9c$2aa$1@nadine.teleport.com>

On CPAN it is now available a full set of "core" pods (no module
documentation) from Perl5.004 distribution converted to Texinfo and info
set of files.  Handy, in particular, if you are an emacs user.
The previous set of this kind was made from 5.002 pods.
They can be found, together with a short writeup and some tools
used in this conversion, under authors/id/MJAEG/perl-info.5.004.tar.gz.

There is even a chance that one day a link to  $CPAN/doc/manual/info/
directory will show up as well. :-)

  Michal Jaegermann
  michal@ellpspace.math.ualberta.ca




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

Date: 12 Jun 1997 01:30:12 GMT
From: Jeremy <jeremy@exit109.com>
Subject: Re: BSD3.0 and Perl
Message-Id: <5nnjf4$m7q$1@news1.exit109.com>

[posted/mailed]
Karl Hanmore  <khanmore@ultra.net.au> wrote:

>	I have hit a brick wall, and was wondering if any of you can help. 
>Recently, we upgraded our operating system to BSDi3.0, and to my dismay,
>the "bind" function under perl broke.  Next, I re-installed Perl5.004,
>to no avail.  So I tried the contributed src off of the BSDi CD Roms,
>still no go.  Does anyone have any ideas??  I am really stuck.

Could it have anything to do with the note on page 216 of the BSDI
manual, which says "Perl programs that use socket structures need to
use the 'x C n C4 x8' decoding format rather than the older for with
'S' ?

-- 
Jeremy  |  jeremy@exit109.com
The customer is always right, until he tries to say something.


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

Date: 11 Jun 1997 21:43:16 GMT
From: fox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Can I user oraperl with perl 5?
Message-Id: <5nn65k$o1g11@eccws1.dearborn.ford.com>

etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 ) writes:
> Robert Augustyn (augustyn@unn.unisys.com) wrote:
> : All references I found say that oraperl runs under perl 4
> : Is that true?
> 
> Yes. It does work exceptionally well with perl 5.

You mean the DBI and DBD::Oracle modules don't you?  I've used these
modules and they work very well.  There's also an oraperl emulation
module called Oraperl (surprise).  It also works well, but I've never
ported large scripts from Perl 4/oraperl.

- Ken

-- 
Ken Fox (kfox@ford.com)                   | My opinions or statements do
                                          | not represent those of, nor are
Ford Motor Company, Powertrain            | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department  |
Software Development Section              | "Is this some sort of trick
                                          |  question or what?" -- Calvin


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

Date: 12 Jun 1997 00:42:37 GMT
From: aldham@wimsey.com (Danny Aldham)
Subject: Re: crypt/decrypt in perl
Message-Id: <5nnglt$s8a@wolfe.wimsey.com>

Dennis Kowalski (Dennis.Kowalski@DaytonOH.NCR.com) wrote:
: I am doing development in a WINDOWS95/NT environment.
: Does anyone know how to encrypt and decrypt data in perl in this
: environment (not UNIX).
: I am currently using perl 5.001

Crypt works on NT. But you do know it is a one-way function, right?
Check out some of the cryto modules like DES, or PGP.

Danny


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

Date: Wed, 11 Jun 1997 19:24:28 -0600
From: cwt1959@rit.edu
To: cwt1959@rit.edu
Subject: Database with ODBC
Message-Id: <866074720.7333@dejanews.com>

I am currently looking for a file (in perl) that would allow me to
transfer data from my WWW application form into ACCESS automatically.

I do not want to type in all data submitted from my WWW application into
ACCESS manually.

I would appreciate it very much.

Chad Taylor

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 11 Jun 1997 22:11:17 GMT
From: "Cameron W. Skinner" <cameron@advancedsw.com>
Subject: Debugging Extensions
Message-Id: <01bc76b4$045d8580$351883cc@uther>

Hello,

Just wondering how one would go about debugging a perl extension in context
with the C++ app that is calling subroutines in that extension. What would
REALLY be cool, is if the debugger would pop up, causing the calling app to
stop processing while we step through the perl debugger.

Any suggestions?

Please reply to cameron@advancedsw.com. I get sporadic mail from the list.

Thanks,

Cam

Cameron W. Skinner
Advanced Software Technologies, Inc.
phone: (303)730-7981
email: cameron@advancedsw.com
fax:   (303)730-7983
http://www.advancedsw.com


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

Date: Wed, 11 Jun 1997 14:56:05 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: xzy@biostat.mcw.edu
Subject: Re: error with 'tr'
Message-Id: <Pine.GSO.3.96.970611135854.5767H-100000@kelly.teleport.com>

On 11 Jun 1997 xzy@biostat.mcw.edu wrote:

> Is there anyone can point out the syntax error in the following script? 

> # check if cisfile looks like a file of CIS records
> &die ("can't read file '$cisfile'") unless (-f $cisfile && -r _);
> if ((-s _) > 0) { # true if $cisfile is not of size 0
> 	open (HEAD, $cisfile);
> 	$_ = <HEAD>; # read first line
> 	close (HEAD);
> 	&die ("file '$cisfile' is not in CIS format") 
> 		unless	(tr /#/#/ == 8 && /#$/ && /^#\d\d[^#]{26}#/);
> }

Nope, because there's no syntax error in that fragment. :-)

(That's not to say that it's all correct, though. Shouldn't you check
whether the open() succeeced?)

> syntax error in file texify at line 147, next 2 tokens "tr /#/#/ == 8"

Maybe there's something earlier in your script that is making this happen?
Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/




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

Date: Wed, 11 Jun 1997 16:51:33 -0400
From: Wayne Cohoe <wayne@amerisites.com>
To: staci@datahost.com
Subject: Re: global regex in an "if" statement
Message-Id: <339F0FD5.2AC@amerisites.com>

> cannot figure out how to make this work globally. It only works on the
> first instance that it matches.
> 
> Are there any modifiers I can use to make this work globally or are
> there other techniques that will make it work?
> open (INFILE,"$_") || die ("Cannot Open $_\n");
> 
> @text=<INFILE>;
> $text=join("",@text);

I think you can change your line separator to be
something besides \n, and then you can read the whole
thing in as a single string to begin with. Not that that's
what you're asking.  :-)
> 
> $text=~ s^foo^bar^gs;
> 
> #### Here's where I am stuck. This only works on one instance and I so
> far can't get any modifiers to make it work differently.
> 
> if ( $text =~ /foo/ &&  $text !~ /bar/) {
> 
> print "YEAH\n";
> }

This answer is probably lame, but you can use sub as you did above,
subbing foo for foo and bar for bar. The sub will return the number
of subs, then you can use the r (repetition operator) to repeat your
print the number of times you matched.

Good Luck!
Wayne Cohoe
http://www.amerisites.com/amerishop


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

Date: Wed, 11 Jun 1997 08:49:21 -0700
From: nobody@huge.cajones.com (Huge Cajones Remailer)
Subject: Re: How to call TELNET from within a script?
Message-Id: <199706111549.IAA14841@fat.doobie.com>


   Huge Cajones Remailer <nobody@huge.cajones.com> contributed:
   > Can someone show me (or tell me where to look to find out) how to
   > start an interactive telnet session from within a script?  I.e. is
   > there anyway for a Perl script to call and hand over control to
   > telnet?  FWIW, I'm working in Unix.

   ## Gimme a host
   my $host = $ARGV[0];

   ## Tell perl where your telnet client is.
   my $telnet = "/bin/telnet";         ## Could be "/usr/bin/telnet"?

   ## Build my command to give to the system.
   my $command = "$telnet $host";

   ## Hand it off.
   system($command);

Ooops!!!  I'm so sorry!  I forgot to mention the most important part:
I would like to make the log-in step automatic and transparent to the
user; i.e. I want the "hand-off" to take place after the script passes
a pre-set username and password to telnet.  (In fact, I tried some-
thing like what you suggest above before, but got stuck on the problem
of passing telnet the log-in info).

Anyway, thanks you *very much* for your note.  And sorry again for my
inept description of the problem.

Kathy

No e-mail, please--post yr replies



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

Date: Wed, 11 Jun 1997 23:51:43 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: multiple white spaces
Message-Id: <tcyangEBMyA7.App@netcom.com>

Just one curious question.  If I am right, '+' refers to '1 or more'.
Therefore one space will match the pattern \s+.  Now my question is,
is it going to become an infinite pattern matching for one space for
s/\s+/ /g?  Is Perl smart enough to know it is doing s/ / /g?

================================
Greg Bacon typed when the mommy tyrannosaurus found him:
: [Posted and mailed]

: In article <EBL6ru.9on@seas.ucla.edu>,
: 	trit@olympic.seas.ucla.edu (Tri Duy Tram) writes:
: : I am wondering how do you change multiple white spaces to just one single
: : white space?

: $str =~ s/\s+/ /g;

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Thu, 12 Jun 1997 00:28:38 GMT
From: trit@olympic.seas.ucla.edu (Tri Duy Tram)
Subject: Re: multiple white spaces
Message-Id: <EBMzzu.DMJ@seas.ucla.edu>


	Thanks so much for all your help.  It seems like I was loooking for
s/\s+/ /g;
works best.  

Tung-chiang Yang (tcyang@netcom.com) wrote:
> Maybe you should try

> s/\s\s/ /g;

> and that should be easier.  I did not attempt any 'nongreedy' pattern
> matching yet, but your s statement at best removes the leading and
> lagging spaces, instead of the multiple spaces.

> ===========================
> Tri Duy Tram typed when the mommy tyrannosaurus found him:

> : I am wondering how do you change multiple white spaces to just one single
> : white space?  Lets suppose I have a string

> : $line = "This is a  line  that has multiple  white space";
> :  
> : to

> : $line = "This is a line that has multiple white spaces";

> : I tried:
> : $_ = $line;
> : s/^\s*(.*?)\s*$/$1/;

> : but that gives me an error
> : /^\s*(.?)\s*$/: nested *?+ in regexp 

> : any help will be appreciated.  Thank you.

> --
> Tung-chiang Yang                       tcyang@netcom.com

> soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
>    http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Tue, 10 Jun 1997 23:51:38 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Newbie : FAQ location ?? ...can u solve my problem?
Message-Id: <339E2EDA.32216F11@gpu.srv.ualberta.ca>

Kumar CS wrote:
! Hi,
! I'm a newbie in perl, and would like to write a few
! scripts for the following purposes :
! I heard the answers to the foll: were in the perl FAQ :

you heard correctly...
FAQ's can be found online at
http://www.perl.com/perl/info/documentation.html
if you don't already have them with your perl distribution.

! 1. select multiline text between two patterns (on different lines)
!    say
!        BEGIN
!         this is first line
!         this is second line
!         this is third line
!         END

see perlfaq6

! 2. insert multiple lines Before a certain pattern in a number of
!     files.

see perlfaq5
 
regards
andrew
--
#!/usr/bin/perl -w
$_="7072696e74224a757374416e6f746865725065726c4641512765725c6e22";
s$^$join(" ",unpack("A5A5A7A4A9",pack("C*",
map {hex} m^#!(?:\/\w+)+?\/\(\w+)\s-w\^g)));
@?=?\(*\(?\(*\d\w^gx))).(\$1?"boo":"\n")$gee;


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

Date: Wed, 11 Jun 1997 18:27:03 -0400
From: Ed Young <youngej@magpage.com>
To: nzawawi@worldnet.att.net
Subject: Re: Parsing Comma Delemited Text DataBase
Message-Id: <339F2637.287E@magpage.com>

Nasser Al-Zawawi wrote:
> 
> I trying to figure out how to parse a Text DataBase that is Comma
> delimeted and has "" Double quotes for its strings fields.  My problem
> is withen these string fields you could have a comma that should not be
> parsed.
> Meaning
> 1,"Hello, World",6,"hi"
> Should be parsed into 4 fields
> 1. 1
> 2. "Hello, World"
> 3. 6
> 4. "hi"
> 
> Not 5 fields
> 1. 1
> 2. "hello
> 3. World"
> 4. 6
> 5. "hi"
> 
> I can't figure out the regulare expression that could do that for me.
> I tried to tackle this problem with both AWK and PERL with no luck.
> I would appreciate any feed back about this.
> 
> Thanks,
> Nasser
try:
#!/usr/local/bin/perl -w

use strict;

my($n,$s,$a);

open(XXX, "<db.txt") or die "can't open: db.txt\n";
while(<XXX>)
{
  chomp;
  ($n,$s,$a) = qarray($_);
  print "$n~$s~$a\n";
}
close XXX;

sub qarray ($)
{
  my(@fields,$i);

  for (@fields = (), $i = 0; $_; ++$i)
  {
    if (/^"/o)
    {
      s/"([^"]*)",?(.*)/$2/;
      $fields[$i] = $1;
    }
    elsif (/^,/o)
    {
      s/,(.*)/$1/;
      $fields[$i] = "";
    }
    else
    {
      s/([^,]*),?(.*)/$2/;
      $fields[$i] = $1;
    }
  }
  @fields;
}
#empty fields sometimes generate stderr, why?
? cat db.txt
1,"Hello, world!",A
2,"Goodbye, blues!",B
3,"Hi!",C
4,,
,,,
"","",""
,y,z


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

Date: 12 Jun 1997 00:37:51 GMT
From: aldham@wimsey.com (Danny Aldham)
Subject: Re: Perl Database (Which is better)
Message-Id: <5nngcv$s8a@wolfe.wimsey.com>

Howard Yen (howard.yen@mci2000.com) wrote:
: I need to develop a site that will have hundreds of thousands
: of users. Currently the site is done using Perl.
: Which of these 3 is the best way to go, in terms of speed,
: expandability and using the least memory.

: 1. Msql
: 2. DB_File
: 3. Sprite

PostgreSQL.

Danny


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

Date: 11 Jun 1997 21:07:18 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: perl joke of the day ?
Message-Id: <5nn426$d4g$1@en1.engelschall.com>

Hello Michal Jaegermann, in a previous mail you wrote:
> In article <5nljql$nbg$1@en1.engelschall.com> you wrote:
> : 
> : I.e.,
> : 
> :          if ( length($aString) )
> :          if ( length($aString) > 0 )
> :          if ( length($aString) gt 0 )
> : 
> : (Also counting unnecessary steps or weird although working constructs
> : as errors)
> 
> You forgot to start with 'if ($aString)'.

No, I didn't.

"if ($aString)" and "if (length($aString))" are not equivalent.

Try both with a string equal to "0" - the length is greater than zero
but the value is FALSE.

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: 11 Jun 1997 18:53:34 GMT
From: kenyee@keysolutions.com.spamguard (Ken Yee)
Subject: Perl script to merge access/referrer/agent Common Logs to Extended Log format?
Message-Id: <5nms7e$1m9$1@usenet76.supernews.com>


Does anyone know of a Perl script or program to merge the standard
NCSA Common Log format files (access, referrer, agent, error, etc.)
into single files of the Extended Log format?

 thanks,

 ken
 kenyee@leftbank.com



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

Date: 11 Jun 1997 14:39:49 GMT
From: felix@chance.em.nytimes.com (felix k sheng)
Subject: Re: PERL sorting algorithm
Message-Id: <slrn5ptedp.9us.felix@chance.em.nytimes.com>

On Tue, 10 Jun 1997 13:19:58 +0100, Robert Davis <rjdavis@nortel.ca> wrote:
>  I have a text file containing a list,
>  each entry containing a number followed by a letter
>  (person's initial) followed by their last name (surname), e.g.:
>
>
>     1 J Bloggs
>     2 C Cat
>     3 D Jones
>     4 P Smith
>
>     etc.
>
>  I would like to sort this list by last name (surname).

if you have to use perl for this i believe there was another
post on that, but if you just need to sort the file i believe you
can use:

sort -k 3,3 filename 

hmm, i guess that's assuming you are on a unix machine.  but
if you are that should work.

'lx

--- felix sheng                                       pager     800 979 2171
 programmer                                           tel       212 597 8069
 the new york times electronic media company          e    felix@nytimes.com


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

Date: Wed, 11 Jun 1997 20:56:51 +0200
From: Aldo Calpini <dada@divinf.it>
To: Martin Yan <mkyan@cse.cuhk.edu.hk>
Subject: Re: Regular expression with double bytes
Message-Id: <339EF4F3.99DE7856@divinf.it>

Martin Yan wrote:
> 
> Hello all,
> 
>         I am trying write to a search engine with the capability to
> search a database blend with signle byte and double bytes 
> characters(such as chinese).  But i found that some of the double 
> bytes character are composed of some regular expression keywords, such 
> as ^, %,........
>         Can someone show me the correct way to tackle this problem??
>         Thanx!

One way could be to use \Q and \E.
For example:

$string = "^%@@$_"; # I don't know what it means in chinese ;)
if($database =~ /\Q$string\E/) {
    print "found";
}

If you enclose a string within \Q..\E, its special characters will not
be interpreted by the regexp.

HTH.

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: 11 Jun 1997 16:20:23 GMT
From: deckers@man.ac.uk (A. Deckers)
Subject: RFD: comp.lang.perl reorganization
Message-Id: <5nmj87$282$1@nadine.teleport.com>

                     REQUEST FOR DISCUSSION (RFD)
            moderated group comp.lang.perl.data-structure
             moderated group comp.lang.perl.inter-process
              moderated group comp.lang.perl.programmer
                 moderated group comp.lang.perl.regex

This is a formal Request for Discussion (RFD) for the creation of
world-wide moderated Usenet newsgroups in the comp.lang.perl
hierarchy.  This is not a call for votes; you cannot vote at this
time. Procedural details are below.

Newsgroups lines:
comp.lang.perl.data-structure	Using Perl data structures. (Moderated)
comp.lang.perl.inter-process	Inter-process communications in Perl. (Moderated)
comp.lang.perl.programmer	General non-FAQ Perl programming issues. (Moderated)
comp.lang.perl.regex	Using Perl regular expressions. (Moderated)

RATIONALE: all groups

Most Perl-related issues are currently discussed in
comp.lang.perl.misc (clpm). The statistics compiled by one of the
proponents indicate that this group regularly receives more than
one thousand articles from approximately 500 posters each week, a
volume of traffic many readers find overwhelming.

In addition, a significant fraction of the traffic on clpm
consists of off-topic articles, many of them widely cross-posted
through the comp.* hierarchy and ammounting to little more than
flame-wars, articles asking questions that are answered in the
FAQs, and above all, a regular flow of articles asking questions
related to the Common Gateway Interface (CGI) but unrelated to
Perl.

In these circumstances, a number of regular posters to the group
have stopped reading clpm, while new readers can find it
difficult to find relevant posts. Both facts result in a reduced
usefullness of the existing clpm newsgroup.

These comp.lang.perl groups are therefore proposed as high
signal-to-noise moderated newsgroups where readers are not
subjected to the types of articles described above. The intention
is both to provide a usefull resource for inexperienced Perl
programmers, and to attract and retain experienced programmers
who can make a substantial contribution to the group.

In the light of experience in clpm, moderation is considered
essential to ensure a sufficiently high signal-to-noise ratio
that will guarantee the usefullness of the proposed groups.

The thematic split is proposed in order to provide more
specialised groups where readers (and posters) can follow topics
in which they have a special interest without necessarily having
to see articles related to other aspects of Perl.

CHARTER: all groups

The group shall be moderated using a Perl script, which shall be
overseen by a moderation panel. The moderation panel may at its
discretion implement any technical solutions it considers
necessary to enforce the provisions of this charter.

The moderation script will escrow submissions from first-time
posters, who will be sent registration instructions in addition
to the group charter and pointers to relevant references.
Submitions from registered users will be auto-approved provided
their posts comply with all the criteria set out in this charter.

By submitting a registration, users implicitly accept to abide by
the provisions of this charter. Any poster who has 5 consecutive
posts rejected by the moderation script will be removed from the
pre-approval list.

In addition, the moderation script shall be configured to reject
any article:

+ which is cross-posted, save for the blanket cross-posting
  provisions described below;

+ which is deemed to contain a binary file. In so far as it is
  practicable, the moderation script shall be configured so as to
  pass PGP signatures and similar authentication schemes, while
  rejecting articles containing binary files;

+ which is deemed to be encoded primarily using a markup scheme,
  with the exception of Plain Old Documentation (POD). In so far
  as it is practicable, the moderation script shall be configured
  so as to pass articles containing short fragments of markup
  embedded within them;

+ which is deemed to be encoded in any MIME type considered
  inappropriate by the moderation panel. Initially, only articles
  of text/plain MIME type will be accepted by the moderation
  script;

+ which is deemed to contain more quoted than unquoted text.
  This condition will not be applied to articles containing fewer
  than 40 lines of body text, excluding the signature if one is
  found. Articles without any unquoted text, not taking into
  account the signature if one is present, will be rejected;

+ which is deemed to be a duplicate of a previously submitted
  article;

+ which has a subject header starting with the string 'Re: ' but
  doesn't contain a references header;

+ which contains a signature over 6 lines in length.

In the context of this charter, a signature is defined as
everything found after the last cut line, ie /^-- $/, found in
the article.  Posters are requested to make use of such cut lines
to delimit their signature from the article body.

Any article whose primary purpose is the advertisement of a
commercial property, good or service, including job offers and
demands, MLMs and MMFs, shall be off-topic and therefore
forbidden in the group. The moderation panel may at its
discretion implement appropriate technical solutions to ensure
such articles are not published in the group.

Posters are requested to use informative subject lines, to be
concise and to the point, and to include in their posts any
relevant diagnostic information and code. The moderation panel
may at its discretion implement technical measures to enforce all
or part of this provision.

Posters are requested not to post answers to questions which are
explicitly addressed in the documentation, including the relevant
FAQs.  A pointer to the relevant resource should instead be
emailed to the questionner.

Any article rejected by the moderation script will be returned to
its author together with a copy of the charter of the relevant
group and a brief note explaining the reason for the rejection.
No attempt will be made to verify the validity of the poster's
email address, and bounces will be discarded.

The moderators of comp.lang.perl.announce, comp.answers and
news.announce.newgroups, and any succesor groups thereto, are
hereby granted blanket permission to cross-post to the proposed
groups at their discretion.

While permission to routinely cross-post to the group will not be
granted in other cases, the moderation panel will consider
requests on a case-by-case basis, and grant their approval if
they deem that this would be of significant benefit to the
readership of the group. This provision applies especially, but
is not limited to, relevant FAQs.

Sites wishing to receive posts approved by the moderation script
via email, shall apply to the moderation panel, which shall
maintain a mailing list for this purpose. This provision is
primarily intended to help poorly connected sites to reduce
propagation delay for the proposed groups.

The moderation panel will consist of no fewer than 5 and no more
than 10 members. In the case of a temporary absence by a member
of the moderation panel, he or she shall nominate a replacement
for the duration of said absence.  New members may be appointed
upon the permanent departure of an existing member, or as the
moderation panel deems appropriate.

With the exception noted in the next paragraph, the moderation
panel shall take all its decisions on the basis of a simple
majority vote among its current members, and formulate and
publish additional terms of reference, including rules of
procedure, in accordance with the provisions of this charter, at
its earliest convenience.

The moderation panel may depose one of its members if a motion to
this effect is approved by a majority of 2/3 of existing members.

All members of the moderation panel shall be authorised to cancel
any article which has not been approved by an authorised
moderation site.

Any article submitted by a member of the moderation panel outside
the exercise of his or her administrative role will be subject to
the full moderation procedure described herein.

END CHARTER.

CHARTER: comp.lang.perl.data-structure

The group comp.lang.perl.data-structure will deal with issues
related to Perl's data-structures as described in the perldata,
perldsc, perllol, perlobj and related manual pages included in
the Perl distribution.

Any article which doesn't address issues related to Perl's data
structures will be off-topic in this group, and the moderation
panel may at its discretion implement appropriate technical
solutions to ensure they are not published in the group.

END CHARTER.

MODERATOR INFO: comp.lang.perl.data-structure

Moderator: Russ Allbery <rra@stanford.edu>
Moderator: Greg Bacon <gbacon@cs.uah.edu>
Moderator: Tom Christiansen <tchrist@jhereg.perl.com>
Moderator: Alain Deckers <deckers@man.ac.uk>
Moderator: Andrew M. Langmead <aml@world.std.com>
Moderator: Tad McClellan <tadmc@flash.net>
Moderator: Chris Nandor <pudge@pobox.com>

Submission address: clp-data@perl.com
Administrative address: clp-data-request@perl.com

END MODERATOR INFO.

CHARTER: comp.lang.perl.inter-process

The group comp.lang.perl.inter-process will deal with issues
related to the implementation of interprocess communications
(signals, fifos, pipes, safe subprocesses, sockets, semaphores
and related issues) in Perl.

Any article which doesn't address issues related to the
implementation of inter-process communication in Perl structures
will be off-topic in this group, and the moderation panel may at
it discretion take appropriate measures to ensure that such
articles are not published in the group.

END CHARTER.

MODERATOR INFO: comp.lang.perl.inter-process

Moderator: Russ Allbery <rra@stanford.edu>
Moderator: Greg Bacon <gbacon@cs.uah.edu>
Moderator: Tom Christiansen <tchrist@jhereg.perl.com>
Moderator: Alain Deckers <deckers@man.ac.uk>
Moderator: Andrew M. Langmead <aml@world.std.com>
Moderator: Tad McClellan <tadmc@flash.net>
Moderator: Chris Nandor <pudge@pobox.com>

Submission address: clp-interprocess@perl.com
Administrative address: clp-interprocess-request@perl.com

END MODERATOR INFO.

CHARTER: comp.lang.perl.programmer

The group comp.lang.perl.programmer will deal with all general
Perl-related issues that are not explicitly addressed in Perl's
documentation, where documentation is defined as anything which
is found in the <URL:http://www.perl.com/CPAN/doc/> directory,
and which exceed the scope or doesn't match the subject matter of
other comp.lang.perl groups.

Any article which doesn't satisfy the preceding criteria will be
off-topic in this group, and the moderation panel may at its
discretion adopt technical measures to ensure that they are not
published in comp.lang.perl.programmer.

END CHARTER.

MODERATOR INFO: comp.lang.perl.programmer

Moderator: Russ Allbery <rra@stanford.edu>
Moderator: Greg Bacon <gbacon@cs.uah.edu>
Moderator: Tom Christiansen <tchrist@jhereg.perl.com>
Moderator: Alain Deckers <deckers@man.ac.uk>
Moderator: Andrew M. Langmead <aml@world.std.com>
Moderator: Tad McClellan <tadmc@flash.net>
Moderator: Chris Nandor <pudge@pobox.com>

Submission address: clp-programmer@perl.com
Administrative address: clp-programmer-request@perl.com

END MODERATOR INFO.

CHARTER: comp.lang.perl.regex

The group comp.lang.perl.regex will deal with issues related to
Perl's regular expressions as described in the perlre manual page
and related documents.

Any article which doesn't address issues related to Perl's
regular expression will be off-topic in this group, and the
moderation panel may adopt appropriate technical solutions to
ensure that such articles are not posted in the group.

END CHARTER.

MODERATOR INFO: comp.lang.perl.regex

Moderator: Russ Allbery <rra@stanford.edu>
Moderator: Greg Bacon <gbacon@cs.uah.edu>
Moderator: Tom Christiansen <tchrist@jhereg.perl.com>
Moderator: Alain Deckers <deckers@man.ac.uk>
Moderator: Andrew M. Langmead <aml@world.std.com>
Moderator: Tad McClellan <tadmc@flash.net>
Moderator: Chris Nandor <pudge@pobox.com>

Submission address: clp-regex@perl.com
Administrative address: clp-regex-request@perl.com

END MODERATOR INFO.

PROCEDURE:

This is a request for discussion, not a call for votes.  In this
phase of the process, any potential problems with the proposed
newsgroups should be raised and resolved.  The discussion period
will continue for a minimum of 21 days (starting from when the
first RFD for this proposal is posted to
news.announce.newgroups), after which a Call For Votes (CFV) may
be posted by a neutral vote taker if the discussion warrants it.
Please do not attempt to vote until this happens.

All discussion of this proposal should be posted to news.groups.

This RFD attempts to comply fully with the Usenet newsgroup
creation guidelines outlined in "How to Create a New Usenet
Newsgroup" and "How to Format and Submit a New Group Proposal".
Please refer to these documents (available in
news.announce.newgroups) if you have any questions about the
process.

DISTRIBUTION:

This RFD has been posted to the following groups:

        news.announce.newgroups
        news.groups
        comp.lang.perl.misc
        comp.lang.perl.modules
        comp.lang.perl.tk

Proponent: Russ Allbery <rra@stanford.edu>
Proponent: Greg Bacon <gbacon@cs.uah.edu>
Proponent: Tom Christiansen <tchrist@jhereg.perl.com>
Proponent: Alain Deckers <deckers@man.ac.uk>
Proponent: Andrew M. Langmead <aml@world.std.com>
Proponent: Tad McClellan <tadmc@flash.net>
Proponent: Chris Nandor <pudge@pobox.com>

-- 
Alain Deckers <deckers@man.ac.uk>




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

Date: Thu, 12 Jun 1997 00:48:52 GMT
From: sportsextra@best.com (Sportsextra)
Subject: Shared DBM Files - anyone know??
Message-Id: <5nnh56$k0e$1@nntp2.ba.best.com>

I'm using DBM files that are shared by multiple scripts running at the
same time under FreeBSD and Perl 5.0.

Up til now, I've been locking a seperate dummy file only around dbm
work that WRITES to the database.  (and not locking when reading).  

Lately the databases have been getting corrupted, so I added code to
lock the dummy file around any READS from the database as well.

I would just like to know if anyone else has had problems (lost
records, etc) when multiple programs are using one DBM and only
locking on a WRITE.

Now that I'm locking while READING as well I hope the problem will go
away, I'll have to see if it works...





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

Date: 11 Jun 1997 11:57:45 -0400
From: jumbo2@saturn.superlink.net (JUMBO inc.)
Subject: Sorting within an object
Message-Id: <jumbo2.866044238@saturn>

Here's a nice problem I hope someone can solve for me. I'm currently
working on a Perl program wherein I have a semi-complex object, lets call
it $list. And within list, there is a hash table called 'resources' which
has a type of resource-code as its key. Each resource then has various
characteristics, one of which is 'cat' or category. So you can have
something like this in the main program.

$list->{resource}{CCP100A}{cat} = 'Some Category';

Well anyway, I need to display all of the resources within the $list
object, so I did something like this:

foreach $code {keys %{$list->{resources}}) {
  print $list->{resources}{$code}{name};
}

or something like that....but then I also needed to SORT them by category,
so I created a sorting subroutine called by_cat which looked like this:

sub by_cat {
  $list->{resources}{$a}{cat}.$a cmp $list->{resources}{$b}{cat}.$b
}

very simple ... it sorts by category, then by code within the category -
and it all worked fine and the kingdom was prosperous.

HOWEVER ... what I really should be doing is placing the SORT subroutine
within the List object. Because right now I call:

$list->display;

which is a routine within the object, which lists all of the resources.
Now, my problem is, if I take the display routine out of the object, and
place it in main, along with the cat_by routine in main, it all works
fine, but if I try to place both within the list object, it doesn't work.

I'm sure there is something involved in having a sort routine WITHIN an
object that is causing the problem ...

does anyone have any ideas?




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

Date: Thu, 12 Jun 1997 00:43:54 GMT
From: trit@olympic.seas.ucla.edu (Tri Duy Tram)
Subject: strings
Message-Id: <EBn0p7.Ixv@seas.ucla.edu>

	I am wondering how do I go about modifying strings in perl?  In 
particular, I want to do something like changing:

[CODE1] (options1)
[CODE2 (options2)]
[CODE3(options3)]

to

[CODE1] (options1)
[CODE2] (options2)
[CODE3] (options3)

Is perl a good candidate to do this?  I can't figure out how to do a regular 
expressing for this.  I've been able to get rid of the right bracket with
s/\]//;

but that also gets rid of the bracket for the first option.  Thanks.


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

Date: Wed, 11 Jun 1997 20:01:46 -0400
From: Gary Geniesse <turloughg@aol.com>
Subject: Re: tie() not creating new database?
Message-Id: <339F3C6A.3FCE@aol.com>

> #!/usr/bin/perl
> use AnyDBM_File;
> tie(%DBDATA, DB_File, 'myDB', O_CREAT|O_RDWR) || die("$0: open myDB
> ($!)\n");
> untie(%DBDATA);
> exit;

After many days of searching, I finally found out the answer is that
O_CREAT and O_RDWR aren't defined.  The correct answer is to:

use Fcntl qw(O_RDWR O_CREAT);

 ...just posting this in case any poor sod like me has the same problem
later on. :)

-Gary


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

Date: 11 Jun 1997 02:42:21 GMT
From: "John L. Stein" <stein@seas.ucla.edu>
To: e105578@orca.cc.metu.edu.tr
Subject: Re: tr problems with variables
Message-Id: <5nl3ad$12q0@uni.library.ucla.edu>

#! /usr/local/bin/perl -w

$char1 = "x";
$char2 = "w";
$cad = "HelloxPerlxNewsx!\n";

$_ = $cad;
s/$char1/$char2/g; 			#substitute $char1 with $char2 globally.
print; 							#print the default variable namely $_.


$changes = tr/$char1/$char2/;		#exchanges 2 for 1 in $_.
print "CHANGES: $changes\n"; 		#prints the return value.



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

Date: Wed, 11 Jun 1997 10:27:39 -0400
From: Ron Natalie <ron@sensor.com>
Subject: Re: What does "UNIX" stand for..
Message-Id: <339EB5DB.3701@sensor.com>

> The UHH is tripe. Waste of money.

Nah, even as a long time UNIX programmer, I find large parts
of it amusing.  Certain phrases like "error messages appearing
in 18 point troglodyte bold whenever NFS wets it's pants over
some timeout" or "the Motif self-abuse kit" are forever engrained
in my psyche.  It does come with a functional barf bag whose
use is not limited to UNIX.

-Ron


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

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

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