[16143] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3555 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 15:42:40 2000

Date: Mon, 10 Jul 2000 12:42:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963258145-v9-i3555@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3555

Today's topics:
        comparing two arrays for similarities <djspillers@midsouth.ualr.edu>
    Re: comparing two arrays for similarities (Michel Dalle)
    Re: comparing two arrays for similarities (Craig Berry)
        Comparing two strings (golf, anyone?) <mdz4c@node8.unix.Virginia.EDU>
    Re: Comparing two strings (golf, anyone?) (Randal L. Schwartz)
    Re: Comparing two strings (golf, anyone?) <lauren_smith13@hotmail.com>
        Compiling perl 5.6 on AIX 4.33 <fortinj@attglobal.net>
        RE: Compiling perl 5.6 on AIX 4.33 (H. Merijn Brand)
    Re: Compiling perl 5.6 on AIX 4.33 <fortinj@attglobal.net>
        RE: Compiling perl 5.6 on AIX 4.33 (H. Merijn Brand)
    Re: Compiling perl 5.6 on AIX 4.33 <jbroz@transarc.com>
        Compiling PERL 5.6 on AIX static9@my-deja.com
    Re: Compiling PERL 5.6 on AIX <jbroz@yperite.demon.co.uk>
        Compiling Perl on Unix <lachlan.thomas@connect.com.au>
    Re: Compiling Perl on Unix <bwalton@rochester.rr.com>
        Constructing multi-level hashes <prakash@gate.net>
    Re: Constructing multi-level hashes (Randal L. Schwartz)
    Re: Constructing multi-level hashes (Tad McClellan)
        Convert Email with BASE64 encoded Attachments <thermann@mtgnet.de>
    Re: Convert Email with BASE64 encoded Attachments <Peter.Dintelmann@dresdner-bank.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 06 Jul 2000 12:11:34 -0500
From: daniel spillers <djspillers@midsouth.ualr.edu>
Subject: comparing two arrays for similarities
Message-Id: <3964BDC5.A8E303B@midsouth.ualr.edu>

This is a multi-part message in MIME format.
--------------14C801AE2E4A04C5F5AB2B41
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Hi all, thank you for any help you can give me with what I think is an
elementary question.

This question is regarding a CGI script, but it is a question about how
to perform a function in the perl language not specific to CGI or web
forms.

I have a CGI script which is a multi-page form ... the page is
re-accessed each time the user submits the previously filled-out form
and presents the next page in the series of forms. I am trying to store
and keep track of the information filled out on entire series of pages
in one file. I am tracking the field names (and thereby their contents)
with two arrays, @foo and @bar.

@foo eventually is a large list of names (it grows as a user fills out a
multi-page form, taking it's list from those fields already filled out).
@bar is a relatively small list that changes each time the user submits
the next page of the form (it is the list of fields that were JUST
filled out).

I need to compare @bar (the "newly submitted" fields) to @foo (the "old"
fields) to result in a list of only those fields which are in @foo but
at the same time NOT in @bar. In other words, most of the time the
resulting list is just going to be the same as @foo, meaning @bar is an
entirely "new" list (fields that have never been filled out before).
However, if the user goes back and changes a field he/she previously
filled out, that means that an item or items in @bar will also be in
@foo, and so need to be taken out of the resulting list so that "new"
data won't be overwritten with the "old" data. (I use the resulting list
to pull the old data into memory and then save the whole shebang to
file)

I can't for the life of me figure out how to do this although it sounds
like something I've done before. If I need to clarify something, please
ask, because I know that I've probably made this more complicated than
it needs to be.

Thank you again for any help. Please feel free to respond to my e-mail
address in addition to the group. If I need to post this to another
group, please inform me.

Daniel Spillers



--------------14C801AE2E4A04C5F5AB2B41
Content-Type: text/x-vcard; charset=us-ascii;
 name="djspillers.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for daniel spillers
Content-Disposition: attachment;
 filename="djspillers.vcf"

begin:vcard 
n:spillers;daniel
tel;pager:(800) 825-7243 x 54065
tel;fax:(501) 569-8269
tel;work:(501) 569-8777
x-mozilla-html:TRUE
url:http://www.midsouth.ualr.edu/
org:UALR MidSOUTH;Information Technology Division
version:2.1
email;internet:djspillers@midsouth.ualr.edu
title:Intranet Development Specialist
adr;quoted-printable:;;2801 S University Avenue=0D=0APhysical Plant Room 103;Little Rock;AR;72204-1099;USA
x-mozilla-cpt:;3
fn:daniel spillers
end:vcard

--------------14C801AE2E4A04C5F5AB2B41--



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

Date: Thu, 06 Jul 2000 17:37:49 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: comparing two arrays for similarities
Message-Id: <8k2gb0$bh5$1@news.mch.sbs.de>

In article <3964BDC5.A8E303B@midsouth.ualr.edu>, daniel spillers <djspillers@midsouth.ualr.edu> wrote:
>This is a multi-part message in MIME format.
No thanks.
[snip]
>@foo eventually is a large list of names (it grows as a user fills out a
>multi-page form, taking it's list from those fields already filled out).
>@bar is a relatively small list that changes each time the user submits
>the next page of the form (it is the list of fields that were JUST
>filled out).
[snip]

It seems to me you're using the wrong data structure here.

What if you load the "old" fields and their values into a hash
first, and then update the hash with the "new" fields/values ?
You can then simply save the hash at the end, and continue
like that for each form. People can go back and resubmit as
much as they want - you'll always have the latest value they
submitted for each field.

You'll probably want to check out the documentation of CGI.pm
as well, especially the parts about "Creating a new query object
from an input file" and "Saving the state of the script to a file".

Just a thought,

Michel.


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

Date: Thu, 06 Jul 2000 19:30:29 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: comparing two arrays for similarities
Message-Id: <sm9nil3mgas67@corp.supernews.com>

daniel spillers (djspillers@midsouth.ualr.edu) wrote:
: This is a multi-part message in MIME format.
: --------------14C801AE2E4A04C5F5AB2B41
: Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
: Content-Transfer-Encoding: 7bit

Please don't do that on Usenet.

: I have a CGI script which is a multi-page form ... the page is
: re-accessed each time the user submits the previously filled-out form
: and presents the next page in the series of forms. I am trying to store
: and keep track of the information filled out on entire series of pages
: in one file. I am tracking the field names (and thereby their contents)
: with two arrays, @foo and @bar.
: 
: @foo eventually is a large list of names (it grows as a user fills out a
: multi-page form, taking it's list from those fields already filled out).
: @bar is a relatively small list that changes each time the user submits
: the next page of the form (it is the list of fields that were JUST
: filled out).
: 
: I need to compare @bar (the "newly submitted" fields) to @foo (the "old"
: fields) to result in a list of only those fields which are in @foo but
: at the same time NOT in @bar.

If maintaining list order is not important (or if you can regenerate the
order using a subsequent sort), hash slices are the simplest trick:

  @foo_h{@foo} = @foo;
  delete @foo_h{@bar};
  @foo_not_bar = keys %foo_h;

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Mon, 10 Jul 2000 12:28:57 -0400
From: Matthew Zimmerman <mdz4c@node8.unix.Virginia.EDU>
Subject: Comparing two strings (golf, anyone?)
Message-Id: <Pine.A41.4.05.10007101208510.17376-100000@node8.unix.Virginia.EDU>

So I was recently reading Richard Dawkins' "Blind Watchmaker", and in that
book, he describes using a computer program to demostrate the
process of natural selection, by taking a random string and allowing it
to 'drift' into a quote from Shakespeare. 

I decided to implement this program in Perl, but quickly ran across a
curious (to me, anyway) problem. Consider the following code:

----
#!/usr/bin/perl -w
use strict; 

my $TARGET = 'methinks it is like a weasel';
my $close  = 'methinkg ie is lisdfaaweasld';
my $far    = 'ladkjfalsj lksdjf alkjlwkejl'; 

print compare($TARGET, $close), "\n";
print compare($TARGET, $far)  , "\n";

sub compare {
    my ($a, $b) = @_;
    my @a = split //, $a;
    my @b = split //, $b;
    my $count;
    for( my $i = 0 ; $i < @a ; $i++ ) {
        $count++ if $a[$i] eq $b[$i];
    }
    $count;
}
----

The program uses the compare() sub to determine the best descendant string
in a generation. If the two strings it is given are identical, it returns
the length of the string. If they don't have the same character in ANY
position, it returns 0. So, two questions immediately spring to mind:

(1) Is this the most efficient way to do this? If I carry out this
comparasion many, many times, will the 'split's slow me down? Is there
some neat trick with pack(), unpack(), substr(), or index() that I'm
missing?

(2) Less important, but certainly more fun, is this the shortest way to do
it? Golf, anyone? My best shot is:

sub compare{@b=$_[1]=~/(.)/g;for($_[0]=~/(.)/g){$c++ if $_ eq $b[$i++]};$c}

Surely y'all can beat that.


Thanks!
Matt

-- 
|Matthew Zimmerman            http://www.people.virginia.edu/~mdz4c  |
|Interdisciplinary Biophysics Program |"I AM serious.                |
|University of Virginia               | And stop calling me Shirley."|



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

Date: 10 Jul 2000 09:55:46 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Comparing two strings (golf, anyone?)
Message-Id: <m1og4553hp.fsf@halfdome.holdit.com>

>>>>> "Matthew" == Matthew Zimmerman <mdz4c@node8.unix.Virginia.EDU> writes:

Matthew> sub compare{@b=$_[1]=~/(.)/g;for($_[0]=~/(.)/g){$c++ if $_ eq $b[$i++]};$c}

Matthew> Surely y'all can beat that.

This was a paper at YAPC!

I think the answer you want is something along these lines:

    sub compare {
      ("$_[0]" ^ "$_[1]") =~ /^(\0*)/;
      length $1;
    }

Stringification necessary in case these have been used in numeric
context.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Mon, 10 Jul 2000 10:25:48 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Comparing two strings (golf, anyone?)
Message-Id: <8kd100$kgv$1@brokaw.wa.com>


Randal L. Schwartz <merlyn@stonehenge.com> wrote in message
news:m1og4553hp.fsf@halfdome.holdit.com...
> >>>>> "Matthew" == Matthew Zimmerman <mdz4c@node8.unix.Virginia.EDU>
writes:
>
> Matthew> sub compare{@b=$_[1]=~/(.)/g;for($_[0]=~/(.)/g){$c++ if $_ eq
$b[$i++]};$c}
>
> Matthew> Surely y'all can beat that.
>
> This was a paper at YAPC!
>
>     sub compare {
>       ("$_[0]" ^ "$_[1]") =~ /^(\0*)/;
>       length $1;
>     }

But can it be done *in constant time*?  Ho ho.  :-)

Lauren
--
Too much Superpositioning for me this weekend, that's for sure...




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

Date: Thu, 06 Jul 2000 11:04:04 -0400
From: John Fortin <fortinj@attglobal.net>
Subject: Compiling perl 5.6 on AIX 4.33
Message-Id: <39649FE4.4CD9669B@attglobal.net>

Has anyone had success compiling perl 5.6 on aix 4.3.3.  I've tried it
and get several warnings of this type:

    # 1506-173 (W) Option lm is not valid.  Enter xlc for list of valid
options.

As far as I can tell, there is no 'lm' option passed anywhere.  There
are '-lm' flags to link in libm.a.

This seems to cause a problem with makedepend.  After the 'make', when I
do a 'make test' everything recompiles.  Same with 'make install'.

Any ideas??

John Fortin



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

Date: Thu, 6 Jul 00 20:23:54 +0200
From: h.m.brand@hccnet.nl (H. Merijn Brand)
Subject: RE: Compiling perl 5.6 on AIX 4.33
Message-Id: <8F69CB1FCMerijn@192.0.1.90>

fortinj@attglobal.net (John Fortin) wrote in 
<39649FE4.4CD9669B@attglobal.net>:

>Has anyone had success compiling perl 5.6 on aix 4.3.3.  I've tried it
>and get several warnings of this type:
>
>    # 1506-173 (W) Option lm is not valid.  Enter xlc for list of valid
>options.
>
>As far as I can tell, there is no 'lm' option passed anywhere.  There
>are '-lm' flags to link in libm.a.
>
>This seems to cause a problem with makedepend.  After the 'make', when I
>do a 'make test' everything recompiles.  Same with 'make install'.
>
>Any ideas??
>
>John Fortin

Did you upgrade to the latest vac version?
If you did, I'd be glad to pass on my config.sh

# lslpp -L | grep -i vac
  vac.C                      4.4.0.3    C    C for AIX Compiler
  vac.C.readme.ibm           4.4.0.1    C    C for AIX iFOR/LS Information
  vac.html.SBCS.search       4.4.0.0    C    C for AIX Compiler 
Documentation
  vac.html.common.search     4.4.0.0    C    C for AIX Compiler 
Documentation
  vac.html.en_US.C           4.4.0.0    C    C for AIX Compiler 
Documentation
  vac.html.en_US.search      4.4.0.0    C    C for AIX Compiler 
Documentation
  vac.msg.en_US.C            4.4.0.0    C    C for AIX Compiler Messages -
#


-- 
H.Merijn Brand
using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
  DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)


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

Date: Thu, 06 Jul 2000 15:23:05 -0400
From: John Fortin <fortinj@attglobal.net>
Subject: Re: Compiling perl 5.6 on AIX 4.33
Message-Id: <3964DC99.49D9294A@attglobal.net>

"H. Merijn Brand" wrote:

> fortinj@attglobal.net (John Fortin) wrote in
> <39649FE4.4CD9669B@attglobal.net>:
>
> >Has anyone had success compiling perl 5.6 on aix 4.3.3.  I've tried it
> >and get several warnings of this type:
> >
> >    # 1506-173 (W) Option lm is not valid.  Enter xlc for list of valid
> >options.
> >
> >As far as I can tell, there is no 'lm' option passed anywhere.  There
> >are '-lm' flags to link in libm.a.
> >
> >This seems to cause a problem with makedepend.  After the 'make', when I
> >do a 'make test' everything recompiles.  Same with 'make install'.
> >
> >Any ideas??
> >
> >John Fortin
>
> Did you upgrade to the latest vac version?
> If you did, I'd be glad to pass on my config.sh
>
> # lslpp -L | grep -i vac
>   vac.C                      4.4.0.3    C    C for AIX Compiler
>   vac.C.readme.ibm           4.4.0.1    C    C for AIX iFOR/LS Information
>   vac.html.SBCS.search       4.4.0.0    C    C for AIX Compiler
> Documentation
>   vac.html.common.search     4.4.0.0    C    C for AIX Compiler
> Documentation
>   vac.html.en_US.C           4.4.0.0    C    C for AIX Compiler
> Documentation
>   vac.html.en_US.search      4.4.0.0    C    C for AIX Compiler
> Documentation
>   vac.msg.en_US.C            4.4.0.0    C    C for AIX Compiler Messages -
> #
>
> --
> H.Merijn Brand
> using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
>   DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
> ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
> Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)

These are the compiler lpps I have installed:

# lslpp -L | grep -i vac
# lslpp -L | grep -i xlc
  xlC.aix43.rte              4.0.2.1    C    C Set ++ Runtime for AIX 4.3
  xlC.cpp                    4.3.0.1    C    C for AIX Preprocessor
  xlC.msg.en_US.cpp          4.3.0.1    C    C for AIX Preprocessor Messages
  xlC.msg.en_US.rte          4.0.2.0    C    C Set ++ Runtime Messages--U.S.
  xlC.msg.ja_JP.cpp          4.3.0.1    C    C for AIX Preprocessor Messages
  xlC.msg.ja_JP.rte          4.0.2.0    C    C Set ++ Runtime
  xlC.rte                    4.0.2.0    C    C Set ++ Runtime
# lslpp -L | grep -i ibmcxx
  ibmcxx.cmp                 3.6.6.4    C    IBM C and C++ Compilers
  ibmcxx.cmp.lic             3.6.6.0    C    IBM C and C++ Compilers LUM
  ibmcxx.include             3.6.6.1    C    IBM C++ Compiler Include Files
  ibmcxx.ioc.include         3.6.6.2    C    IBM Open Class Library Include
  ibmcxx.ioc.lib             3.6.6.2    C    IBM Open Class Library
  ibmcxx.ioc.rte             3.6.6.2    C    IBM Open Class Library
  ibmcxx.lib                 3.6.6.1    C    IBM C and C++ Compilers
  ibmcxx.memdbg              3.6.6.0    C    IBM C and C++ Compilers Memory
  ibmcxx.msg.en_US.ioc.rte   3.6.6.2    C    IBM Open Class Library Runtime
  ibmcxx.rte                 3.6.6.0    C    IBM C++ Compiler Application
#


John Fortin








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

Date: Fri, 7 Jul 00 14:17:18 +0200
From: h.m.brand@hccnet.nl (H. Merijn Brand)
Subject: RE: Compiling perl 5.6 on AIX 4.33
Message-Id: <8F6A907D3Merijn@192.0.1.90>

fortinj@attglobal.net (John Fortin) wrote in
<3964DC99.49D9294A@attglobal.net>: 

>"H. Merijn Brand" wrote:
>
>> fortinj@attglobal.net (John Fortin) wrote in
>> <39649FE4.4CD9669B@attglobal.net>:
>>
>> >Has anyone had success compiling perl 5.6 on aix 4.3.3.  I've tried
>> >it and get several warnings of this type:
>> >
>> >    # 1506-173 (W) Option lm is not valid.  Enter xlc for list of
>> >    valid 
>> >options.
>> >
>> >As far as I can tell, there is no 'lm' option passed anywhere.  There
>> >are '-lm' flags to link in libm.a.
>> >
>> >This seems to cause a problem with makedepend.  After the 'make',
>> >when I do a 'make test' everything recompiles.  Same with 'make
>> >install'. 
>> >
>> >Any ideas??
>> >
>> >John Fortin
>>
>> Did you upgrade to the latest vac version?
>> If you did, I'd be glad to pass on my config.sh
>>
>> # lslpp -L | grep -i vac
>>   vac.C                      4.4.0.3    C    C for AIX Compiler
>>   vac.C.readme.ibm           4.4.0.1    C    C for AIX iFOR/LS
>>   Information vac.html.SBCS.search       4.4.0.0    C    C for AIX
>>   Compiler 
>> Documentation
>>   vac.html.common.search     4.4.0.0    C    C for AIX Compiler
>> Documentation
>>   vac.html.en_US.C           4.4.0.0    C    C for AIX Compiler
>> Documentation
>>   vac.html.en_US.search      4.4.0.0    C    C for AIX Compiler
>> Documentation
>>   vac.msg.en_US.C            4.4.0.0    C    C for AIX Compiler
>>   Messages - 
>> #
>>
>> --
>> H.Merijn Brand
>> using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX
>> 4.3, 
>>   DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or
>>   DBD-Unify 
>> ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
>> Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
>
>These are the compiler lpps I have installed:
>
># lslpp -L | grep -i vac
># lslpp -L | grep -i xlc
>  xlC.aix43.rte              4.0.2.1    C    C Set ++ Runtime for AIX
>  4.3 xlC.cpp                    4.3.0.1    C    C for AIX Preprocessor
>  xlC.msg.en_US.cpp          4.3.0.1    C    C for AIX Preprocessor
>  Messages xlC.msg.en_US.rte          4.0.2.0    C    C Set ++ Runtime
>  Messages--U.S. xlC.msg.ja_JP.cpp          4.3.0.1    C    C for AIX
>  Preprocessor Messages xlC.msg.ja_JP.rte          4.0.2.0    C    C Set
>  ++ Runtime xlC.rte                    4.0.2.0    C    C Set ++ Runtime
># lslpp -L | grep -i ibmcxx
>  ibmcxx.cmp                 3.6.6.4    C    IBM C and C++ Compilers
>  ibmcxx.cmp.lic             3.6.6.0    C    IBM C and C++ Compilers LUM
>  ibmcxx.include             3.6.6.1    C    IBM C++ Compiler Include
>  Files ibmcxx.ioc.include         3.6.6.2    C    IBM Open Class
>  Library Include ibmcxx.ioc.lib             3.6.6.2    C    IBM Open
>  Class Library ibmcxx.ioc.rte             3.6.6.2    C    IBM Open
>  Class Library ibmcxx.lib                 3.6.6.1    C    IBM C and C++
>  Compilers ibmcxx.memdbg              3.6.6.0    C    IBM C and C++
>  Compilers Memory ibmcxx.msg.en_US.ioc.rte   3.6.6.2    C    IBM Open
>  Class Library Runtime ibmcxx.rte                 3.6.6.0    C    IBM
>  C++ Compiler Application 
>#

I presume you've paid for xlC, and therefor you're entitled to the upgrade 
to vac. It's worthwhile. They've changed a lot since xlC.

I have xlC running on AIX 4.2 but that's version 3.1.4:
# lslpp -L | grep -i xlc
  xlC.Bnd                    3.1.4.0    C    C for AIX and C Set ++ for AIX
  xlC.C                      3.1.4.0    C    C for AIX Compiler
  xlC.C++.ascl.lib           3.1.4.0    C    C Set ++ Application Support
  xlC.C++.browser            3.1.4.0    C    C Set ++ for AIX Browser
  xlC.C++.cmp                3.1.4.0    C    C Set ++ for AIX Compiler
  xlC.C++.cmp.data           3.1.4.0    C    C Set ++ for AIX Manual Pages
  xlC.C++.collect.lib        3.1.4.0    C    C Set ++ Collection Class
  xlC.C++.collect.samples    3.1.4.0    C    C Set ++ Collection Classes
  xlC.C++.collect.tutorial   3.1.4.0    C    C Set ++ Collection Classes
  xlC.C++.heapview           3.1.4.0    C    C Set ++ for AIX Heapview
  xlC.C++.iclui.lib          3.1.4.0    C    C Set ++ Graphical User
  xlC.C++.iclui.samples      3.1.4.0    C    C++ Graphical User Interface
  xlC.C++.include            3.1.4.0    C    C Set ++ for AIX Compiler
  xlC.C++.lib                3.1.4.0    C    C Set ++ for AIX Compiler
  xlC.C++.tcov               3.1.4.0    C    C Set ++ for AIX Test Coverage
  xlC.C++.tutorial           3.1.4.0    C    C Set ++ Tutorial
  xlC.C.data                 3.1.4.0    C    C for AIX Manual Pages
  xlC.C.readme.ibm           3.1.4.0    C    C and C Set ++ for AIX iFOR/LS
  xlC.cpp                    3.1.4.0    C    C for AIX Preprocessor
  xlC.ipf.en_US.C++.ascl     3.1.4.0    C    C++ Class Library Reference
  xlC.ipf.en_US.C++.iclui    3.1.4.0    C    C++ GUI Class Library 
Reference
  xlC.msg.en_US.C            3.1.4.0    C    C for AIX Compiler Messages
  xlC.msg.en_US.C++          3.1.4.0    C    C Set ++ for AIX Compiler
  xlC.msg.en_US.cpp          3.1.4.0    C    C for AIX Preprocessor 
Messages
  xlC.msg.en_US.rte          3.1.4.0    C    C Set ++ for AIX Application
  xlC.rte                    3.1.4.0    C    C Set ++ for AIX Application

That one did a splendid job for perl too, but my 4.3 machine is faster, so 
I don't use the 4.2 very much anymore.

Since xlC worked fine on 4.2, I may presume it works for 4.3 too. Need 
more? I'll mail you my config.sh.

4.2/xlC:
# perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=aix, osvers=4.2.1.0, archname=aix
    uname='aix ibm 2 4 000025794c00 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=
    cppflags='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxme
m=8192 -I/pro/local/include'
    ccflags ='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxme
m=8192 -I/pro/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-L/pro/local/lib'
    libpth=/pro/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lgdbm -ldbm -ldl -lld -lm -lc -lbsd -lPW
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -
bE:$(B
ASEEXT).exp -b noentry -lc -L/pro/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: DEBUGGING
  Built under aix
  Compiled at Apr 13 1999 16:46:49
  @INC:
    /pro/lib/perl5/5.00503/aix
    /pro/lib/perl5/5.00503
    /pro/lib/perl5/site_perl/5.005/aix
    /pro/lib/perl5/site_perl/5.005
    .

4.3/vac:
# perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=aix, osvers=4.2.1.0, archname=aix
    uname='aix ibm 2 4 000025794c00 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=
    cppflags='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxme
m=8192 -I/pro/local/include'
    ccflags ='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
qmaxme
m=8192 -I/pro/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-L/pro/local/lib'
    libpth=/pro/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lgdbm -ldbm -ldl -lld -lm -lc -lbsd -lPW
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -
bE:$(B
ASEEXT).exp -b noentry -lc -L/pro/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: DEBUGGING
  Built under aix
  Compiled at Apr 13 1999 16:46:49
  @INC:
    /pro/lib/perl5/5.00503/aix
    /pro/lib/perl5/5.00503
    /pro/lib/perl5/site_perl/5.005/aix
    /pro/lib/perl5/site_perl/5.005
    .
#

-- 
H.Merijn Brand
using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
  DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)


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

Date: Fri, 07 Jul 2000 15:53:54 +0100
From: "Joe_Broz@transarc.com" <jbroz@transarc.com>
Subject: Re: Compiling perl 5.6 on AIX 4.33
Message-Id: <3965EF02.8E16A95@transarc.com>

John Fortin wrote:
> 
> Has anyone had success compiling perl 5.6 on aix 4.3.3.  I've tried it
> and get several warnings of this type:
> 
>     # 1506-173 (W) Option lm is not valid.  Enter xlc for list of valid
> options.
> 
> As far as I can tell, there is no 'lm' option passed anywhere.  There
> are '-lm' flags to link in libm.a.
> 
> This seems to cause a problem with makedepend.  After the 'make', when I
> do a 'make test' everything recompiles.  Same with 'make install'.
> 
> Any ideas??
> 

I just compiled 5.6.0 on AIX 4.3.3.0 using compiler 3.6.6 with PTF 4. The
compile failed when I had only 3.6.6.0 and updating to the lastest PTF
(APAR IY10753, if anyone is interested) for this compiler caused the
problem to go away.

I do not have any part of the VisualAge compiler installed, just 3.6.6. I
don't think that should matter, though. However, xlc on my system points to
/usr/ibmcxx/bin/xlc.

# lslpp -l | grep -i ibmcxx
ibmcxx.cmp                 3.6.6.4  IBM C and C++ Compilers
ibmcxx.cmp.lic             3.6.6.0  IBM C and C++ Compilers LUM
ibmcxx.include             3.6.6.1  IBM C++ Compiler Include Files
ibmcxx.lib                 3.6.6.1  IBM C and C++ Compilers
ibmcxx.msg.en_US.cmp       3.6.6.0  IBM C and C++ Compilers
ibmcxx.msg.en_US.ioc.rte   3.6.6.0  IBM Open Class Library Runtime
ibmcxx.msg.en_US.rescmp    3.6.6.0  IBM Resource Compiler
ibmcxx.rte                 3.6.6.0  IBM C++ Compiler Application
ibmcxx.cmp                 3.6.6.0  IBM C and C++ Compilers

My output for 'grep -i xlc' matches yours.

You appear to have 3.6.6.4 as well. I ran configure like this:

# sh Configure -de -Dprefix=/usr/opt/perl-5.6.0

This causes configure to run without prompting and all the defaults were
used.

Hope this helps,
joe


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

Date: Fri, 07 Jul 2000 14:26:17 GMT
From: static9@my-deja.com
Subject: Compiling PERL 5.6 on AIX
Message-Id: <8k4pa2$nbp$1@nnrp1.deja.com>

I'm trying to compile PERL 5.6 on AIX 4.3 with the cc compiler.

I do a "sh Configure -Dprefix=/s/mydir -des"

That works fine.  It seemed to have a problem substituting the MAKE
variable so I just redefined it.  Then,  when I do a make I get

    `sh  cflags libperl.a miniperlmain.o`  thrdvar.c
          CCCMD =  cc -DPERL_CORE -c -qmaxmem=8192 -D_ALL_SOURCE -
D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/local/include -O
cc: 1501-228 input file thrdvar.c not found
make: Error code -1024

This part in the Makefile seems to be the problem

FIRSTMAKEFILE = makefile

# Any special object files needed by this architecture, e.g. os2/os2.obj
ARCHOBJS =

 .SUFFIXES: .c $(OBJ_EXT)

# grrr
SHELL = /bin/sh

CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`

Anyone know of why the $@ looks for a .c file even though a .o file
doesn't exist?  There is a thrdvar.h.  Is there another way to change
this?

Thanks,

static


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 07 Jul 2000 20:51:28 +0100
From: jb <jbroz@yperite.demon.co.uk>
Subject: Re: Compiling PERL 5.6 on AIX
Message-Id: <396634C0.5CC3DAAE@yperite.demon.co.uk>

static9@my-deja.com wrote:
> 
> I'm trying to compile PERL 5.6 on AIX 4.3 with the cc compiler.
> 
> I do a "sh Configure -Dprefix=/s/mydir -des"
> 
> That works fine.  It seemed to have a problem substituting the MAKE
> variable so I just redefined it.  Then,  when I do a make I get

There have been two recent threads on compiling 5.6 on AIX. It might
matter what compiler yu're using. I compiled it today on AIX 4.3.3.0
with compiler 3.6.6.4 and used a configure line almost identical to
yours (except for the prefix bit).

Provide the output for 

# lslpp -l | grep -i ibmcxx and
# lslpp -l | grep -i vac and perhaps
# lslpp -l | grep -i xlc


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

Date: Fri, 7 Jul 2000 14:09:12 +1000
From: "news.att.net.au" <lachlan.thomas@connect.com.au>
Subject: Compiling Perl on Unix
Message-Id: <8k3l24$dae$1@merki.connect.com.au>

Is anyone able to give me advice on how to compile a perl script on a Unix
box?

Which modules need to be installed? Its Perl 5.00?

Thanks




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

Date: Fri, 07 Jul 2000 04:49:21 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Compiling Perl on Unix
Message-Id: <39656193.6A28C51F@rochester.rr.com>

"news.att.net.au" wrote:
> 
> Is anyone able to give me advice on how to compile a perl script on a Unix
> box?

   perl -c perlprogramname.pl

Or if that isn't what you meant:

   perldoc perlcompile

> 
> Which modules need to be installed? Its Perl 5.00?

Whichever ones you are using.  Look for "use" statements.

 ...
-- 
Bob Walton


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

Date: 8 Jul 2000 05:27:09 GMT
From: Prakash Kailasa <prakash@gate.net>
Subject: Constructing multi-level hashes
Message-Id: <8k6e3d$tac$1@news.gate.net>

Please take a look at the following:

$ perl -de 1
[....]
main::(-e:1):   1
  DB<1> $h->{a}{b} = 'ab'

  DB<2> x $h
0  HASH(0xbdde5c)
   'a' => HASH(0xbddf94)
      'b' => 'ab'
  DB<3> $h->{a}{b}{c} = 'abc'

  DB<4> x $h
0  HASH(0xbdde5c)
   'a' => HASH(0xbddf94)
      'b' => 'ab'

After the second assignment, I expected the second level element (key
'b') to have its value changed from the scalar ('ab') to a reference to
an anonymous hash ({c => 'abc'}). But as the second 'x' command shows,
that hash contents haven't changed at all.

Can someone explain what I am missing here?

Thanks,
/prakash


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

Date: 07 Jul 2000 22:54:29 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Constructing multi-level hashes
Message-Id: <m13dlli2ui.fsf@halfdome.holdit.com>

>>>>> "Prakash" == Prakash Kailasa <prakash@gate.net> writes:

Prakash> Can someone explain what I am missing here?

You're missing "use strict", which would catch that you are no longer
doing autovivification (which works only on lvalues that were undef
prior to the operation) and instead doing a symbolic (de-)reference,
looking at the variable $main::ab(!).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 8 Jul 2000 01:41:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Constructing multi-level hashes
Message-Id: <slrn8mdfoq.o6s.tadmc@magna.metronet.com>

On 8 Jul 2000 05:27:09 GMT, Prakash Kailasa <prakash@gate.net> wrote:
>Please take a look at the following:
>
>$ perl -de 1
>[....]
>main::(-e:1):   1
>  DB<1> $h->{a}{b} = 'ab'
>
>  DB<2> x $h
>0  HASH(0xbdde5c)
>   'a' => HASH(0xbddf94)
>      'b' => 'ab'
>  DB<3> $h->{a}{b}{c} = 'abc'
>
>  DB<4> x $h
>0  HASH(0xbdde5c)
>   'a' => HASH(0xbddf94)
>      'b' => 'ab'


Please take a look at the following:

--------------------------
#!/usr/bin/perl -w
use strict;            # strict is good. Even when your program
                       # has only 2 interesting lines  :-)
use Data::Dumper;

my $h;

$h->{a}{b} = 'ab';
print Dumper($h), "------------\n\n";

#$h->{a}{b} = undef;   # let autoviv make a hashref
#$h->{a}{b} = {};      # make a hashref yourself

$h->{a}{b}{c} = 'abc';
print Dumper($h), "------------\n\n";
--------------------------

output:


$VAR1 = {
          'a' => {
                   'b' => 'ab'
                 }
        };
------------


Can't use string ("ab") as a HASH ref while "strict refs" in use at ./temp line 13.


Hmmm. Looks like a symref I guess.


>After the second assignment, I expected the second level element (key
>'b') to have its value changed from the scalar ('ab') 
                                         ^^^^^^   ^^

Autovivification only happens when you try to dereference
the undef value.


>to a reference to
>an anonymous hash ({c => 'abc'}). But as the second 'x' command shows,
>that hash contents haven't changed at all.
>
>Can someone explain what I am missing here?


Your value ('ab') is not undef, so you do not get autovivification.

So you have to do it yourself.

Comment out either of the statments above to get the correct data structure.



-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 5 Jul 2000 12:14:29 +0200
From: "Thomas Hermann" <thermann@mtgnet.de>
Subject: Convert Email with BASE64 encoded Attachments
Message-Id: <8jv1ou$8jh$1@wrath.news.nacamar.de>

Does anybody knows an simple way, how to convert (with a perl script) an
email with BASE64 encoded attatchments to an
email with unencoded attatchments? Another Question, how can I find out,
that the attatchments are BASE 64 ecoded?

Thanks,

      Thomas




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

Date: Wed, 5 Jul 2000 13:26:27 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Convert Email with BASE64 encoded Attachments
Message-Id: <8jv61l$1pn1@intranews.dresdnerbank.de>

    Hi,

Thomas Hermann schrieb in Nachricht <8jv1ou$8jh$1@wrath.news.nacamar.de>...
>Does anybody knows an simple way, how to convert (with a perl script) an
>email with BASE64 encoded attatchments to an
>email with unencoded attatchments?

    use MIME::Base64. It contains two functions
    encode_base64() and decode_base64()

>Another Question, how can I find out,
>that the attatchments are BASE 64 ecoded?

    Have a look at the headers of the MIME part.
    There is a header field "Content-Transfer-Encoding"
    which tells you about the encoding method.

    Best regards,

        Peter Dintelmann





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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3555
**************************************


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