[6473] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 98 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 12 03:07:33 1997

Date: Wed, 12 Mar 97 00:00:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 12 Mar 1997     Volume: 8 Number: 98

Today's topics:
     Re: !!!help me please!!! <rajeshg@ccwf.cc.utexas.edu>
     Re: "My" ruminations (brian d foy)
     Re: "My" ruminations (Dave Thomas)
     Re: [Q] Extract a regex <rajeshg@ccwf.cc.utexas.edu>
     Announce: Text::GenderFromName (Jon Orwant)
     Re: Announce: Text::GenderFromName (Ernesto Gianola)
     Re: Const.pm?  Where is module? <tchrist@mox.perl.com>
     help: embedding perl in visual C++ code <rajeshg@ccwf.cc.utexas.edu>
     Re: Interpreting this reg expression has me baffled <ajohnson@gpu.srv.ualberta.ca>
     Re: ISBN/Checkdigit calculator (brian d foy)
     multi-line mode and m//m (Ernesto Gianola)
     Re: need some help here <rajeshg@ccwf.cc.utexas.edu>
     Problem with grep function <ceetm@cee.hw.ac.uk>
     Re: Scope? <tchrist@mox.perl.com>
     Re: Scripts to parse common server logs (Michael Fuhr)
     Re: TCP Server from manpage fails <tchrist@mox.perl.com>
     Re: What's a good Perl book? (Rohan Lloyd)
     Re: What's a good Perl book? <NOSPAMjohntj@bellsouth.net>
     what's the advantage of a shared libperl.so?? <marclang@saxifrage.cs.washington.edu>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Mar 1997 23:34:35 -0600
From: Rajesh Gottlieb <rajeshg@ccwf.cc.utexas.edu>
To: Allen Joslin <anon7@ntplx.net>
Subject: Re: !!!help me please!!!
Message-Id: <Pine.GSO.3.96.970311233139.27980B-100000@piglet.cc.utexas.edu>



On Thu, 27 Feb 1997, Allen Joslin wrote:

> Hi All,
> 
> 	I'm trying to learn enough perl to modify a script called WWWBoard (by
> Matt Wright, who I've tried to contact -- unsuccessfully) in order to
> hide any/all obtainable user info in the posted messages, to try to help
> catch anonymous posters of obscene msgs.
> 
> 	I've found the $ENV 'REMOTE_HOST' but it only seems to take me back to
> the users' host.  I can't seem to get the users' id/username.  Is that
> possible?
> 	
> 	Is there a list of $ENV somewhere?

Here's a simple program I wrote to list the environment variables on my
unix machine. Hope it helps.

#!/usr/local/bin/perl
 
foreach $key (keys %ENV) {
   $value = $ENV{$key};
   print "$key     $value\n";
}

 
> 	What's the best way to identify a user of a site that's running perl
> scripts?
> 
> Thanks,
> 
> Al;
> 
> 

Raj



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

Date: Wed, 12 Mar 1997 00:54:44 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: "My" ruminations
Message-Id: <comdog-1203970054440001@nntp.netcruiser>

In article <5g496l$ke2@svna0001.clipper.ssb.com>, mattera@ssga.ssb.com
(Luigi Mattera) wrote:

>   I recently slapped "use strict" into my Perl programs and watched
> them crash and burn due to variables not being declared.  Ok, that was
> no problem.  I found out that the correct way to do this was via the
> "my" keyword.
> 
>   This immediately caused me to have FORTRAN flashbacks.  FORTRAN has
> a keyword "common," which as you can guess by the name makes a
> variable common to an entire program, I.E. global.  Why is this a bad
> thing?  Well then, you haven't seen FORTRAN 77 code starting with
> *pages* of common declarations.  If someone asks you to debug one of
> these, you're better off shooting yourself on the spot.

no, you don't shoot yourself.  you do what my office-mate does - crash
the computer and go skiing.   

>   The problem is that "my" seems too similar to be a coincidence.  Am
> I misinterpreting this keyword? 

my() *limits* the scope of a variable to whichever block it is in, which
is quite different from FORTRAN's COMMON scourge.  there are various
parts of the Camel book that talk about scoping, etc. [1]  you might also
want to see the perlfunc manpage for an explanation on my()  :)


[1]
Programming Perl, Larry Wall, Tom Christensen, & Randal L. Schwartz, ISBN
1-56592-149-6.  try p. 106, for instance.

-- 
brian d foy                              <URL:http://computerdog.com>                       
unsolicited commercial email is not appreciated


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

Date: 12 Mar 1997 04:02:29 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: "My" ruminations
Message-Id: <slrn5icag8.fl3.dave@fast.thomases.com>

On 11 Mar 1997 18:44:37 GMT, Luigi Mattera <mattera@ssga.ssb.com> wrote:
>  .....  FORTRAN has
> a keyword "common," which as you can guess by the name makes a
> variable common to an entire program, I.E. global.
 ...
 
>   The problem is that "my" seems too similar to be a coincidence.  Am
> I misinterpreting this keyword?  Does Perl have a main() construct
> which allows me to pass variables back and forth rather than make them
> all global by force?  I do not want to fall into the "common" trap of
> old FORTRAN 77 code, since I would like what I am doing to be readable
> after I am done with it.  Thanks for any assistance.

The bad news is you are mis-interpreting what 'my' does. The good news is it
does what you want.

The 'my' operator enforces lexical scoping on its arguments. The scope can
be file-wide, block-wide, sub-wide or eval-wide. A my variable is not
accessible outside that context (except by reference, when aliased as a
parameter or indirectly via a closure).

What this means is that 'my' variable are exactly what you want - private.

And yes, Perl does have parameter passing (these examples from Perl 5.003)


    sub fred($$)              # Fred takes 2 scalars
    {
      my ($p1, $p2) = @_;     # Make local copies of the parameters
      
      my $sum = $p1 + $p2;
      
      joe($sum);
    }
    
    sub joe($)
    {
       my $arg = shift;      # alternative way of getting parms
       print "Joe called with arg: $arg\n";
    }
    
    
    # Main program
    
    fred(1,3);
    
Regards

Dave


-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Wed, 12 Mar 1997 00:16:09 -0600
From: Rajesh Gottlieb <rajeshg@ccwf.cc.utexas.edu>
To: Vegard Bakke <vegardb@knoll.hibu.no>
Subject: Re: [Q] Extract a regex
Message-Id: <Pine.GSO.3.96.970312001257.27980C-100000@piglet.cc.utexas.edu>



On Mon, 3 Mar 1997, Vegard Bakke wrote:

> I would like to "move" the matching pattern from a regex in
> a string to a new variable.
> 
> Lets use the three first random cahacters as an example ( /^.{3}/ ).
> $OrgStr="1234567890";
> $NewStr="";
> In this example I would like the result to be:
> $OrgStr="4567890";
> $NewStr="123";
> 
> This is just an example. I after a solution that does this with
> any regex. (Not only /^.{3}/.)
> 

#!/usr/local/bin/perl 
 
$OrgStr="1234567890";
$OrgStr =~ /^.{3}/;
 
$OrgStr = $'; # $' returns everything after the matched string
print"$OrgStr\n";
$OrgStr = "$`$'"; # $` returns everything before the matched string
print"$OrgStr\n";
$NewStr = $&; # $& returns the entire matched string
print"$NewStr\n";
 
#you could experiment with parenthesis too
 
$OrgStr="1234567890";
$OrgStr =~ /^(.{3})/;
$NewStr = $1; # $1 returns the match of parentheses 1. $2 of 2 and so on.
print"$NewStr\n";
 
#output:
#4567890
#4567890
#123
#123





good luck 
Raj



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

Date: 11 Mar 1997 22:17:32 GMT
From: orwant@fahrenheit-451.media.mit.edu (Jon Orwant)
Subject: Announce: Text::GenderFromName
Message-Id: <ORWANT.97Mar11171732@fahrenheit-451.media.mit.edu>


I just uploaded this to the CPAN.

-Jon

----------------
Jon Orwant
The Perl Journal
http://tpj.com/


package Text::GenderFromName;

# Text::GenderFromName.pm
#
# Jon Orwant, <orwant@media.mit.edu>
#
# 10 Mar 97 - created
#
# Copyright 1997 Jon Orwant.  All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
# 
# Version 0.1.  Module list status is "Rdpf."

require 5;

require Exporter;
@ISA = qw( Exporter );

=head1 NAME

C<Text::GenderFromName> - Guess the gender of a "Christian" first name.

=head1 SYNOPSIS

    use Text::GenderFromName;
 
    print gender("Jon");    # prints "m"

Text::GenderFromName is available at a CPAN site near you.

=head1 DESCRIPTION

This module provides a lone function: C<gender()>, which returns
one of three values: "m" for male, "f" for female", or UNDEF if
it doesn't know.  For instance, gender("Chris") is UNDEF.

The original code assumed a default of male, and I am happy to
contribute to the destruction of the oppressive Patriarchy by
returning an UNDEF value if no rule triggers.  Ha ha!  Seriously, it'll
be useful to know when C<gender()> has no clue.

For the curious, I ran Text::GenderFromName on The Perl Journal's
subscriber list.  The result?  

   Male:    68%
   Female:  32%

=head1 BUGS

C<gender()> can never be perfect.  

I'm sure that many of these rules could return immediately upon
firing.  However, it's possible that the original author arranged them
in a very deliberate order, with more specific rules at the end
overruling earlier rules.  Consequently, I can't turn all of these
rules into the speedier form C<return "f" if /.../> without throwing
away the meaning of the ordering.  If you have the stamina to plod
through the rules and determine when the ordering doesn't matter, let
me know!

The rules should probably be made case-insensitive, but I bet there's
some funky situation in which that'll lose.

=head1 AUTHOR

Jon Orwant

The Perl Journal and MIT Media Lab

orwant@tpj.com

This is an adaptation of an awk script by Scott Pakin 8/91 in CLM
12/91.  (I have no idea what CLM is.)

=cut

@EXPORT = qw(gender);

sub gender {
    my $gender;		
    my ($name) = @_;
    # Special cases added by orwant 
    return "m" if $name =~ /^Joh?n/; # Jon and John 
    return "m" if $name =~ /^Pas(c|qu)al$/; # Pascal and Pasqual
    return "m" if $name =~ /^Th?o(m|b)/; # Tom and Thomas and Tomas and Toby
    return "m" if $name =~ /^Frank/; 
    return "m" if $name =~ /^Walt/;
    return "m" if $name =~ /^Anfernee/;
    return "m" if $name =~ /^Krishna/;
    return "f" if $name =~ /^Tri(c|sh)/; 
    return "f" if $name =~ /^Ro(z|s)/;
    return "f" if $name =~ /^Ellie/;

    # Rules from original code
    $gender = "f" if $name =~ /^.*[aeiy]$/;    # most names ending in a/e/i/y are female
    $gender = "f" if $name =~ /^All?[iy]((ss?)|z)on$/; # Allison and variations
    $gender = "f" if $name =~ /een$/; # Cathleen, Eileen, Maureen
    $gender = "m" if $name =~ /^[^S].*r[rv]e?y?$/; # Barry, Larry, Perry
    $gender = "m" if $name =~ /^[^G].*v[ei]$/; # Clive, Dave, Steve
    $gender = "f" if $name =~ /^[^BD].*(b[iy]|y|via)nn?$/; # Carolyn, Gwendolyn, Vivian
    $gender = "m" if $name =~ /^[^AJKLMNP][^o][^eit]*([glrsw]ey|lie)$/; # Dewey, Stanley, Wesley
    $gender = "f" if $name =~ /^[^GKSW].*(th|lv)(e[rt])?$/; # Heather, Ruth, Velvet
    $gender = "m" if $name =~ /^[CGJWZ][^o][^dnt]*y$/; # Gregory, Jeremy, Zachary
    $gender = "m" if $name =~ /^.*[Rlr][abo]y$/; # Leroy, Murray, Roy
    $gender = "f" if $name =~ /^[AEHJL].*il.*$/; # Abigail, Jill, Lillian
    $gender = "f" if $name =~ /^.*[Jj](o|o?[ae]a?n.*)$/; # Janet, Jennifer, Joan
    $gender = "m" if $name =~ /^.*[GRguw][ae]y?ne$/; # Duane, Eugene, Rene
    $gender = "f" if $name =~ /^[FLM].*ur(.*[^eotuy])?$/; # Fleur, Lauren, Muriel
    $gender = "m" if $name =~ /^[CLMQTV].*[^dl][in]c.*[ey]$/; # Lance, Quincy, Vince
    $gender = "f" if $name =~ /^M[aei]r[^tv].*([^cklnos]|([^o]n))$/; # Margaret, Marylou, Miri;  
    $gender = "m" if $name =~ /^.*[ay][dl]e$/; # Clyde, Kyle, Pascale
    $gender = "m" if $name =~ /^[^o]*ke$/; # Blake, Luke, Mi;  
    $gender = "f" if $name =~ /^[CKS]h?(ar[^lst]|ry).+$/; # Carol, Karen, Shar;  
    $gender = "f" if $name =~ /^[PR]e?a([^dfju]|qu)*[lm]$/; # Pam, Pearl, Rachel
    $gender = "f" if $name =~ /^.*[Aa]nn.*$/; # Annacarol, Leann, Ruthann
    $gender = "f" if $name =~ /^.*[^cio]ag?h$/; # Deborah, Leah, Sarah
    $gender = "f" if $name =~ /^[^EK].*[grsz]h?an(ces)?$/; # Frances, Megan, Susan
    $gender = "f" if $name =~ /^[^P]*([Hh]e|[Ee][lt])[^s]*[ey].*[^t]$/; # Ethel, Helen, Gretchen
    $gender = "m" if $name =~ /^[^EL].*o(rg?|sh?)?(e|ua)$/; # George, Joshua, Theodore
    $gender = "f" if $name =~ /^[DP][eo]?[lr].*s$/; # Delores, Doris, Precious
    $gender = "m" if $name =~ /^[^JPSWZ].*[denor]n.*y$/; # Anthony, Henry, Rodney
    $gender = "f" if $name =~ /^K[^v]*i.*[mns]$/; # Karin, Kim, Kristin
    $gender = "m" if $name =~ /^Br[aou][cd].*[ey]$/; # Bradley, Brady, Bruce
    $gender = "f" if $name =~ /^[ACGK].*[deinx][^aor]s$/; # Agnes, Alexis, Glynis
    $gender = "m" if $name =~ /^[ILW][aeg][^ir]*e$/; # Ignace, Lee, Wallace
    $gender = "f" if $name =~ /^[^AGW][iu][gl].*[drt]$/; # Juliet, Mildred, Millicent
    $gender = "m" if $name =~ /^[ABEIUY][euz]?[blr][aeiy]$/; # Ari, Bela, Ira
    $gender = "f" if $name =~ /^[EGILP][^eu]*i[ds]$/; # Iris, Lois, Phyllis
    $gender = "m" if $name =~ /^[ART][^r]*[dhn]e?y$/; # Randy, Timothy, Tony
    $gender = "f" if $name =~ /^[BHL].*i.*[rtxz]$/; # Beatriz, Bridget, Harriet
    $gender = "m" if $name =~ /^.*oi?[mn]e$/; # Antoine, Jerome, Tyrone
    $gender = "m" if $name =~ /^D.*[mnw].*[iy]$/; # Danny, Demetri, Dondi
    return "m" if $name =~ /^[^BG](e[rst]|ha)[^il]*e$/; # Pete, Serge, Shane
    return "f" if $name =~ /^[ADFGIM][^r]*([bg]e[lr]|il|wn)$/; # Angel, Gail, Isabel
    return $gender;
}

1;




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

Date: 12 Mar 1997 05:44:19 GMT
From: netog@cinteractive.com (Ernesto Gianola)
Subject: Re: Announce: Text::GenderFromName
Message-Id: <5g5frj$raj$1@gail.ripco.com>

Jon Orwant (orwant@fahrenheit-451.media.mit.edu) wrote:

: For the curious, I ran Text::GenderFromName on The Perl Journal's
: subscriber list.  The result?  

:    Male:    68%
:    Female:  32%

How many UNDEFs?  :)

Ernesto


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

Date: 12 Mar 1997 06:55:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Const.pm?  Where is module?
Message-Id: <5g5k0s$7qi$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    ken@forum.swarthmore.edu (Ken Williams) writes:
:I found the following mention of a 'Const' module in an old article by
:Tom.  

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1997-03-11 23:52 MST by <tchrist@jhereg.perl.com>.
# Source directory was `/home/tchrist/mxdb/binary-lib'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    337 -rw-r--r-- Const/Const.c
#    840 -rw-r--r-- Const/Const.pm
#     79 -rw-r--r-- Const/Makefile.PL
#  15557 -rw-r--r-- Const/Makefile.old
#    112 -rwxr-xr-x Const/test.pl
#    713 -rw-r--r-- Const/test2.pl
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh21994; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= Const/Const.c ==============
if test ! -d 'Const'; then
  $echo 'x -' 'creating directory' 'Const'
  mkdir 'Const'
fi
if test -f 'Const/Const.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/Const.c' '(file already exists)'
else
  $echo 'x -' extracting 'Const/Const.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/Const.c' &&
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
X
XXS(XS_Const_const)
{
X    register int i;
X
X    dXSARGS;
X    for (i = 0; i < items; i++) { SvREADONLY_on(ST(i)); }
X    XSRETURN(1);
}
X
XXS(boot_Const)
{
X    dXSARGS;
X    char* file = __FILE__;
X
X    newXS("Const::const", XS_Const_const, file);
X    ST(0) = &sv_yes;
X    XSRETURN(1);
}
SHAR_EOF
  $shar_touch -am 0627161395 'Const/Const.c' &&
  chmod 0644 'Const/Const.c' ||
  $echo 'restore of' 'Const/Const.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/Const.c:' 'MD5 check failed'
b26ea6bc4e1a2f7ed7c7742d78bdc4a1  Const/Const.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/Const.c'`"
    test 337 -eq "$shar_count" ||
    $echo 'Const/Const.c:' 'original size' '337,' 'current size' "$shar_count!"
  fi
fi
# ============= Const/Const.pm ==============
if test -f 'Const/Const.pm' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/Const.pm' '(file already exists)'
else
  $echo 'x -' extracting 'Const/Const.pm' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/Const.pm' &&
package Const;
X
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(const);
X
bootstrap Const;
X
__END__
X
=head1 NAME
X
Const - Perl module that sets variables to readonly
X
=head1 SYNOPSIS
X
X    use Const;
X    ...
X    const $a = 3, $b = 2;
X    ...
X    $b = 1;  # Error: $b is read only
X
=head1 DESCRIPTION
X
This package implements only one function, C<const>.
X
Any variable given as an argument to C<const> will be marked so that
subsequent assignment will result in an error.  The result of
providing a non-scalar argument is undefined.  C<const> returns its
first argument.
X
=head1 BUGS
X
Doesn't try to address read-only arrays or hashes.  Doesn't work on
lexical variables (my()).  Quick-and-dirty hack, so there are probably
many other problems.
X
=head1 AUTHOR
X
William Setzer <William_Setzer@ncsu.edu>
X
=cut
SHAR_EOF
  $shar_touch -am 0627161395 'Const/Const.pm' &&
  chmod 0644 'Const/Const.pm' ||
  $echo 'restore of' 'Const/Const.pm' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/Const.pm:' 'MD5 check failed'
d1cb20bd021564139210db6a56ad7f80  Const/Const.pm
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/Const.pm'`"
    test 840 -eq "$shar_count" ||
    $echo 'Const/Const.pm:' 'original size' '840,' 'current size' "$shar_count!"
  fi
fi
# ============= Const/Makefile.PL ==============
if test -f 'Const/Makefile.PL' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/Makefile.PL' '(file already exists)'
else
  $echo 'x -' extracting 'Const/Makefile.PL' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/Makefile.PL' &&
use ExtUtils::MakeMaker;
X
WriteMakefile(NAME => 'Const',
X	 VERSION => '1.1');
X
SHAR_EOF
  $shar_touch -am 0627161395 'Const/Makefile.PL' &&
  chmod 0644 'Const/Makefile.PL' ||
  $echo 'restore of' 'Const/Makefile.PL' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/Makefile.PL:' 'MD5 check failed'
1b50b3f03fcf07d4710dd243b827087e  Const/Makefile.PL
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/Makefile.PL'`"
    test 79 -eq "$shar_count" ||
    $echo 'Const/Makefile.PL:' 'original size' '79,' 'current size' "$shar_count!"
  fi
fi
# ============= Const/Makefile.old ==============
if test -f 'Const/Makefile.old' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/Makefile.old' '(file already exists)'
else
  $echo 'x -' extracting 'Const/Makefile.old' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/Makefile.old' &&
# This Makefile is for the Const extension to perl.
#
# It was generated automatically by MakeMaker version 4.16 from the contents
# of Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
#	ANY CHANGES MADE HERE WILL BE LOST! 
#
#   MakeMaker Parameters: 
#	NAME => 'Const'
#	VERSION => '1.1'
X
# --- MakeMaker post_initialize section:
X
X
# --- MakeMaker const_config section:
X
# These definitions are from config.sh (via /usr/local/lib/perl5/sun4-sunos/Config.pm)
CC = cc
LIBC = /usr/lib/libc.so.1.9.4
LDFLAGS = 
LDDLFLAGS = -assert nodefinitions
CCDLFLAGS =  
CCCDLFLAGS = -fpic
RANLIB = /usr/bin/ranlib
SO = so
DLEXT = so
DLSRC = dl_dlopen.xs
X
X
# --- MakeMaker constants section:
X
NAME = Const
DISTNAME = Const
VERSION = 1.1
VERSION_SYM = 1_1
X
# In which directory should we put this extension during 'make'?
# This is typically ./blib.
# (also see INST_LIBDIR and relationship to ROOTEXT)
INST_LIB = ./blib
INST_ARCHLIB = ./blib
INST_EXE = ./blib
X
# AFS users will want to set the installation directories for
# the final 'make install' early without setting INST_LIB,
# INST_ARCHLIB, and INST_EXE for the testing phase
INSTALLPRIVLIB = /usr/local/lib/perl5
INSTALLARCHLIB = /usr/local/lib/perl5/sun4-sunos
INSTALLBIN = /usr/local/bin
X
# Perl library to use when building the extension
PERL_LIB = /usr/local/lib/perl5
PERL_ARCHLIB = /usr/local/lib/perl5/sun4-sunos
LIBPERL_A = libperl.a
X
MAKEMAKER = $(PERL_LIB)/ExtUtils/MakeMaker.pm
MM_VERSION = 4.16
I_PERL_LIBS = -I$(PERL_ARCHLIB) -I$(PERL_LIB)
X
# Perl header files (will eventually be under PERL_LIB)
PERL_INC = /usr/local/lib/perl5/sun4-sunos/CORE
# Perl binaries
PERL = /usr/local/bin/perl
FULLPERL = /usr/local/bin/perl
X
# FULLEXT = Pathname for extension directory (eg DBD/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
# ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
FULLEXT = Const
BASEEXT = Const
ROOTEXT = 
X
INC = 
DEFINE = 
OBJECT = $(BASEEXT).o
LDFROM = $(OBJECT)
LINKTYPE = dynamic
X
# Handy lists of source code files:
XXS_FILES= 
C_FILES = Const.c
O_FILES = Const.o
H_FILES = 
X
X.SUFFIXES: .xs
X
X.PRECIOUS: Makefile
X
X.NO_PARALLEL:
X
X.PHONY: all config static dynamic test linkext
X
# This extension may link to it's own library (see SDBM_File)
MYEXTLIB = 
X
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
X
# Where to put things:
INST_LIBDIR     = $(INST_LIB)$(ROOTEXT)
INST_ARCHLIBDIR = $(INST_ARCHLIB)$(ROOTEXT)
X
INST_AUTODIR      = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR  = $(INST_ARCHLIB)/auto/$(FULLEXT)
X
INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT).a
INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(BASEEXT).$(DLEXT)
INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
X
INST_PM = $(INST_LIBDIR)/Const.pm
X
X
# --- MakeMaker const_loadlibs section:
X
# Const might depend on some other libraries:
# (These comments may need revising:)
#
# Dependent libraries can be linked in one of three ways:
#
#  1.  (For static extensions) by the ld command when the perl binary
#      is linked with the extension library. See EXTRALIBS below.
#
#  2.  (For dynamic extensions) by the ld command when the shared
#      object is built/linked. See LDLOADLIBS below.
#
#  3.  (For dynamic extensions) by the DynaLoader when the shared
#      object is loaded. See BSLOADLIBS below.
#
# EXTRALIBS =	List of libraries that need to be linked with when
#		linking a perl binary which includes this extension
#		Only those libraries that actually exist are included.
#		These are written to a file and used when linking perl.
#
# LDLOADLIBS =	List of those libraries which can or must be linked into
#		the shared library when created using ld. These may be
#		static or dynamic libraries.
#		LD_RUN_PATH is a colon separated list of the directories
#		in LDLOADLIBS. It is passed as an environment variable to
#		the process that links the shared library.
#
# BSLOADLIBS =	List of those libraries that are needed but can be
#		linked in dynamically at run time on this platform.
#		SunOS/Solaris does not need this because ld records
#		the information (from LDLOADLIBS) into the object file.
#		This list is used to create a .bs (bootstrap) file.
#
EXTRALIBS  = 
LDLOADLIBS = 
BSLOADLIBS = 
LD_RUN_PATH= 
X
X
# --- MakeMaker const_cccmd section:
CCCMD = $(CC) -c -O
X
X
# --- MakeMaker tool_autosplit section:
X
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
X
X
# --- MakeMaker tool_xsubpp section:
X
XXSUBPPDIR = $(PERL_LIB)/ExtUtils
XXSUBPP = $(XSUBPPDIR)/xsubpp
XXSUBPPDEPS = $(XSUBPPDIR)/typemap
XXSUBPPARGS = -typemap $(XSUBPPDIR)/typemap
X
X
# --- MakeMaker tools_other section:
X
SHELL = /bin/sh
LD = ld
TOUCH = touch
CP = cp
MV = mv
RM_F  = rm -f
RM_RF = rm -rf
CHMOD = chmod
X
# The following is a portable way to say mkdir -p
MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){ next if -d $$p; my(@p); foreach(split(/\//,$$p)){ push(@p,$$_); next if -d "@p/"; print "mkdir @p"; mkdir("@p",0777)||die $$! }} exit 0;'
X
X
# --- MakeMaker macro section:
X
X
# --- MakeMaker post_constants section:
X
X
# --- MakeMaker pasthru section:
X
PASTHRU1 = INST_LIB="$(INST_LIB)"\
X	INST_ARCHLIB="$(INST_ARCHLIB)"\
X	INST_EXE="$(INST_EXE)"\
X	INSTALLPRIVLIB="$(INSTALLPRIVLIB)"\
X	INSTALLARCHLIB="$(INSTALLARCHLIB)"\
X	INSTALLBIN="$(INSTALLBIN)"\
X	LIBPERL_A="$(LIBPERL_A)"\
X	LINKTYPE="$(LINKTYPE)"
X
PASTHRU2 = INSTALLPRIVLIB="$(INSTALLPRIVLIB)"\
X	INSTALLARCHLIB="$(INSTALLARCHLIB)"\
X	INSTALLBIN="$(INSTALLBIN)"\
X	LIBPERL_A="$(LIBPERL_A)"\
X	LINKTYPE="$(LINKTYPE)"
X
X
# --- MakeMaker c_o section:
X
X.c.o:
X	$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c
X
X
# --- MakeMaker xs_c section:
X
X.xs.c:
X	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
X
X
# --- MakeMaker xs_o section:
X
X.xs.o:
X	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
X	$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c
X
X
# --- MakeMaker top_targets section:
X
all ::	config linkext $(INST_PM)
X
X
config :: Makefile $(INST_LIBDIR)/.exists $(INST_ARCHAUTODIR)/.exists Version_check
X
$(INST_LIBDIR)/.exists :: $(PERL)
X	@ $(MKPATH) $(INST_LIBDIR)
X	@ $(TOUCH) $(INST_LIBDIR)/.exists
X
$(INST_ARCHAUTODIR)/.exists :: $(PERL)
X	@ $(MKPATH) $(INST_ARCHAUTODIR)
X	@ $(TOUCH) $(INST_ARCHAUTODIR)/.exists
X
$(INST_EXE)/.exists :: $(PERL)
X	@ $(MKPATH) $(INST_EXE)
X	@ $(TOUCH) $(INST_EXE)/.exists
X
help:
X	$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::MakeMaker "&help"; &help;'
X
Version_check:
X	@$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::MakeMaker qw($$Version &Version_check);' \
X		-e '&Version_check($(MM_VERSION))'
X
X
# --- MakeMaker linkext section:
X
linkext :: $(LINKTYPE)
X
X
X
# --- MakeMaker dlsyms section:
X
X
# --- MakeMaker dynamic section:
X
# $(INST_PM) has been moved to the all: target.
# It remains here for awhile to allow for old usage: "make dynamic"
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
X
X
X
# --- MakeMaker dynamic_bs section:
X
BOOTSTRAP = Const.bs
X
# As Mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
$(BOOTSTRAP): Makefile 
X	@ echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
X	@ $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
X		-e 'use ExtUtils::Mkbootstrap;' \
X		-e 'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");'
X	@ $(TOUCH) $(BOOTSTRAP)
X	$(CHMOD) 644 $@
X	@echo $@ >> $(INST_ARCHAUTODIR)/.packlist
X
$(INST_BOOT): $(BOOTSTRAP)
X	@ rm -rf $(INST_BOOT)
X	-cp $(BOOTSTRAP) $(INST_BOOT)
X	$(CHMOD) 644 $@
X	@echo $@ >> $(INST_ARCHAUTODIR)/.packlist
X
X
# --- MakeMaker dynamic_lib section:
X
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS = 
X
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
X	LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS)
X	$(CHMOD) 755 $@
X	@echo $@ >> $(INST_ARCHAUTODIR)/.packlist
X
X
# --- MakeMaker static section:
X
# $(INST_PM) has been moved to the all: target.
# It remains here for awhile to allow for old usage: "make static"
static :: Makefile $(INST_STATIC) $(INST_PM)
X
X
X
# --- MakeMaker static_lib section:
X
$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
X	ar cr $@ $(OBJECT) && $(RANLIB) $@
X	@echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
X	$(CHMOD) 755 $@
X	@echo $@ >> $(INST_ARCHAUTODIR)/.packlist
X
X
# --- MakeMaker installpm section:
X
# installpm: Const.pm => $(INST_LIBDIR)/Const.pm, splitlib=$(INST_LIB)
X
$(INST_LIBDIR)/Const.pm: Const.pm Makefile $(INST_LIBDIR)/.exists
X	@ rm -f $@
X	cp Const.pm $@
X	$(CHMOD) 644 $@
X	@echo $@ >> $(INST_ARCHAUTODIR)/.packlist
X	@$(AUTOSPLITFILE) $@ $(INST_LIB)/auto
X
X
X
# --- MakeMaker processPL section:
X
X
# --- MakeMaker installbin section:
X
X
# --- MakeMaker subdirs section:
X
# none
X
# --- MakeMaker clean section:
X
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
X
clean ::
X	-rm -rf *~ t/*~ *.o *.a mon.out core so_locations $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).exp ./blib
X	-mv Makefile Makefile.old 2>/dev/null
X
X
# --- MakeMaker realclean section:
X
# Delete temporary files (via clean) and also delete installed files
realclean purge ::  clean
X	rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
X	rm -f $(INST_DYNAMIC) $(INST_BOOT)
X	rm -f $(INST_STATIC) $(INST_PM)
X	rm -rf Makefile Makefile.old
X
X
# --- MakeMaker dist section:
X
TAR  = tar
TARFLAGS = cvf
COMPRESS = compress
SUFFIX = Z
SHAR = shar
PREOP = @ :
POSTOP = @ :
CI = ci -u
RCS = rcs -Nv$(VERSION_SYM):
DIST_DEFAULT = tardist
X
distclean :: realclean distcheck
X
distcheck :
X	$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \
X		-e 'fullcheck();'
X
manifest :
X	$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \
X		-e 'mkmanifest();'
X
dist : $(DIST_DEFAULT)
X
tardist : $(DISTNAME)-$(VERSION).tar.$(SUFFIX)
X
$(DISTNAME)-$(VERSION).tar.$(SUFFIX) : distdir
X	$(PREOP)
X	$(TAR) $(TARFLAGS) $(DISTNAME)-$(VERSION).tar $(DISTNAME)-$(VERSION)
X	$(COMPRESS) $(DISTNAME)-$(VERSION).tar
X	$(RM_RF) $(DISTNAME)-$(VERSION)
X	$(POSTOP)
X
uutardist : $(DISTNAME)-$(VERSION).tar.$(SUFFIX)
X	uuencode $(DISTNAME)-$(VERSION).tar.$(SUFFIX) \
X		$(DISTNAME)-$(VERSION).tar.$(SUFFIX) > \
X		$(DISTNAME)-$(VERSION).tar.$(SUFFIX).uu
X
shdist : distdir
X	$(PREOP)
X	$(SHAR) $(DISTNAME)-$(VERSION) > $(DISTNAME)-$(VERSION).shar
X	$(RM_RF) $(DISTNAME)-$(VERSION)
X	$(POSTOP)
X
distdir :
X	$(RM_RF) $(DISTNAME)-$(VERSION)
X	$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "/mani/";' \
X		-e 'manicopy(maniread(),"$(DISTNAME)-$(VERSION)");'
X
X
ci :
X	$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \
X		-e '@all = keys %{maniread()};' \
X		-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \
X		-e 'print("Executing $(RCS) ...\n"); system("$(RCS) @all");'
X
X
X
# --- MakeMaker install section:
X
doc_install ::
X	@ echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
X	@ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB)  \
X		-e "use ExtUtils::MakeMaker; MM->writedoc('Module', '$(NAME)', \
X		'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', \
X		'EXE_FILES=$(EXE_FILES)')" >> $(INSTALLARCHLIB)/perllocal.pod
X
install :: pure_install doc_install
X
pure_install ::
X	@$(PERL) -e 'foreach (@ARGV){die qq{You do not have permissions to install into $$_\n} unless -w $$_}' $(INSTALLPRIVLIB) $(INSTALLARCHLIB)
X	: perl5.000 and MM pre 3.8 autosplit into INST_ARCHLIB, we delete these old files here
X	rm -f $(INSTALLARCHLIB)/auto/$(FULLEXT)/*.al
X	rm -f $(INSTALLARCHLIB)/auto/$(FULLEXT)/*.ix
X	$(MAKE) INST_LIB=$(INSTALLPRIVLIB) INST_ARCHLIB=$(INSTALLARCHLIB) INST_EXE=$(INSTALLBIN)
X	@$(PERL) -i.bak -lne 'print unless $$seen{$$_}++' $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist
X
#### UNINSTALL IS STILL EXPERIMENTAL ####
uninstall ::
X	$(RM_RF) `cat $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist`
X
X
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
X
X
# --- MakeMaker perldepend section:
X
PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
X    $(PERL_INC)/XSUB.h	$(PERL_INC)/av.h	$(PERL_INC)/cop.h \
X    $(PERL_INC)/cv.h	$(PERL_INC)/dosish.h	$(PERL_INC)/embed.h \
X    $(PERL_INC)/form.h	$(PERL_INC)/gv.h	$(PERL_INC)/handy.h \
X    $(PERL_INC)/hv.h	$(PERL_INC)/keywords.h	$(PERL_INC)/mg.h \
X    $(PERL_INC)/op.h	$(PERL_INC)/opcode.h	$(PERL_INC)/patchlevel.h \
X    $(PERL_INC)/perl.h	$(PERL_INC)/perly.h	$(PERL_INC)/pp.h \
X    $(PERL_INC)/proto.h	$(PERL_INC)/regcomp.h	$(PERL_INC)/regexp.h \
X    $(PERL_INC)/scope.h	$(PERL_INC)/sv.h	$(PERL_INC)/unixish.h \
X    $(PERL_INC)/util.h	$(PERL_INC)/config.h
X
X
X
$(OBJECT) : $(PERL_HDRS)
X
X
# --- MakeMaker makefile section:
X
$(OBJECT) : Makefile
X
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
Makefile :	Makefile.PL $(CONFIGDEP)
X	@echo "Makefile out-of-date with respect to $?"
X	@echo "Cleaning current config before rebuilding Makefile..."
X	-@mv Makefile Makefile.old
X	-$(MAKE) -f Makefile.old clean >/dev/null 2>&1 || true
X	$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL 
X	@echo "Now you must rerun make."; false
X
X
# --- MakeMaker staticmake section:
X
# --- MakeMaker makeaperl section ---
MAP_TARGET    = perl
FULLPERL      = /usr/local/bin/perl
MAP_LINKCMD   = $(CC) 
MAP_PERLINC   = -I./blib -I./blib -I/usr/local/lib/perl5/sun4-sunos -I/usr/local/lib/perl5
MAP_STATIC    = ./blib/auto/Const/Const.a /usr/local/lib/perl5/sun4-sunos/auto/DynaLoader/DynaLoader.a
MAP_PRELIBS   = -ldbm -ldl -lm -lc -lposix 
X
MAP_LIBPERL = /usr/local/lib/perl5/sun4-sunos/CORE/libperl.a
X
extralibs.ld: ./blib/auto/Const/extralibs.ld /usr/local/lib/perl5/sun4-sunos/auto/DynaLoader/extralibs.ld
X	@ rm -f $@
X	@ $(TOUCH) $@
X	cat ./blib/auto/Const/extralibs.ld >> $@
X	cat /usr/local/lib/perl5/sun4-sunos/auto/DynaLoader/extralibs.ld >> $@
X
$(MAP_TARGET): ./perlmain.o $(MAP_LIBPERL) $(MAP_STATIC) extralibs.ld
X	$(MAP_LINKCMD) -o $@ ./perlmain.o $(MAP_LIBPERL) $(MAP_STATIC) `cat extralibs.ld` $(MAP_PRELIBS)
X	@ echo 'To install the new "$(MAP_TARGET)" binary, call'
X	@ echo '    make -f Makefile inst_perl MAP_TARGET=$(MAP_TARGET)'
X	@ echo 'To remove the intermediate files say'
X	@ echo '    make -f Makefile map_clean'
X
X./perlmain.o: ./perlmain.c
X	cd . && $(CC) -I/usr/local/lib/perl5/sun4-sunos/CORE -c -O perlmain.c
X
X./perlmain.c: Makefile
X	@ echo Writing $@
X	@ $(FULLPERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \
X		writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@
X
X
doc_inst_perl:
X	@ echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
X	@ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary",' \
X		-e '"$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)",' \
X		-e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' \
X		-- `cat extralibs.ld` >> $(INSTALLARCHLIB)/perllocal.pod
X
inst_perl: pure_inst_perl doc_inst_perl
X
pure_inst_perl: $(MAP_TARGET)
X	cp $(MAP_TARGET) $(INSTALLBIN)/$(MAP_TARGET)
X
clean :: map_clean
X
map_clean :
X	rm -f ./perlmain.o ./perlmain.c $(MAP_TARGET) extralibs.ld
X
X
# --- MakeMaker test section:
X
TEST_VERBOSE=0
TEST_TYPE=test_dynamic
X
test :: $(TEST_TYPE)
X	@echo 'No tests defined for $(NAME) extension.'
X
test_dynamic :: all
X
test_static :: all $(MAP_TARGET)
X
X
X
# --- MakeMaker postamble section:
X
X
# End.
SHAR_EOF
  $shar_touch -am 0627161495 'Const/Makefile.old' &&
  chmod 0644 'Const/Makefile.old' ||
  $echo 'restore of' 'Const/Makefile.old' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/Makefile.old:' 'MD5 check failed'
c17b3ad9cc61ddf2d2c7c0373190939c  Const/Makefile.old
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/Makefile.old'`"
    test 15557 -eq "$shar_count" ||
    $echo 'Const/Makefile.old:' 'original size' '15557,' 'current size' "$shar_count!"
  fi
fi
# ============= Const/test.pl ==============
if test -f 'Const/test.pl' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/test.pl' '(file already exists)'
else
  $echo 'x -' extracting 'Const/test.pl' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/test.pl' &&
#!../../perl
X
use Const;
X
const local($a) = 3;
X
print "\$a = $a\n";
print "Trying to modify \$a...\n";
X
$a = 4;
SHAR_EOF
  $shar_touch -am 0627161395 'Const/test.pl' &&
  chmod 0755 'Const/test.pl' ||
  $echo 'restore of' 'Const/test.pl' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/test.pl:' 'MD5 check failed'
047e33370467ea108b6ae2bffe04ff9d  Const/test.pl
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/test.pl'`"
    test 112 -eq "$shar_count" ||
    $echo 'Const/test.pl:' 'original size' '112,' 'current size' "$shar_count!"
  fi
fi
# ============= Const/test2.pl ==============
if test -f 'Const/test2.pl' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Const/test2.pl' '(file already exists)'
else
  $echo 'x -' extracting 'Const/test2.pl' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Const/test2.pl' &&
use Const;
@array = (1..10);
#const $array[3] = 200;
const $array[3];
X
%hash = (
X    "eenie"	=> 1,
X    "meanie"	=> 13,
X    "minie"	=> "and a string",
X    "moe"	=> "done",
);
X
const $hash{sacred} = "touch me not";
X
eval { 
X    print "Trying to modify array...\n";
X
X    for $i ( 0..$#array ) {
X	print "Trying to modify \$array[$i]...\n";
X	$array[$i] += 7;
X    } 
X
X    print "array is now @array\n";
};
if ($@) { warn "exception during array: $@\n"; } 
X
eval { 
X    print "Trying to modify hash...\n";
X
X    for $i ( keys %hash ) {
X	print "Trying to modify \$hash{$i}...\n";
X	$hash{$i} .= " new stuff";
X    } 
X
X    print "hash is now ", join (" => ", %hash), "\n";
};
if ($@) { warn "exception during hash: $@\n"; } 
SHAR_EOF
  $shar_touch -am 0627162595 'Const/test2.pl' &&
  chmod 0644 'Const/test2.pl' ||
  $echo 'restore of' 'Const/test2.pl' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Const/test2.pl:' 'MD5 check failed'
250547437bb31959a69ae87cb06b24d8  Const/test2.pl
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Const/test2.pl'`"
    test 713 -eq "$shar_count" ||
    $echo 'Const/test2.pl:' 'original size' '713,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh21994
exit 0
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    When in doubt, parenthesize.  At the very least it will let some
    poor schmuck bounce on the % key in vi.
            --Larry Wall in the perl man page 


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

Date: Wed, 12 Mar 1997 00:46:38 -0600
From: Rajesh Gottlieb <rajeshg@ccwf.cc.utexas.edu>
Subject: help: embedding perl in visual C++ code
Message-Id: <Pine.GSO.3.96.970312004200.27980E-100000@piglet.cc.utexas.edu>

I have the ActiveWare port of perl for Win32 5.001m and I'm trying to
figure out how I can embed perl into some C/C++ programs to be compiled on
visual C++ 4.0. Has anyone had any experience doing this? What do I need
to do to get it to work? Any example code and make file would be greatly
appreciated.  Please help.

thanks
Rajesh Gottlieb
rajesh@mail.utexas.edu



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

Date: Wed, 12 Mar 1997 00:33:21 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Interpreting this reg expression has me baffled
Message-Id: <33264E31.10FE6F56@gpu.srv.ualberta.ca>

please don't do that.


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

Date: Wed, 12 Mar 1997 00:46:19 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: ISBN/Checkdigit calculator
Message-Id: <comdog-1203970046190001@nntp.netcruiser>

In article <3325FD5B.7546@sybex.com>, mriggsby@sybex.com wrote:

> I need a perl script that will calculate the final digit of an ISBN and
> would prefer not to reinvent the wheel if at all possible.  For those of
> you unfamiliar with the process, a book's ISBN is an eleven digit
> number, the first ten of which identify the publisher and sequence in
> publishing.  A check-digit is calculated by calculating a sum with the
> first ten digits (10 * the first digit + 9 * the second and so on), then
> dividing the sum by 11 and taking the remainder (the digit is "X" if the
> remainder is 10).  Has anyone written a perl routine for this?  I
> browsed through CPAN, but nothing definitively relevant popped up at
> me.


#!/usr/bin/perl -w

use strict;
use subs qw(check_isbn);

my $result = check_isbn('1-56592-149-6');

print "check digit = $result\n";

sub check_isbn
   {
   my($isbn)    = shift;
   my($sum)     = 0;

   $isbn        =~ s/[^\d]//g;
   
   my @digits   = split //, $isbn;
   
   my $checksum = pop @digits if $#digits == 10;
      
   foreach( reverse 2..10 )
      {
      my($digit) = shift @digits;
      
      $sum += $digit * $_;
      }
   
   #return what the check digit should be
   return 11 - ($sum % 11);
   }
   
__END__

perhaps you wanted something more complex?

-- 
brian d foy                              <URL:http://computerdog.com>                       
unsolicited commercial email is not appreciated


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

Date: 12 Mar 1997 05:33:28 GMT
From: netog@cinteractive.com (Ernesto Gianola)
Subject: multi-line mode and m//m
Message-Id: <5g5f78$r9f$1@gail.ripco.com>

	I am parsing data that looks like this

	### data set ###
Thur 3/6
U Neptune, Roger Miller, Willie Alexander's Persistence of Memory
Orchestra, 50 Bucks 18+ $7
D Lunachicks, Green Magnet School, Theta Bara (formerly Sugarbitch)     18+ $8
C       Crash

Fri 3/7
U Mappari, Cosmic Strut, Dread Naught 18+ $7
D Blur, Papas Fritas, Assembly Line People Program 18+ $15
C       Ross Robinson

Sat 3/8
U Gamelan Presents: Blind Man's Sun, Soupbaby, Silas Shepard Trio  18+ $7
D Gamelan Presents: Ape, Canine (formerly Canine Guru), Poor Jim, The
Grasshoppers 18+ $7
C       House of Gusto

Mon 3/10
U Bis (fr Scotland Grand Royal Records), Cords (Emperor Norton Rec), 33
Slade 18+ $6
C Chandler Travis Philharmonic

Tues 3/11
U Broken Toys, Sqwags, Project Unconfined, Romeo Vegas 18+ $6
D Doors at 8pm: Dave Thomas (of Pere Ubu) and Two Pale Boys,
        Little John  18+ $8adv/$10 dos
C  Gonzalo Silva
	#####

I decided to loop through in multi-line mode.
"Ah, I think. I can use ^ and /m !!!"

	# sample script #

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

$/ = "\n\n";                   

while(<>) {
    # if we match a date
    if(($day, $date) = $_ =~ m!^(\w+)\s(\d+/\d+)!) {
        while(m/^(\w)\s+(.*)/gm) {
            $room = $1;
            $bands = $2;
            print "$day $date/97 $room - $bands\n";
        }
    }
}

	#####

Now I can parse through fine if all entries existed in a single logical line.
In other words, the $bands variable misses text sometimes. I can't use
m//gms in my second while loop without .* swallowing too much text.

Am I forced to parse this line by line instead or can my approach be "fixed"?

regards,

Ernesto


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

Date: Wed, 12 Mar 1997 00:38:58 -0600
From: Rajesh Gottlieb <rajeshg@ccwf.cc.utexas.edu>
To: "Christopher M. Surber" <surber@earthlink.net>
Subject: Re: need some help here
Message-Id: <Pine.GSO.3.96.970312003454.27980D-100000@piglet.cc.utexas.edu>


Your problem is in the way you split.  Try using split(/\s+/) to split on
one or more whitespace. See pg 96,97 of "Learning Perl"

Raj




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

Date: Tue, 11 Mar 1997 02:29:51 GMT
From: Triantafyllos Marakis <ceetm@cee.hw.ac.uk>
Subject: Problem with grep function
Message-Id: <Pine.SUN.3.95.970311022759.3470A-100000@loki>

I am trying to construct a function that will count the
number of occurances of a string to a file.

So far I've written the following code:

open(IN_FILE, $in_file) or
  die "Program Fault; File cannot be found:$in_file\n";
while ($line = <IN_FILE>)
{
  $line = lc($line);

  @list = split(/ /, $line);
  $strings_per_line = grep(/$string/, @list); #count the occurance
                                              #of the string
  $counter += $strings_per_line;
}
close(IN_FILE);

But if a string is contained more than once in a word
(e.g. ......hello......hello... it increases the counter
by one)

How is it possible to change the code above to achieve that?


TRIANTAFYLLOS MARAKIS     |Email:ceetm@cee.hw.ac.uk
BSc in Computer Science IV|Web  :http://www.cee.hw.ac.uk/~ceetm
HERIOT-WATT University    |George Burnett Hall(2.54), Heriot-Watt Univ.,
Edinburgh, Scotland       |Edinburgh,EH14 4AS, Scotland UK





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

Date: 12 Mar 1997 06:46:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Scope?
Message-Id: <5g5jfg$7qi$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Tom Phoenix <rootbeer@teleport.com> writes:
:On Tue, 11 Mar 1997, Jonathan C. Willeke wrote:
:
:> According to the Camel book and the man pages, lexically scoped
:> variables declared with my are not visible to to routines called in
:> the current block.  
:
:If they say that, they're mistaken. :-)  Lexically scoped variables are
:only visible within their own scope, and scopes contained lexically within
:their scope. Their scope extends from where they are created ('my $foo')
:until the end of their enclosing block or file.

He's misread the explanation.  It just says that subroutines
called from that scope can't see them, whereas with local()s
they can.  But if the declaration itself is within the same
scope, then of course it's visible.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

Fifty years of programming language research, and we end up with C++ ???
                                    --Richard A. O'Keefe


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

Date: 11 Mar 1997 23:12:18 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Scripts to parse common server logs
Message-Id: <5g5hg2$c5f@nova.dimensional.com>

 [cc to author]
Ross Carlson <webmaster@gmom.com> writes:

>I am looking for premade scripts that can be used to parse web server
>logs in the common log format. I browsed CPAN, but only found the libwww
>modules which don't seem to be what I need.

Check out analog:

    http://www.statslab.cam.ac.uk/~sret1/analog/

>I also am looking for date conversion routines that might be able to
>take the dates from the common log format, and convert them into the
>integer format that is returned from time().

With a little fiddling you can do this with Date::Manip.
-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: 12 Mar 1997 06:39:38 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: TCP Server from manpage fails
Message-Id: <5g5j3a$7qi$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    kester@unix-ag.uni-kl.de (Kester Habermann) writes:
:A simple fix is:

No, that won't work on systems that interrupt your system calls.
You have to say 

    next if $waitedpid && !$paddr;

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


A woman needs a little more weird today than normal.  --Andrew Hume


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

Date: 12 Mar 1997 05:44:48 GMT
From: rohanl@ (Rohan Lloyd)
Subject: Re: What's a good Perl book?
Message-Id: <5g5fsg$773@hamlet.ot.com.au>

In article <5g4hvc$1lr@chaos.dac.neu.edu>,
David Tong <dtong@lynx.dac.neu.edu> wrote:

>I know C and KSH very well but I am new to Perl. I need to implement on NT,
>UNIX and QNX with Perl. What would be a good Perl reference book I can get
>in the book store?

I'd go with the O'Reilly 'Camel' Book. I think it's just called "Perl"
and has a picture of a camel on the front. Make sure you get the new
edition that covers Perl 5.

Rohan Lloyd
rohanl@ot.com.au


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

Date: Tue, 11 Mar 1997 22:21:14 -0500
From: John Johnson <NOSPAMjohntj@bellsouth.net>
Subject: Re: What's a good Perl book?
Message-Id: <3326212A.5D26@bellsouth.net>

Look for the O'Reily "Camel Book" or the "LLama Book", both are
detailed on their website, sorry, don't have the URL handy.


David Tong wrote:
> 
> Hi,
> 
> I know C and KSH very well but I am new to Perl. I need to implement on NT,
> UNIX and QNX with Perl. What would be a good Perl reference book I can get
> in the book store?
> 
>         Thank You
>         David Tong


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

Date: Wed, 12 Mar 1997 02:45:48 GMT
From: Marc Langheinrich <marclang@saxifrage.cs.washington.edu>
Subject: what's the advantage of a shared libperl.so??
Message-Id: <qyjn2s9eskj.fsf@saxifrage.cs.washington.edu>


In article <5fldub$b5f$1@csnews.cs.colorado.edu>, 
	Tom Christiansen <tchrist@mox.perl.com> wrote:
> You'll probably be astonished to learn that the current version of the
> compiler generates a compiled form of your script whose executable is
> just as big as the original perl executable, and then some.
> ... You can tremendously reduce this cost by building a
> shared libperl.so library and linking against that.  See the
> F<INSTALL> podfile in the perl source distribution for details.  If
> you link your main perl binary with this, it will make it miniscule.
> For example, on my system, /usr/bin/perl is only 11k in size!

What exactly does that buy me? Less storage space on disk? (obviously
not) Faster compilation? (didn't Tom mention someplace else that this 
would actually take longer?) Less Memory consumption when executing a
script?

I hoped for the latter one, but it seems it makes no difference
whether I compile Perl w/ or w/o shared libperl.so -- either way, my
script uses the same amount of memory while running. So why would I
want to do this -- only to enjoy an 11k small binary?!

the doubtful
---
Marc Langheinrich                  Department of Computer Science & Engr.
office phone: (206) 543-5129       University of Washington, Box 352350, 
email: marclang@cs.washington.edu  Seattle, WA 98195-2350, USA
www: http://www.cs.washington.edu/homes/marclang/


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

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

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