[10315] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3908 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 6 19:07:31 1998

Date: Tue, 6 Oct 98 16:00:34 -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           Tue, 6 Oct 1998     Volume: 8 Number: 3908

Today's topics:
    Re: "Many Jars" Mystery (Larry Rosler)
    Re: "Many Jars" Mystery (I R A Aggie)
    Re: "Many Jars" Mystery <Paul.Makepeace@POBox.com>
    Re: "Many Jars" Mystery <eashton@bbnplanet.com>
    Re: "restoring" hard references (Bart Lateur)
    Re: "restoring" hard references (Mark-Jason Dominus)
    Re: Command line question! (Larry Rosler)
    Re: Command line question! <Paul.Makepeace@POBox.com>
        compare two nested arrays <xah@best.com>
    Re: compare two nested arrays (Martien Verbruggen)
    Re: compare two nested arrays (Ilya Zakharevich)
    Re: compare two nested arrays (Brand Hilton)
    Re: converting integers to bit vectors <george.kuetemeyer@mail.tju.edu>
    Re: Convet'g Excel to text <krzysztofk@rocketmail.com>
    Re: Data Search Question (Ilya Zakharevich)
    Re: Data Search Question (Larry Rosler)
        Grab few lines into the buffer in a while loop matching <vsripada@ca.oracle.com>
        Grab few lines into the buffer in a while loop matching <vsripada@ca.oracle.com>
    Re: Help with Here Document (Mark-Jason Dominus)
    Re: How to match exactly x occurrences of a character (Snowhare)
        Installing perl5.005_02 on solaris 2.5.1 <hoff@eda13.racal.com>
        Making the date look good <brettr@centuryinter.net>
    Re: ms access databases <commitman@digitalnet.com.br>
        Non-blocking filehandle for child-grandchild How? <bmaillet@cisco.com>
    Re: Optmizing regex search in a large array (from a has <Paul.Makepeace@POBox.com>
        password help (Jonistuf)
    Re: password help <rootbeer@teleport.com>
    Re: password help <commitman@digitalnet.com.br>
    Re: perl html tag parser (Question refined) ekaull@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 6 Oct 1998 14:01:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: "Many Jars" Mystery
Message-Id: <MPG.1084251e1135bbcf9897e7@nntp.hpl.hp.com>

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

In article <6vdm5d$a9l$1@nnrp1.dejanews.com> on Tue, 06 Oct 1998 18:05:33 
GMT, Patrick Timmins <ptimmins@netserv.unmc.edu> says...
> As many of you know, John Porter began using the "Many Jars"
> in his signature on or about September 17, 1998. A DejaNews
> search reveals that earlier posts on that same date from John
> Porter *did not* contain the "Many Jars" tag. Beginning with
> message 360132DE.F5BE9C87@min.net and ever since, the "Many
> Jars" is present.

It is even weirder than that.  Now it reads this way:

John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer

I doubt that these are random selections from /usr/dict/words, but...

I was going to ask him, but your paranoia is contagious.

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


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

Date: Tue, 06 Oct 1998 17:37:40 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: "Many Jars" Mystery
Message-Id: <fl_aggie-0610981737410001@aggie.coaps.fsu.edu>

In article <6vdm5d$a9l$1@nnrp1.dejanews.com>, ptimmins@netserv.unmc.edu
(Patrick Timmins) wrote:

+ Could this explain the "Many Jars" mystery?

It was in that timeframe that we got reesed from a java newsgroup. Therefore,
I make the inference that jar == Java's .jar files (Java ARchive?? something
like a .tar, AFAICT).

James


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

Date: Tue, 6 Oct 1998 21:39:48 +0100
From: "Paul Makepeace" <Paul.Makepeace@POBox.com>
Subject: Re: "Many Jars" Mystery
Message-Id: <6ve55d$4lc$1@statler.server.colt.net>

Elaine -HappyFunBall- Ashton wrote in message
<361A7BC5.6C6D44A2@bbnplanet.com>...
>Paul Makepeace wrote:
>
>> Hmm, I'd never assume anyone from c.l.p.m was a geek... Far too cool a
>> language ;-)
>
>I'm a total geek so there. ;) Geek is a compliment.

I _knew_ someone would say that. IMO/E, that interpretation is only in
common parlance among, er, geeks.

(YMMV)

>> I hear 'jars' and think 'beers'. I guess I'm just British though...
>
>Yards, darling, yards. Ah, I do miss the pubs of London.

Nah, that's country talk.

{ package Lingua::GB::Translate;

sub what_now_folks ($) {
    $_[0] =~ s-\b\w+\b-beers-g;
}


}

>Que fiz tantos planos de me entregar
>  Como fiz enganos de me encontrar
>    Como fiz estradas de me perder
>      Fiz de tudo e nada de te esquecer. - Jobim -

(English or Esperanto, puh-lease. ;-)





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

Date: Tue, 06 Oct 1998 22:37:42 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: "Many Jars" Mystery
Message-Id: <361A993E.295CF28F@bbnplanet.com>

Paul Makepeace wrote:

> I _knew_ someone would say that. IMO/E, that interpretation is only in
> common parlance among, er, geeks.

Probably true. 

> Nah, that's country talk.

I ain't never heard no hillbilly sidle up to the bar and ask fer a yard.
;)

> (English or Esperanto, puh-lease. ;-)

It loses much in translation. The language is beautiful as is the music
and its gives people something to gripe about. 

e.


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

Date: Tue, 06 Oct 1998 22:07:08 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: "restoring" hard references
Message-Id: <361b9079.4021663@news.ping.be>

pcbel@my-dejanews.com wrote:

>Is it possible to do something like this?
>
>$hashref=\%somehash;
># do something with %somehash
>#
># Restore the hash
># This doesn't work obviously:
>\%somehash=$hashref;

*Something* like that can be done. I think it is

	*somehash = $hashref;

but what you want is probably

	{
	    local %somehash;
	    # do something with %somehash
	}	
	# now %somehash is restored

or even: 

	{
	    local %somehash = %somehash; # initialize with same value
	    # do something with %somehash
	}	

I bet this does everything you want from this construct.

HTH,
Bart.


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

Date: 6 Oct 1998 17:44:50 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: "restoring" hard references
Message-Id: <6ve30i$b4m$1@monet.op.net>

In article <6vdalc$oah$1@nnrp1.dejanews.com>,  <pcbel@my-dejanews.com> wrote:
># do something with %somehash
>#
># Restore the hash

	{ local %somehash = %somehash;
	  # Do something with somehash
	}
	# Somehash is automatically restored when control exits the block.



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

Date: Tue, 6 Oct 1998 14:40:33 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Command line question!
Message-Id: <MPG.10842e2b3edccd6f9897ec@nntp.hpl.hp.com>

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

In article <361A77CB.9590D35E@mcmahon.qal.berkeley.edu> on Tue, 06 Oct 
1998 13:04:27 -0700, Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu> 
says...
> [Reply postred and e-mailed]

I usually preread my replies :-)
 
> You could do:
> if (!$ARGV[0]) {
>     print ("Enter the distance to be converted:");
>     $miles = <STDIN>;
>     chop($miles);
>     print "\n";
> } else {
>     $miles = $ARGV[0];
> }

What's wrong with 0?

  unless (defined $ARGV[0]) {

BTW, I've seen good software-engineering tips saying that when one 
consequent of a decision is much shorter than the other, put it first so 
it doesn't "get lost":

  if (defined $ARGV[0]) {
      $miles = $ARGV[0];
  } else {
      print ("Enter the distance to be converted:");
      $miles = <STDIN>;
      chop($miles);
      print "\n";
  }

There.  The two references to $ARGV[0] are together now.  Much cleaner, 
IMO.  Style points count.

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


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

Date: Tue, 6 Oct 1998 21:15:11 +0100
From: "Paul Makepeace" <Paul.Makepeace@POBox.com>
Subject: Re: Command line question!
Message-Id: <6ve3oe$2gu$1@statler.server.colt.net>


Larry Rosler wrote in message ...
>[Posted to comp.lang.perl.misc and a copy mailed.]
>
>BTW, I've seen good software-engineering tips saying that when one
>consequent of a decision is much shorter than the other, put it first so
>it doesn't "get lost":

Agreed.

>  if (defined $ARGV[0]) {
>      $miles = $ARGV[0];
>  } else {
>  }
>
>There.  The two references to $ARGV[0] are together now.  Much cleaner,
>IMO.  Style points count.

Style war *click* ON! <duke>Let's rock!</duke>

I'd do it like:

# NB the chomp; it's possible to enter a line with no \n using your
# terminal's eof character (^D often)

unless (defined ($miles = shift)) {
      print "Enter the distance to be converted:";
      chomp ($miles = <STDIN>);
      $miles =~ tr[0-9.][]cd;    # leave numeric characters (quick hack)
      print "\n";
}

$km = $miles * 25.4*12*3*1760 / 1e6;     # ... in fact.

;-)

--
Paul Makepeace, Independent Thinkers Ltd (UK)
0171 377 8668 / 0973 800436
"People are all monkeys, and I am Captain Banana"
-- Vincent Gallo










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

Date: Tue, 06 Oct 1998 14:08:45 +0000
From: "Xah" <xah@best.com>
Subject: compare two nested arrays
Message-Id: <6ve0cm$399$1@nntp2.ba.best.com>

Suppose I have two references to arbitrary nested array of arrays. I want to
compare if they are equal. (I'll be writing a function ArrayEqualQ) Is there
some shortcuts like comparing array checksum? Or, must I implement it the
normal way?

The array I'm talking about have the form [[[...]...],...].

Is there already a module that does this? The matrix related modules on CPAN
is quite large to sieve through. A suggestion on how best to approach this
would also be appreciated. Thanks.

 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 >They love, they share; They love and share and care;
 >Love and share! Share and care!
 >The Itchy and Scratchy Show!
 


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

Date: Tue, 06 Oct 1998 22:38:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: compare two nested arrays
Message-Id: <rZwS1.13$172.67773@nsw.nnrp.telstra.net>

In article <6ve0cm$399$1@nntp2.ba.best.com>,
	"Xah" <xah@best.com> writes:
> Suppose I have two references to arbitrary nested array of arrays. I want to
> compare if they are equal. (I'll be writing a function ArrayEqualQ) Is there
> some shortcuts like comparing array checksum? Or, must I implement it the
> normal way?

You could have a look at the perlfaq4, which talks about differences
of arrays. But since this is a complex structure, maybe you can use
the Data::Dumper module to do something nifty. You might also try to
do a search on dejanews. This subject (normally about regular arrays)
comes up quite a lot, and has been discussed a lot.

Good luck,
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.       | accept as reality - Calvin
NSW, Australia                      | 


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

Date: 6 Oct 1998 22:45:26 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: compare two nested arrays
Message-Id: <6ve6i6$squ$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Xah
<xah@best.com>],
who wrote in article <6ve0cm$399$1@nntp2.ba.best.com>:
> Suppose I have two references to arbitrary nested array of arrays. I want to
> compare if they are equal. (I'll be writing a function ArrayEqualQ) Is there
> some shortcuts like comparing array checksum? Or, must I implement it the
> normal way?
> 
> The array I'm talking about have the form [[[...]...],...].
> 
> Is there already a module that does this? The matrix related modules on CPAN
> is quite large to sieve through. A suggestion on how best to approach this
> would also be appreciated. Thanks.

The notion of "equality" is not straightforward.  For two values of
this notion FreezeThaw provides a way to compare things.

If I understand things correct, both notions should give the same
results in your problem (they differ for self-referenctial data only).

Ilya


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

Date: 6 Oct 1998 22:41:54 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: compare two nested arrays
Message-Id: <6ve6bi$7p110@mercury.adc.com>

In article <6ve0cm$399$1@nntp2.ba.best.com>, Xah <xah@best.com> wrote:
>Suppose I have two references to arbitrary nested array of arrays. I want to
>compare if they are equal. (I'll be writing a function ArrayEqualQ) Is there
>some shortcuts like comparing array checksum? Or, must I implement it the
>normal way?
>
>The array I'm talking about have the form [[[...]...],...].
>
>Is there already a module that does this? The matrix related modules on CPAN
>is quite large to sieve through. A suggestion on how best to approach this
>would also be appreciated. Thanks.

Indeed there is.  It's called Ref.pm.

http://www.perl.com/CPAN-local/authors/id/MUIR/modules/Ref.pm.gz

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Tue, 06 Oct 1998 17:19:21 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: converting integers to bit vectors
Message-Id: <361A8958.8A3E5419@mail.tju.edu>



Steffen Beyer wrote:

> Tom Duffy <tduffy@atl.com> wrote:
>
> > I'm attempting to convert integers to bit vectors so that I can access the
> > individual bits of the data words and I'm having trouble using pack, unpack,
> > vec. I've tried various templates (c, S, N, ...) and combinations of pack
> > and unpack. Here's an example:
>
> > $data = 0x2345;
> > $vecdata = pack("S*", $data);
> > # print out the bits to see what happened
> > for $i (0 .. 15) {
> >   print(vec($vecdata, $i, 1) . " ");
> > }
> > print "\n";
>
> > This prints
> > 1 1 0 0  0 1 0 0  1 0 1 0  0 0 1 0
> > # 4 5 2 3 (after reversing the bit order)
>
> > I'm trying to get the data in a bit vector format so that I can access the
> > bit by a bit index. I would expect the above code to put out something like
> > this (assuming the bits were being dumped out from high to low):
> > 0010 0011 0100 0101
> > # 2 3 4 5
>
> > Thanks for any help,
> > Tom
>
> Perl modules are your friend.
>
> See "Bit::Vector" on CPAN (http://www.perl.com/CPAN/modules/by-module/Bit/).

Thanks for the info!! I'll check out that module. Here's some code that I'm
currently using to read/set/clear  the "userflag" 32 bit attribute in an NT
environment:

#----------------------------------------------------------------------------
# set/clear a particular bit

sub set_bit {
    my $number = shift;       # integer we want to change
    my $bitNumber = shift;  # which bit to set
    my $bitValue = shift;      # set or clear bit (0 or 1)
    my $packedNumber;

    $packedNumber = pack "I", $number;
    vec ($packedNumber, $bitNumber, 1) = $bitValue;
    return unpack "I", $packedNumber;
}

#----------------------------------------------------------------------------
# return a bit value

sub get_bit {
    my $number = shift;       #  integer to query
    my $bitNumber = shift;  #  bit position
    my $packedNumber;

    $packedNumber = pack "I", $number;
    return vec ($packedNumber, $bitNumber, 1);
}



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

Date: 6 Oct 1998 22:18:18 GMT
From: Krzysztof Koczyjan <krzysztofk@rocketmail.com>
Subject: Re: Convet'g Excel to text
Message-Id: <361A9AAE.33B2@rocketmail.com>

Venkat Chalamalasetty wrote:
> 
> I am try'g to convert excel to text file us'g following code
> use Win32::OLE;
> $application =$application = Win32::OLE->new ('Excel.Application') or
> warn
>    "impossible to open";
> $workbook = $application->Workbooks->open("$fileName");
> $worksheet = $workbook->Worksheets(1);
> $worksheet->SaveAs( 'c:\inetpub\wwwroot\ole.txt','xlText');
						    ^^^^^^^^
You must use the value xlText not string.


> it doesn't work
> Please anyone tell me whats wrong with this

Regards
	KK


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

Date: 6 Oct 1998 21:03:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Data Search Question
Message-Id: <6ve0j4$o73$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.10842282b7ee10609897e6@nntp.hpl.hp.com>:
> > > while (<DATA>) {
> > >     my $xor = $_ ^ $datum;
> > 
> > Ouch!! I wouldn't declare variables inside a loop. I am not exactly an
> > expert on this but I would believe that this slows down your execution
> > 
> > - At the beginning of each loop, a variable has to be declared and
> > space has to be reserved in memory.
> 
> On a stack.

What kind of stack?  Savestack, returnstack, contextstack, scopestack,
stackstack, markstack, tmpsstack?  If you mean C stack, then no.  perl
does not use it to store any Perl-related info.

All the stacks above are heap-based.  And no, `my' variables are not
based on any one of these stacks (though their clearing may be).

> > - What if the compiler can not free up the entire space? leeks?
> > inefficiencies?

> Then one should get a new compiler, one that works properly.

Please tell me where can I get this better Perl compiler.

Ilya


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

Date: Tue, 6 Oct 1998 14:28:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Data Search Question
Message-Id: <MPG.10842b3e310f609f9897ea@nntp.hpl.hp.com>

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

In article <6ve0j4$o73$1@mathserv.mps.ohio-state.edu> on 6 Oct 1998 
21:03:32 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> says...
! [A complimentary Cc of this posting was sent to Larry Rosler
! <lr@hpl.hp.com>],
! who wrote in article <MPG.10842282b7ee10609897e6@nntp.hpl.hp.com>:
! > > > while (<DATA>) {
! > > >     my $xor = $_ ^ $datum;
! > > 
! > > Ouch!! I wouldn't declare variables inside a loop. I am not exactly 
an
! > > expert on this but I would believe that this slows down your 
execution
! > > 
! > > - At the beginning of each loop, a variable has to be declared and
! > > space has to be reserved in memory.
! > 
! > On a stack.
! 
! What kind of stack?  Savestack, returnstack, contextstack, scopestack,
! stackstack, markstack, tmpsstack?  If you mean C stack, then no.  perl
! does not use it to store any Perl-related info.
! 
! All the stacks above are heap-based.  And no, `my' variables are not
! based on any one of these stacks (though their clearing may be).

OK.  I am (still) innocent of Perl internals, and was speaking 
conceptually, rather than literally.  The Blue Camel (p. 189) says:  "In 
C culture they're called 'auto' variables, since they're automatically 
allocated and deallocated on scope entry and exit."  And I am steeped in 
C culture.  And it is on the C function-call stack.

! > > - What if the compiler can not free up the entire space? leeks?
! > > inefficiencies?
! 
! > Then one should get a new compiler, one that works properly.
! 
! Please tell me where can I get this better Perl compiler.

Are you implying that the current Perl compiler cannot free up the entire 
space?  leaks?  inefficiencies?

It is hard to believe that the same space, wherever it is, is not reused 
on every trip through the loop, and returned somehow on loop exit.

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


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

Date: Tue, 06 Oct 1998 18:36:44 -0400
From: Venu Sripada <vsripada@ca.oracle.com>
Subject: Grab few lines into the buffer in a while loop matching a pattern
Message-Id: <361A9B7C.9A924D8@ca.oracle.com>

Please help a Perl new-bie,

I have a large file which has variable length records which contain a
record_layout pattern at the beginning of  each line. The sample data
file would look like:

1AZ12345543219876512345098765
1AY123987234237948749592938433432
2BC768709234-2048438492dshfk29834-09234
3DE34lkj23984lksdoiuwe9823kjd0f98werkj23423k4j
1AZ2384-n2322930920390292df094
1AY123423423437948749592938433432
2BC769368034-2048438492dshfk29834-09234
3DE34lkjabcdefghijklmnopqrstuvwxyz8werkj23423k4j
4TXlskdjf34252435234k23k42l3k4l2k3j4l2k34lk23ll2k34skjf

I would like to grab the lines which start with 1AZ till the next 1AZ
put in a buffer (to manipulate as each line) and go on the next set of
lines till the next 1AZ. I am thinking of  "change the input record
separator, start a  while loop  till the next pattern (1AZ) and go into
subroutines where I want to change the record separator back to \n   ".
Can someone help me with some solution?




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

Date: Tue, 06 Oct 1998 18:41:23 -0400
From: Venu Sripada <vsripada@ca.oracle.com>
Subject: Grab few lines into the buffer in a while loop matching a pattern
Message-Id: <361A9C93.1D8B0953@ca.oracle.com>

Please help a Perl new-bie,

I have a large file which has variable length records which contain a
record_layout pattern at the beginning of  each line. The sample data
file would look like:

1AZ12345543219876512345098765
1AY123987234237948749592938433432
2BC768709234-2048438492dshfk29834-09234
3DE34lkj23984lksdoiuwe9823kjd0f98werkj23423k4j
1AZ2384-n2322930920390292df094
1AY123423423437948749592938433432
2BC769368034-2048438492dshfk29834-09234
3DE34lkjabcdefghijklmnopqrstuvwxyz8werkj23423k4j
4TXlskdjf34252435234k23k42l3k4l2k3j4l2k34lk23ll2k34skjf

I would like to grab the lines which start with 1AZ till the next 1AZ
put in a buffer (to manipulate as each line) and go on the next set of
lines till the next 1AZ. I am thinking of  "change the input record
separator, start a  while loop  till the next pattern (1AZ) and go into
subroutines where I want to change the record separator back to \n   ".
Can someone help me with some solution?




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

Date: 6 Oct 1998 17:32:40 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Help with Here Document
Message-Id: <6ve29o$b1b$1@monet.op.net>

In article <361A229B.70971D24@cornell.edu>,
Andrew Perrella  <ap85@cornell.edu> wrote:
>    Is it possible to use the "Here Document" method to print to a
>variable?

Yes, but you don't want to use `print'.  Print means to print, and you
don't want to print.  You want to assign a value to a variable, so you
need to use the assigment operator =.

Like this:

	$words = <<end_of_text;
Hello this is a atest
end_of_text




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

Date: 6 Oct 1998 21:13:53 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: How to match exactly x occurrences of a character
Message-Id: <6ve16h$kqs$1@nnrp1.snfc21.pbi.net>



Nothing above this line is part of the signed message.

In article <6vdsnm$1dk$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Snowhare (snowhare@xmission.xmission.com) wrote:
>++ 
>++ You almost had it. You just need to move the parense: [^a](aa)[^a]
>
>
>But that fails to match "aafoo" and "fooaa". It will also set pos off
>one position.
>
>Use:   /(?:^|[^a])a{2}(?!a)/    (5.004)
> or:   /(?<!a)a{2}(?!a)/        (5.005)

Conceded. I am not a huge fan of ZWLAs because they one of those
items that can make Perl so hard to read, but here they are the
right way to do it.

Benjamin Franz


Version: 2.6.2

iQCVAwUBNhqHx+jpikN3V52xAQFFiAP+PKKkkodXOrF6+K0iSBL+VM1Ed8laQklx
3W/wNeQkIv3Qo2QzLX2vBEzweLQr2Og74BDt+vMfVD0ZP1gAE/9qCjagyxuFOhqo
3q2pEaBEcYEUJqTGuJrJ78jE0t4M7tTZBHdA7LQhilOaZjmcBIKSGuWDKp+KHL9p
QRby1YPlQZI=
=1NmD
-----END PGP SIGNATURE-----


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

Date: Tue, 6 Oct 1998 18:52:07 -0400
From: "Hoff" <hoff@eda13.racal.com>
Subject: Installing perl5.005_02 on solaris 2.5.1
Message-Id: <Y9xS1.533$0Z4.513078@news.cwix.com>

Using gcc version 2.7.2, Solaris 2.5.1 on Sparc I run into this error
while running make:
gcc -B/usr/ccs/bin/  -L/usr/local/lib -o miniperl miniperlmain.o
libperl.a -lsocket -lnsl -ldl -lm -lc -lcrypt
Undefined                       first referenced
 symbol                             in file
PL_thrsv                            libperl.a(malloc.o)
pthread_getspecific                 libperl.a(malloc.o)
PL_malloc_mutex                     libperl.a(malloc.o)
PL_thr_key                          libperl.a(malloc.o)
PL_threadnum                        libperl.a(malloc.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'

I checked config_h.SH to check on threads (I suspected this) I found
#$usethreads    USE_THREADS             /**/
indicating it's not trying to make threads.

Any help will be appreciated.

Hoff

--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Jon S. Miller (a.k.a. Hoff)
Member of Technical Staff, Racal-Datacom
1601 N. Harrison Pkwy, MS D112, Sunrise, FL, USA 33323-2899
email:  hoff@eda13.racal.com
ccmail: hoff_miller@racal.com
voice:  (954) 846-6619
fax:    (954) 846-5798
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQBtAzVZuSAAAAEDAKEKilPmLMmoHCPVgeY+1HbFMlzxHjgW4v4qOQKKgWkQBbsa
qrMmz8O3BnTbidrEgzwcDWZIV7vXqYzYxMqEmpaS9lxNCXrStp88e40DEuyWIuWn
S4+jk1ENV+kIouMmwQAFF7QESG9mZg==
=NK82
-----END PGP PUBLIC KEY BLOCK-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX




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

Date: Tue, 6 Oct 1998 17:28:58 -0500
From: "brettr" <brettr@centuryinter.net>
Subject: Making the date look good
Message-Id: <6ve5qi$6im$1@newsread1-mx.centuryinter.net>

How can I convert something like this "10/06/98 06:41:13 CDT" into something
like this "Tuesday, October 06, 1998"?

brettr




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

Date: Tue, 6 Oct 1998 18:47:43 -0300
From: "Commitman" <commitman@digitalnet.com.br>
Subject: Re: ms access databases
Message-Id: <6ve3is$4in$1@srv4-poa.nutecnet.com.br>

Try to use SQL !!!

Klaus Reiger wrote in message <36192da8.0@news.extension.net>...
>does anyone have experiences with perl and ms access databases ?
>thank you for answering.
>
>Klaus.Reiger@tic-tac-toe.com
>
>
>




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

Date: Tue, 06 Oct 1998 17:25:23 -0400
From: Bob Maillet <bmaillet@cisco.com>
Subject: Non-blocking filehandle for child-grandchild How?
Message-Id: <361A8AC3.4C658627@cisco.com>

I have attempted to implement IO::Select into a proxy-server type
application so I can either use a timeout or non-blocking filehandle
when each process talks to each other..My error msgs have ranged from
strict errors to the client shutting down immediately after connecting. 
I had looked for some documentation on the subject of using select but
have to admit it seems a little confusing when dealing with multiple
processes.  Below is a part of a sample application which I found in
"Perl Cookbook"..What I'ld like to do is use select(rbits, wbits) in
this subroutine.  The perlfunc, select and IO/Select manpages have been
helpful but I'm still not there.  Any help would be greatly appreciated.

Bob


start_proxy();              # launch our own server
service_clients();          # wait for incoming
die "NOT REACHED";          # you can't get here from there

sub service_clients { 
    my (
        $local_client,              # someone internal wanting out
        $remote_server,             # the socket for escaping out
        $kidpid,                    # spawned child for each connection
    );

    $SIG{CHLD} = \&REAPER;          # harvest the moribund

    # an accepted connection here means someone inside wants out
    while ($local_client = $proxy_server->accept()) {

        print "Connecting to testmachine\n";
        $remote_server = IO::Socket::INET->new(Proto => 'tcp',
						 PeerAddr => '171.68.16.35',
						 PeerPort => 23)
                         or die "remote server: $@";

        $kidpid = fork();
        die "Cannot fork" unless defined $kidpid;
        if ($kidpid) {
            $Children{$kidpid} = time();            # remember his start
time
            close $remote_server;                   # no use to master
            close $local_client;                    # likewise
            next;                                   # go get another
client
        } 

        # at this point, we are the forked child process dedicated
        # to the incoming client.  but we want a twin to make i/o
        # easier.

        close $proxy_server;                        # no use to slave

        $kidpid = fork(); 
        die "Cannot fork" unless defined $kidpid;

        # now each twin sits around and ferries lines of data.
        # see how simple the algorithm is when you can have
        # multiple threads of control?

        # this is the fork's parent, the master's child
        if ($kidpid) {              
            select($local_client);
            $| = 1;
            print while <$remote_server>;
            kill('TERM', $kidpid);      # kill my twin cause we're done
            } 
        # this is the fork's child, the master's grandchild
        else {                      
            select($remote_server); $| = 1;
            print while <$local_client>;
            kill('TERM', getppid());    # kill my twin cause we're done
        } 
        exit;                           # whoever's still alive bites it
    } continue {
       
    } 
}


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

Date: Tue, 6 Oct 1998 20:58:16 +0100
From: "Paul Makepeace" <Paul.Makepeace@POBox.com>
Subject: Re: Optmizing regex search in a large array (from a hash)
Message-Id: <6ve2r6$1le$1@statler.server.colt.net>

[posted & mailed to author]

Scott J. Tringali wrote in message <361A63B6.1CFB@ed.ray.com>...
>Say I have a hash, %vv, which just happens to be tied to a DBM file.
>Now, further suppose I want to search for all keys that match a
>particular pattern.  So, I quickly hacked up the obvious:
>
>  @matches = grep(/^mypattern/, keys %vv);

Unless your pattern is utterly hairy, the slow bit here is probably the keys
%w. The reason for this is that it's scanning the DBM file on disk rather
than (as it would normally) pulling the keys out of memory. Thus you're
suffering from disk access v. memory access rather than grep.

You might like to keep a copy of the keys in another part of %w so you can
just grab them quickly with

get:
    @{ $w{_KEYS} }
set:
    $w{_KEYS} = [ keys %w ];    # the slow bit

(or store it elsewhere if your class allows it)

delete $w{_KEYS} before you leave (see DESTROY) if you don't want to clutter
the disk. This technique _doesn't_ store the keys list itself on disk
(altho' if you're using MLDBM be aware that things tend to get serialised,
i.e. objects thru' references are stored too).

You would obviously need to regenerate this list whenever a key is added or
removed. There are lots of ways of doing this. If you can subclass the
package you're using to tie the DBM file you could intercept STORE's and
update the field.

Or, if you were updating frequently or wanted to defer the list generation
'til you absolutely had to you could do something more sophisticated: The
STORE subroutine here would simply mark a 'dirty' flag when the key list
changed. Then, in FETCH you'd check for a retrieval of _KEYS, and if so
regenerate and remember the _KEYS key list if the 'dirty' flag is set.

No code, but I hope that provides some ideas anyway!

--
Paul Makepeace, Independent Thinkers Ltd (UK)
0171 377 8668 / 0973 800436
"People are all monkeys, and I am Captain Banana"
 -- Vincent Gallo




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

Date: 6 Oct 1998 21:21:05 GMT
From: jonistuf@aol.com (Jonistuf)
Subject: password help
Message-Id: <19981006172105.27165.00006059@ng77.aol.com>


I am interested in learning how to password protect a page.  Are there any
tutorials online that would explain all about how the .htpass (or whatever it's
called) file works and how to prompt the user for a username and password.  Any
help would be greatly appreciated.  Thanks.

-Kevin (Jonistuf@aol.com)



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

Date: Tue, 06 Oct 1998 22:18:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: password help
Message-Id: <Pine.GSO.4.02A.9810061516370.4710-100000@user2.teleport.com>

On 6 Oct 1998, Jonistuf wrote:

> I am interested in learning how to password protect a page. 

This sounds as if you're talking about having your webserver require a
password before serving the page. The docs, FAQs, and newsgroups about
webservers should be helpful. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 6 Oct 1998 18:58:07 -0300
From: "Commitman" <commitman@digitalnet.com.br>
Subject: Re: password help
Message-Id: <6ve3sl$4os$1@srv4-poa.nutecnet.com.br>

www.cgi-resource.com

There u will found what u need !!!

Jonistuf wrote in message <19981006172105.27165.00006059@ng77.aol.com>...
>
>I am interested in learning how to password protect a page.  Are there any
>tutorials online that would explain all about how the .htpass (or whatever
it's
>called) file works and how to prompt the user for a username and password.
Any
>help would be greatly appreciated.  Thanks.
>
>-Kevin (Jonistuf@aol.com)
>




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

Date: Tue, 06 Oct 1998 20:45:44 GMT
From: ekaull@my-dejanews.com
Subject: Re: perl html tag parser (Question refined)
Message-Id: <6vdvho$p5c$1@nnrp1.dejanews.com>

I've actually gotten a little closer to what I think might work.

All I really need to do is get the "tr" statement into the regular expression
(right?)

right inside of this little spot where the dot is correct?

\=+\"+(.*)\s*\"+

Here's the code

 if ($listing[$index]=~/href+\s*\=+\"+(.*)\s*\"+/i) # 1.  FIND IT
    {

       $listing[$index]=~tr/A-Z/a-z/;                  #  2. CHANGE IT
#      print $index;
#      print " ";

       print $listing[$index];                         #  3. WRITE IT
#       print ($listing[$index]=~/(\L.*)/);
       $counter++;
    }
    else
    {
#       print $index;
#	print " ";
        print $listing[$index];
#       print "\n";
    }
    $index++;
    $taglist--;


In article <6vd5b8$h41$1@nnrp1.dejanews.com>,
  ekaull@my-dejanews.com wrote:
> Here's the scoop.  I have a project with 600 or so html files that have
> numerous links in "mixed case".  The problem is that they are bein uploaded
> into a unix box.  I've aready written a program to find the href tags.
> Actually, it finds them and converts then entire line to lowercase.  That is
> not a valid solution since there is often other text on the line that get's
> converted.
>
> Could anybody give me a regular expression that finds the href tag and
> converts the contents between the double quotes to lowercase.
>
> Here's what I've got.....it's only a snippet so ignore the things like
> incrementing counters etc....
>
>  if ($listing[$index]=~/href+\s*\=+\"/i)   # looking for the href - this works
>     {
>         $listing[$index]=~tr/A-Z/a-z/;  # convert line to lower case
>                                   # want to only convert inside quotes here
> #        print $index;
> #	  print " ";
> 	  print $listing[$index];
>         $counter++;
>     }
>     else
>     {
> #	   print $index;
> #	   print " ";
>          print $listing[$index];
> #        print "\n";
>     }
>
> Thanks!
>
> Please respond by email..
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

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


Administrivia:

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

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


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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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