[6744] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 369 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 25 08:07:11 1997

Date: Fri, 25 Apr 97 05:00:31 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 25 Apr 1997     Volume: 8 Number: 369

Today's topics:
     Re: ADVERTISE TO OVER 100 MILLION PEOPLE FOR FREE!!! (Kyzer)
     ANNOUNCE: Bit::Vector (Set::IntegerFast) 4.0 (Steffen Beyer)
     Re: Calculating dates (Kyzer)
     Re: Controlling screen output (Honza Pazdziora)
     Re: Controlling screen output (Kyzer)
     Re: HELP: Recursive directory mapping <tom@eiscat.uit.no>
     need help with a simple (i hope) question. <christer@dtc.se>
     Object IDs are good ( was: Object IDs are bad ) <simo@ws6a17.gud.siemens.co.at>
     Re: OOP & perl (Kyzer)
     Problem with decoding some data including () <O.C.Kwon@durham.ac.uk>
     regular expression <febbraro@aleatoire.mathp7.jussieu.fr>
     Re: Stupid Question <dbenhur@egames.com>
     Re: Telnet and Web and Perl (Jonathan Peterson)
     Trouble with Emacs auto formatter <cphillip@kerr.phys.utas.edu.au>
     unexec'd Perl program dumps core tim.wilson@cambridge.simoco.comm
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 25 Apr 1997 10:05:59 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: ADVERTISE TO OVER 100 MILLION PEOPLE FOR FREE!!!
Message-Id: <5jpvm7$rvi@info.abdn.ac.uk>

>From the lips of Bill sprang:
: speech, we should crunch down on those people that try to send ANYTHING 
: to more than say, 20 people or 20 newsgroups.

You would have to crunch down on me and my computing class, as we bulk mail
each other with class announcements (Bcc of course)

Perhaps a clause about concenting and non-consenting mail?

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net\_/kyzer@hotmail.com|University or AUCC, thankfully.***** |always!
Mr Bishop from next door used to complain of a drafty passage, saucy devil.


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

Date: 23 Apr 1997 17:46:43 GMT
From: sb@sdm.de (Steffen Beyer)
Subject: ANNOUNCE: Bit::Vector (Set::IntegerFast) 4.0
Message-Id: <5jlhu3$pcu@sunti1.sdm.de>


I am glad and proud to submit

                    =====================================
                      Package "Bit::Vector" Version 4.0
                    =====================================
                      for Perl version 5.000 and higher

     Copyright (c) 1995, 1996, 1997 by Steffen Beyer. All rights reserved.
     This package is free software; you can redistribute it and/or modify
     it under the same terms as Perl itself.

to the Perl community.
                           =======================
                             A T T E N T I O N :
                           =======================

  #########################################################################
  ##                                                                     ##
  ##  This distribution REPLACES the "Set::IntegerFast"-distribution!!!  ##
  ##  =================================================================  ##
  ##                                                                     ##
  #########################################################################


Contents of this message:
-------------------------

  +  Where to find
  +  Reasons for the change of the name of this distribution and module
  +  Migration strategy
  +  Prerequisites
  +  What does it do
  +  New features in version 4.0
  +  This distribution contains
  +  Erratum


Where to find:
--------------

You can download this module directly from the author's web site, where you
will also find my other modules and a couple of logos describing what the
modules do:

    http://www.engelschall.com/u/sb/download/

You should also be able to find this module on any CPAN ftp site (CPAN =
"Comprehensive Perl Archive Network"), where the file "Bit-Vector-4.0.tar.gz"
should be found in any of the following directories:

    .../CPAN/authors/id/STBEY/
    .../CPAN/modules/by-category/06_Data_Type_Utilities/Bit/
    .../CPAN/modules/by-module/Bit/

To find a CPAN ftp site, you can either direct your web browser to

    http://www.perl.com/CPAN/modules/by-module/Bit/Bit-Vector-4.0.tar.gz

(which will automatically redirect you to a CPAN ftp server near you) or
look into "The Perl 5 Module List" by Tim Bunce and Andreas Koenig either
on USENET in the "comp.lang.perl.modules" newsgroup or at

    http://www.perl.com/CPAN/modules/00modlist.long.html


Reasons for the change of the name of this distribution and module:
-------------------------------------------------------------------

Version 4.0 is a complete rewrite of the whole "Set::Integerfast" package,
during which a huge number of new methods have been added to this module
(see also below!), with also large additions to its associated application
modules.

The module has been renamed to "Bit::Vector" since it now not only offers
methods for the handling of sets, but also for other applications based
on bit vectors, like boolean matrices and shift registers.

Having multiple modules using C code via the XSUB interface in one
distribution (the "Set::IntegerFast" and the "Math::MatrixBool" modules)
made things prohibitively costly to maintain.

A third such module was on the verge to arrive, one to implement bit
shift registers of arbitrary length.

Instead of duplicating the basic code to create, handle and destroy
bit vectors (which would have been the same for all three modules!),
everything was assembled into one unique C library.

The name of "Set::IntegerFast" simply didn't fit this grown library
anymore, a more general name was needed.

"Bit::Vector" seems to be the most appropriate for it.


Migration strategy:
-------------------

You will need to apply the following changes to your existing
applications that use the "Set::IntegerFast" module (use
interactive global text search & replace for this):

    "Set::IntegerFast"    -->    "Bit::Vector"         (required)

    "Empty_Interval("     -->    "Interval_Empty("     (recommended)
    "Fill_Interval("      -->    "Interval_Fill("      (recommended)
    "Flip_Interval("      -->    "Interval_Flip("      (recommended)
    "Delete("             -->    "Bit_Off("            (recommended)
    "Insert("             -->    "Bit_On("             (recommended)
    "flip("               -->    "bit_flip("           (recommended)
    "in("                 -->    "bit_test("           (recommended)
    "in("                 -->    "contains("           (alternative)
    "inclusion("          -->    "subset("             (recommended)

You should also apply these very changes to all of your applications
using the "Set::IntegerRange" and the "Math::MatrixBool" module.

This is because the same changes as in the new "Bit::Vector" module
have also been applied to these two modules, including (some of) the
new methods and (all of) the new method names and aliases!

The old method names on the left of the table above are still supported,
but deprecated from now on (this means that they could disappear at some
day in the future).

The module "Set::IntegerFast" still exists, but it is maintained only to
assure backward compatibility. It might also go sometime in the future.

Therefore, it is strongly recommended that you migrate your application(s).


Prerequisites:
--------------

Perl version 5.000 or higher, a C compiler capable of the ANSI C standard (!)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


What does it do:
----------------

The base class of this distribution, "Bit::Vector", allows you to create bit
vectors and sets of arbitrary size (only limited by the size of a machine
word and available memory on your system) with indices (= elements) in the
range from zero to some positive integer, to dynamically change the size of
such bit vectors or sets and to perform a broad range of basic operations on
them, like

  -  adding or removing elements (setting and clearing single bits),

  -  testing the presence of a certain element (testing a single bit),

  -  setting or clearing contiguous ranges of bits,

  -  detecting contiguous ranges of set bits,

  -  copying bit vectors,

  -  converting a bit vector into either a compact (hexadecimal) or a
     human-readable string representation (allowing you to store bit
     vectors in a file, for instance),

  -  reading in the contents of a bit vector from a string,

  -  comparing two bit vectors for equality and lexical order,

  -  performing bitwise shift and rotation operations,

  -  computing the union, intersection, difference, symmetric difference
     or complement of sets,

  -  testing two sets for equality or inclusion (subset relationship),

  -  computing the minimum, the maximum and the norm (number of elements)
     of a set,

and more.

Note also that it is very easy to implement sets of arbitrary intervals of
integers using this module (negative indices are no obstacle), despite the
fact that only intervals of positive integers (from zero to some positive
integer) are supported directly.

Please refer to the "Set::IntegerRange" module (also contained in this
distribution) and its man page to see how this can be done!

The "Bit::Vector" module is mainly intended for mathematical or algorithmical
computations. There are also a number of efficient algorithms that rely on
sets (and bit vectors).

An example of such an efficient algorithm (which uses a different
representation for sets, however, not bit vectors) is Kruskal's
algorithm for minimal spanning trees in graphs.

(See the module "Graph::Kruskal" and its man page in this distribution.)

Another famous algorithm using bit vectors is the "Seave of Erathostenes"
for calculating prime numbers, which is included here as a demo program
(see the file "primes.pl" in this distribution).

An important field of application is the computation of "first", "follow"
and "look-ahead" character sets for the construction of LL, SLR, LR and LALR
parsers for compilers (or a compiler-compiler, like "yacc", for instance).

(That's what the C library in this package was initially written for.)

(See Aho, Hopcroft, Ullman, "The Design and Analysis of Computer Algorithms"
for an excellent book on efficient algorithms and the famous "Dragon Book"
on how to build compilers by Aho, Sethi, Ullman.)

Therefore, this module is primarily designed for efficiency, which is the
reason why most of its methods are implemented in C.

To increase execution speed, the module doesn't use bytes as its basic storage
unit, it rather uses machine words, assuming that a machine word is the most
efficiently handled size of all scalar types on any machine (that's what the
ANSI C standard proposes and assumes anyway).

In order to achieve this, it automatically determines the number of bits
in a machine word on your system and then adjusts its internal configuration
constants accordingly.

The greater the size of this basic storage unit, the better the complexity
(= execution speed) of the methods in this module (but also the greater the
average waste of unused bits in the last word).

Note that the C library of this package ("BitVector.c") is designed in such
a way that it can be used independently from Perl and this Perl extension
module. (!)

For this, you can use the file "BitVector.o" exactly as it is produced when
building this module! It contains no references to Perl, and it doesn't need
any Perl header files in order to compile. (It only needs "Definitions.h" and
some system header files.)

Note however that this C library does not perform any bounds checking
whatsoever! (This is your application's duty!)

(See the respective explanation in the file "BitVector.c" for more details
and the file "Vector.xs" for an example of how this can be done!)

In this module, all bounds and type checking (which should be absolutely
fool-proof, BTW!) is done in the XSUB routines (in C).

For more details about the modules in this distribution, please refer to
their respective man pages!


New features in version 4.0:
----------------------------

Flip
    $vector->Flip();

Interval_Scan_inc
    while (($min,$max) = $vector->Interval_Scan_inc($start))

Interval_Scan_dec
    while (($min,$max) = $vector->Interval_Scan_dec($start))

rotate_left
    $carry_out = $vector->rotate_left();

rotate_right
    $carry_out = $vector->rotate_right();

shift_left
    $carry_out = $vector->shift_left($carry_in);

shift_right
    $carry_out = $vector->shift_right($carry_in);

to_String
    $string = $vector->to_String(); # e.g., "A08A28AC"

from_string
    $ok = $vector->from_string($string);

Multiplication
    $matrix1->Multiplication($rows1,$cols1,
    $matrix2,$rows2,$cols2,
    $matrix3,$rows3,$cols3);

Closure
    $matrix->Closure($rows,$cols);

Shadow
    $other_vector = $some_vector->Shadow();

Clone
    $twin_vector = $some_vector->Clone();

new_from_String
    eval { $vector = Bit::Vector->new_from_String($string); };

to_ASCII
    $string = $vector->to_ASCII(); # e.g., "2,3,5-7,11,13-19"

from_ASCII
    eval { $vector->from_ASCII($string); };

Emptyness
    if ($vector) # if not empty
    if (! $vector) # if empty
    unless ($vector) # if empty

    # "$index" is a number or a Perl scalar variable containing a
    # number which represents the set containing only that element:

Equality
    if ($vector1 == $vector2)
    if ($vector1 != $vector2)
    if ($vector == $index)
    if ($vector != $index)

Lexical Comparison

    $cmp = $vector1 cmp $vector2;
    if ($vector1 lt $vector2)
    if ($vector1 le $vector2)
    if ($vector1 gt $vector2)
    if ($vector1 ge $vector2)
    if ($vector1 eq $vector2)
    if ($vector1 ne $vector2)
    $cmp = $vector cmp $index;
    if ($vector lt $index)
    if ($vector le $index)
    if ($vector gt $index)
    if ($vector ge $index)
    if ($vector eq $index)
    if ($vector ne $index)

Shift Register
    $carry_out = $vector << $carry_in;
    $carry_out = $vector >> $carry_in;
    $carry_out = $carry_in >> $vector;
    $vector <<= $carry_in;
    $vector >>= $carry_in;

Rotate Register
    $carry_out = $vector << $vector->bit_test($vector->Size()-1);
    $carry_out = $vector >> $vector->bit_test(0);
    $carry_out = $vector->bit_test(0) >> $vector;
    $vector <<= $vector->bit_test($vector->Size()-1);
    $vector >>= $vector->bit_test(0);

String Conversion
    $string = "$vector";
    print "\$vector = '$vector'\n";

Union
    $set1 = $set2 + $set3;
    $set1 += $set2;
    $set1 = $set2 | $set3;
    $set1 |= $set2;
    $vector1 = $vector2 + $index;
    $vector += $index;
    $vector1 = $vector2 | $index;
    $vector |= $index;

Intersection
    $set1 = $set2 * $set3;
    $set1 *= $set2;
    $set1 = $set2 & $set3;
    $set1 &= $set2;
    $vector1 = $vector2 * $index;
    $vector *= $index;
    $vector1 = $vector2 & $index;
    $vector &= $index;

Difference
    $set1 = $set2 - $set3;
    $set1 -= $set2;
    $set1 = $set2 - $set1;
    $vector1 = $vector2 - $index;
    $vector1 = $index - $vector2;
    $vector -= $index;

ExclusiveOr
    $set1 = $set2 ^ $set3;
    $set1 ^= $set2;
    $vector1 = $vector2 ^ $index;
    $vector ^= $index;

Complement
    $set1 = -$set2;
    $set1 = ~$set2;
    $set = -$set;
    $set = ~$set;

Subset Relationship
    if ($set1 <= $set2)

True Subset Relationship
    if ($set1 < $set2)

Superset Relationship
    if ($set1 >= $set2)

True Superset Relationship
    if ($set1 > $set2)

Norm
    $norm = abs($set);


This distribution contains:
---------------------------

   *   a "BitVector" C library (can be used stand-alone!)

       (files "Definitions.h" and "BitVector.c")

          +   efficient (fast) handling of bit vectors and sets of
              integers (and more)

          +   determines the size of a machine word on your system
              and automatically configures itself accordingly for
              maximum speed of execution

   *   a "Bit::Vector" base class

       (files "Vector.pm", "Vector.xs", "typemap", "BitVector.h",
        "Definitions.h" and "BitVector.c")

          +   efficient (fast) object-oriented methods for handling
              bit vectors and sets of integers (intervals from zero
              to some positive integer)

          +   methods for converting bit vectors in strings and
              vice-versa (supports "newsrc" style sets)

          +   overloaded arithmetic and relational operators for
              maximum comfort

   *   a "Set::IntegerFast" wrapper module

       (file "lib/Set/IntegerFast.pm")

          +   assures backward compatibility to previous versions

   *   a "Set::IntegerRange" application module

       (file "lib/Set/IntegerRange.pm")

          +   object-oriented methods for handling sets of integers
              (arbitrary intervals)

          +   overloaded arithmetic and relational operators for
              maximum comfort

          +   methods for converting sets in strings and
              vice-versa

   *   a "Math::MatrixBool" application module

       (file "lib/Math/MatrixBool.pm")

          +   object-oriented methods for handling matrices of booleans
              (Boolean Algebra)

          +   overloaded arithmetic and relational operators for
              maximum comfort

          +   computes reflexive transitive closure using Kleene's
              algorithm (essential for solving path-problem in graphs)

          +   methods for converting matrices in strings and
              vice-versa

          +   matrix multiplication and closure are actually carried out
              in the "Bit::Vector" module for maximum speed of execution

Related modules (NOT derived from the "Bit::Vector" base class):

   *   "Math::MatrixReal"

       (file "lib/Math/MatrixReal.pm")

          +   object-oriented methods for handling matrices of reals

          +   overloaded arithmetic and relational operators for
              maximum comfort

          +   allows to solve linear equation systems using an
              efficient algorithm known as "LR decomposition"
              and several approximative (iterative) methods

          +   features an implementation of Kleene's algorithm to
              compute the minimal costs for all paths in a graph
              with weighted edges

          +   methods for converting matrices in strings and
              vice-versa

   *   "DFA::Kleene"

       (file "lib/DFA/Kleene.pm")

          +   another implementation of Kleene's algorithm to compute
              the language accepted by a Deterministic Finite Automaton

   *   "Math::Kleene"

       (file "lib/Math/Kleene.pod")

          +   a man page giving a brief introduction into the theory
              behind Kleene's algorithm

   *   "Graph::Kruskal"

       (file "lib/Graph/Kruskal.pm")

          +   implementation of Kruskal's efficient algorithm
              for Minimal Spanning Trees in graphs O( n * ld(n) )

          +   example of an efficient algorithm relying heavily on sets
              (with a different representation, though, not bit vectors)

Erratum:
--------

In the file "CHANGES" in the "Bit::Vector" distribution in section
"Migration strategy" is an error:

Instead of

    "Delete("             -->    "Bit_On("             (recommended)
    "Insert("             -->    "Bit_Off("            (recommended)

it should of course read

    "Delete("             -->    "Bit_Off("            (recommended)
    "Insert("             -->    "Bit_On("             (recommended)

Please excuse this lapse!

Thank you!


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

I hope you will find this module benefitful!

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


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

Date: 25 Apr 1997 10:15:35 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: Calculating dates
Message-Id: <5jq087$rvi@info.abdn.ac.uk>

>From the lips of Matthew Cravit sprang:
: In article <5jo8q8$u1@info.abdn.ac.uk>, Kyzer <dev.null> wrote:
: >($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = localtime(time-86400);

: However, bear in mind that if localtime is evaluated in a scalar context,
: it returns a formatted date string.

Hmm, useful. Must be a 5.x extra, currently I haven't finished reading the
whole of the 5.x manual, but I read the 4.x one ages ago and it never mentioned
evaluating localtime as a scalar.

: And, yes, I realize the use of scalar in the above line is superfluous, 
: but I usually put it in anyway to remind me of what I'm doing.

IMHO, scalar() should be shortened, perhaps to something good like $()
operator-overuse-R-us :)

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
BONUS: Present this .sig at Tesco for a 15% discount.


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

Date: Fri, 25 Apr 1997 09:52:27 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Controlling screen output
Message-Id: <adelton.861961947@aisa.fi.muni.cz>

Dale Churchett <daleweb@io.com> writes:


> I have a script running on a Unix server that spits formatted data
> directly to STDOUT. The problem is that I don't know how to prevent the
> screen scrolling straight past the eyes. I'd like a duplicate of the 
> 
> cat | more
> 
> command.
> 
> 
> I've tried directing the output to a temp file, and then making a 
> system call to display the file using the cat | more command:
> 
> system("cat $temp_file | more");
> 
> but his only works for one screenful, the rest of the output is not
> displayed.
> 
> Can anyone suggest a way? Forgive me if this is an easy one.

I would suggest to call your perl script and pipe its output to more:

$ script.pl | more

The reason is simple: You might need to send your data to file, to
printer, or so, and doing the paging inside of your script might not
be what you want on other occasions. Just format your data and send
them you, and leave the actual displaying on user's more command.

If you really need to do it inside your script, do

open OUT, "| more" or die;
print OUT;

or you can redirect STDOUT into this filehandle.

Hope this helps.

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


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

Date: 25 Apr 1997 10:18:22 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: Controlling screen output
Message-Id: <5jq0de$rvi@info.abdn.ac.uk>

>From the lips of Dale Churchett sprang:
: I've tried directing the output to a temp file, and then making a 
: system call to display the file using the cat | more command:
: system("cat $temp_file | more");
: but his only works for one screenful, the rest of the output is not
: displayed.
: Can anyone suggest a way? Forgive me if this is an easy one.

Would this work?

#!/bin/perl -w | more

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
sh: cookie not found


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

Date: 25 Apr 1997 13:15:01 +0200
From: Tom Grydeland <tom@eiscat.uit.no>
Subject: Re: HELP: Recursive directory mapping
Message-Id: <tru3kvfj62.fsf@eiscat.uit.no>

"Ameer Badri" <abadri@worldnet.att.net> writes:

> Hi,
> I will appreciate if someone can help me with the following problem.   I am
> looking for piece of  Perl code to recursively map a given directory for a
> specific file type (ex. *.html).

Look at File::Find

> Thanks for your time and help,

You're welcome.

> Ameer

-- 
//Tom dot Grydeland at phys dot uit dot no
            The case of Randal Schwartz - http://www.lightlink.com/fors/


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

Date: 25 Apr 1997 11:18:04 GMT
From: "Christer A. Wittusen" <christer@dtc.se>
Subject: need help with a simple (i hope) question.
Message-Id: <01bc516c$58dfa1a0$04460ec1@multix.dtc.se>

Hi.
I' m trying to write a message board, but now I got stuck on one line.
I would be greatfull if someone could help me out and let me know whats
wrong.
I get Illegal item (LEXPR) as lvalue in file aktietavlan.pl at line 296,
next 2 tokens ");"

here is some is the code.

sub Display_Message
{
	local (%data) = @_;
	local (@template, @list, @message, $subject, $message_file);
	
	# Open and read in the template

	open(TEMPLATE,"$message_template") || die "Content-type:
text/html\n\nCannot open template!";
	@template = <TEMPLATE>;
	close(TEMPLATE);

	# Open and read in the message file

	open(MESSAGE,"$message_dir/$data{\"message\"}") || die "Content-type:
	text/html\n\nCannot open message!";
	@message = <MESSAGE>;
	close(MESSAGE);

	# Open and read the list file

	open(LIST,"$list_dir/$data{\"list\"}") || die "Content-type:
	text/html\n\nCannot open message!";
	@list = <LIST>;
	close(LIST);

	# Find the subject for the message to be displayed.
	
	foreach (@list)
	{
		# Split each message header from the message list file.
---->line 296	(undef, $subject, undef, $message_file) = 
			split(/::/);

		chop $message_file;
		
		# Exit the loop when the message has been found
		last if $message_file == $data{'message'};
	}
	
	# Put the subject in the <TITLE> line of the template
	$template[2] =~ s/XXXX/$subject/ge;

	# Format the subject line for the Reply form at the end of the page
	unless ($subject =~ /^re:/i)
	{
		substr($subject, 0, 0) = "Re: ";
	}
	
	# Insert the subject and list into the template
	
	$template[20] =~ s/YYYY/$subject/ge;
	$template[26] =~ s/ZZZZ/$data{'list'}/ge;

	# Insert the message into the template and send it to the user's
	# web browser.
	
	splice(@template, 4, 0, @message);
	print "Content-type: text/html\n\n";
	print @template;
}

Please help me.

Txh

Christer
E-mail christer@dtc.se



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

Date: Fri, 25 Apr 1997 11:28:36 +0200
From: "Istvan.Simon" <simo@ws6a17.gud.siemens.co.at>
Subject: Object IDs are good ( was: Object IDs are bad )
Message-Id: <33607944.3852@ws6a17.gud.siemens.co.at>

Peter Ludemann wrote:
> If two things LOOK the same, then they ARE the same.  It's called
> "referential transparency" and it's a Good Thing, as opposed to
> "pointers" which are a Bad Thing.  Why confuse your life with "object
> identity"?

Even if two things LOOK the same then they are not the same. If they
were the same you could never make a copy from anything. If this is
true in reality then there is no reason to be untrue in programming
languages.

> And why do you want to use the memory address for object identity to
> identify it --- an address can change during garbage collection.  Why
> not use a time stamp of object creation?  Oh, it's for efficiency
> reasons, you say ... ah-ha!

You always have a memory address even you don't want to have one.
This address will identify your object even if you don't want it.

> But let's suppose that you really really really do need to identify a
> particular subtree.  In other words, you want to NAME it.  No problem:
> just create a dictionary (hash table) that maps names to subtrees.
> That'll let you have two differently named entries which might happen
> to have the same values.  And it won't expose pointers.  And it'll be
> efficient.

You are able to give the same name to different objects but you cannot
place two objects on the same place.

> Repeat after me: "if two things look the same and act the same, then
> they are the same".  Don't depend on some hidden property (pointer) to
> differentiate them.  If there are important differences, then don't be
> shy: bring them out in the open and NAME them.

I prefer not to repeat :-)

> [I once took an object-oriented database that used object-IDs and
> translated it to a relational form which just used names for things;
> performace improved by about about an order of magnitude.  But that's
> another rant for another day ...]

What was the OODB based on? Perhaphs on a relational db?

-- MfG/Bye/Udv - Simon Istvan - mailto:istvan.simon@usa.net -


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

Date: 25 Apr 1997 10:02:33 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: OOP & perl
Message-Id: <5jpvfp$rvi@info.abdn.ac.uk>


>From the lips of Jay Flaherty sprang:
: http://www.perl.com/perl/nmanual/

What's the difference between www.perl.com and perl.com ?

Also, in the CPAN mirrors, many html documents have links pointing to a file
on the master site, even though they have the file themselves as a mirror.
Why?

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
DC.W f+++ s+++ df h++++ Csilv a+ $+++ m d--- WL++ Fr---- Bslobber


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

Date: 25 Apr 1997 10:37:05 GMT
From: O C Kwon <O.C.Kwon@durham.ac.uk>
Subject: Problem with decoding some data including ()
Message-Id: <5jq1gh$31i@mercury.dur.ac.uk>

Dear ALL,

I tried to call a subroutine, ReadParse in Steve Brenner's cgi-lib.pl in 
order to decode some data that is inserted using my CGI fill-out form.
My perl script that included the subroutine, ReadParse, is
run well in some cases, but I've got a problem with writing 
some words including () such as (BDP)Business Data Processing or Software
Configuration Management(SCM). As you seen in a file below, every word
with () can't be decoded completely. It seems to me very strange that 
whenever I inserted Software Configuration Management(SCM) through a fill-out 
form, I got the following error message. This perl script runs well if I
use my own perl script for decoding. 

Any help would be grateful.
Thanks, 
Oh Cheon   email: o.c.kwon@durham.ac.uk

------ Error Message after inserting Software Configuration 
Management(SCM) ---

500 Server Error
 
The server encountered an internal error or misconfiguration 
and was unable to complete your request.
 
Please contact the server administrator, csg@easby and inform 
them of the
time the error occurred , and anything
you might have done that may have caused the error.
 
Error: HTTPd: malformed header from script
/usr/local/etc/httpd/cgi-bin/dcs3ock/register.pl

----------------------- a file created by a perl script -----------------
CI=S0014
CN=CBB Search Class Library
AN=Oh Cheon Kwon
DC=23F04F97
DR=23F04F97
MN=Oh Cheon Kwon
SN=Univ. of Durham
ABS=This is the body of an abstract.
CS=12
OS=Sun os 4.1.2
CL=CBB
CF=Source Code
DM=BDPBusiness Data Processing%29
MT=Artificial Intelligence
MT=Computer Supported Cooperative Work                            SCW%29
MT=Graphic User Interface                           0UI%29
MT=Program Comprehension
KW=
RC=
RP=
PL=
DF=

***  NB *** 
1. BDPBusiness Data Processing%29 should be BDP(Business Data 
Processing).
2. Computer Supported Cooperative Work                            SCW%29
   should be Computer Supported Cooperative Work(CSCW).
3. Graphic User Interface                           0UI%29  
   should be Graphic User Interface(GUI).
***********





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

Date: 25 Apr 1997 12:52:19 +0200
From: Philippe Febbraro <febbraro@aleatoire.mathp7.jussieu.fr>
Subject: regular expression
Message-Id: <lbu73gysc.fsf@spot.i-have-a-misconfigured-system-so-shoot-me>

hello,
i have any trouble.
I want to write a perl regexp testor and i have a trouble: 
What I want isn't what I have.
until I try with simple tests, it's good, but when I try with any more
complicated tests, it make wrong results.

The mean:
The script read on STDIN the regexp to try
and after, read line tou test with regexp.

the script:
 

#!/bin/perl
chop($regexp=<STDIN>);
print "$regexp\n";
while (chop($ch=<STDIN>)) {
 if ($ch =~ /$regexp/ ) {
print "True\n"
} else {
print "False\n"
}
}

Where is wrong ?
If I want sentences who match "Got" or "Symlink" at the begining of
the line, I write the regexp: (^(Got|symlink)), and I got what I want
to match.

But when I want sentences WHO NOT MATCH "Got" or "Symlink" at the begining of
the line, I write the regexp: (^(?!(Got|symlink))) and it fails to
match what I want: lines who begin with "Got" or "Symlink" are matched
too !

Why I write (^(?!(Got|symlink))) rather than (?!(^(Got|symlink))) ?

Because if I write directly into the script the regexp, I get what I
want with the first rexexp, but not with the second.

(who don't understand what I want to tell (it's very hard to me to
speak/write english), simply replace the line: 

 if ($ch =~ /$regexp/ ) {

by 

 if ($ch =~ /(^(?!(Got|symlink)))/ ) {

and comment the line 2 and 3.

thanks for your comments and solutions.


		---===== Philippe FEBBRARO =====---       
		febbraro@garbanzo.ufr-info-p7.ibp.fr
		febbraro@aleatoire.mathp7.jussieu.fr
				
	Un sage a dit un jour:
	La perfection n'est pas dans l'homme mais parfois 
	dans ses intentions

	" Le Paradis, c'est l'Enfer! " (Ambiguite ?)




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

Date: Fri, 18 Apr 1997 16:25:06 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Michael Slade <mslade@st.nepean.uws.edu.au>
Subject: Re: Stupid Question
Message-Id: <335802D2.3693@egames.com>

[mail&post]
Michael Slade wrote:
> How do I do something equivalent to /foo(.*)bar/si, in Perl *Version 4*?

Either:
  /foo([\0-\xff]*)bar/i;
Or:
  { local ($*) = 1; /foo(.*)bar/i; }

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out, 
 you didn't want to know anyway..." --Larry Wall



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

Date: Fri, 25 Apr 1997 10:07:04 GMT
From: jon@amxdigital.com (Jonathan Peterson)
Subject: Re: Telnet and Web and Perl
Message-Id: <3360812e.1786969@news.sonnet.co.uk>


On Mon, 21 Apr 1997 17:17:51 +0000, Atsushi Amemiya
<asahijc@erols.com> wrote:

>
>system ("find /mnt/web/guide/abcdefg/*.htm > t.dat");
>
>When I execute this program from telnet, it works, meaning, it creates a file, t.dat.
>
>But when I execute it from my web browser by a click of a button, the line is ignored.

I would suggest that you do some form of error checking (try a 
print "$!"; on the next line or something). Otherwise, years of
experience have taught me that it's probably because when you run CGI
programs, they run under a special CGI user, the same user that the
web server uses, something like 'nobody' or, on WinNT, IUSR_GUEST.

I would think that the directory where t.dat is meant to be created
has no write permission for the 'nobody' user. Try something dangerous
like 
chown -R nobody <dirname>


-----
Jon Peterson.
Views expressed are mine, not AMXdigital's.
Look young! Feel young! Die young!
----
AMXdigital: +44 171 613 5300 www.amxdigital.com
jon@amxdigital.com


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

Date: Fri, 25 Apr 1997 20:48:46 +1000
From: Chris Phillips <cphillip@kerr.phys.utas.edu.au>
Subject: Trouble with Emacs auto formatter
Message-Id: <Pine.GSO.3.94.970425204212.5784A-100000@kerr.phys.utas.edu.au>


Hi,

Emacs autoformatter is barfing on a few lines of code. Can anyone suggest
an alternative that will keep emacs happier? 

if (! defined $imatch) {
	print STDERR "\n$source not found in catalogue\n\n";
    } elsif ($imatch < 0) {
	print STDERR "$source matches:\n";
	for $key (@matches) {
	    print STDERR "      $key\n";
	}
	print "\n";
    } else {
	$ra = ${$filedata{RA}}[$imatch];      # Emacs autoformatter does 
        $dec = ${$filedata{DEC}}[$imatch];    # Not like these two lines
    }


$filedata{RA} is a reference to an array of scalars.

Cheers
Chris 
-------------------------------------------------------------------
Department of Physics, Radio Astronomy Group, University of Tasmania
email: Chris.Phillips@phys.utas.edu.au
Phone:  (03) 62262405 (Work),  (03) 62485285 (Telescope)
        (03) 62278324 (Home),  (03) 62262410 (Fax)



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

Date: 25 Apr 1997 12:21:15 +0100
From: tim.wilson@cambridge.simoco.comm
To: perlbug@perl.com
Subject: unexec'd Perl program dumps core
Message-Id: <pyenbz8i1g.fsf@cambridge.simoco.com>

This is a bug report for perl 
from tim.wilson@cambridge.simoco.comm [remove final m],
generated with the help of perlbug 1.13 running under perl 5.003.

I have compiled perl with unexelf.c from emacs 19.34.1.
After calling dump, the resulting executables work fine most of the time,
but on the large Perl program (a compiler, about 40000 SLOC) whose
start-up time I wish to reduce, 
 1. firstly the program runs fine for some time
 2. then Perl prints the message 
    Corrupt malloc ptr 0x4a9 at 0x117b800
 3. then dumps core.

I do not have a small example -- my small examples all work fine :-(

Any hints, patches, or other help welcomed!

Tim
[Note: remove final 'm' from my Reply-To address to make it valid.]
----------------------------------------------------------------------

Site configuration information for perl 5.003:

Configured by ukcwitd at Thu Apr 24 09:12:17 BST 1997.

Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
  Platform:
    osname=solaris, osver=2.4, archname=sun4-solaris
    uname='sunos serv10 5.4 generic_101945-44 sun4m sparc '
    hint=previous, useposix=true, d_sigaction=define
  Compiler:
    cc='gcc', optimize='-O -g', gccversion=2.7.2
    cppflags='-DDEBUGGING -DUNEXEC'
    ccflags ='-DDEBUGGING -DUNEXEC'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G'



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

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

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