[17404] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4824 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 6 14:10:55 2000

Date: Mon, 6 Nov 2000 11:10:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973537815-v9-i4824@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 6 Nov 2000     Volume: 9 Number: 4824

Today's topics:
    Re: OT:  Behind the Cargo Cult <jeff@vpservices.com>
    Re: OT:  Behind the Cargo Cult (Mark-Jason Dominus)
    Re: OT:  Behind the Cargo Cult <mischief@velma.motion.net>
    Re: Passing hash to perl module <ren.maddox@tivoli.com>
        perl for macintosh ibook (Joseph J.  Alotta)
        PerlCtrl <hopes@ole.com>
    Re: problems creating a file <crowj@aol.com>
    Re: read > find > run <jeff@vpservices.com>
    Re: read last line only... <yanick@babyl.sympatico.ca>
        Script seems to be running twice each time aklop@my-deja.com
    Re: Script seems to be running twice each time <ren.maddox@tivoli.com>
    Re: Search engine woes... <jeff@yoak.com>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Where to find IO/Pty.pm? <epa98@doc.ic.ac.uk>
        Why is my hash coming untied? <djberg96@my-deja.com>
    Re: Why is my hash coming untied? (Mark-Jason Dominus)
    Re: Why is my hash coming untied? <djberg96@my-deja.com>
    Re: Why is my hash coming untied? (Mark-Jason Dominus)
    Re: Why is my hash coming untied? <djberg96@my-deja.com>
    Re: Why is my hash coming untied? <crt@kiski.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 06 Nov 2000 08:51:19 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: OT:  Behind the Cargo Cult
Message-Id: <3A06E187.CBD09F40@vpservices.com>

Joe Schaefer wrote:
> 
> Lou Moran <lmoran@wtsg.com> writes:
> 
> > --Where can I find the Story behind the Cargo Cult phrase?  I read it
> > in a post ages ago and I can't find it again.  It was a good story.
> 
> google ("Richard Feynman 1974 Caltech Commencement")

That is a good starting place perhaps for the use of the phrase "Cargo
Cult" in its contemporary sense within the "hard" sciences, but the
history of the phrase goes back at least to the 1940s and is, in a very
rich sense, a self-referential phrase -- the very term "Cargo Cult" is
itself an example of a phrase picked up out of context and copied as an
example of something it never exemplified in the first place.  
Basically, to simplify, colonial administrators and missionaries and
anthropologists who blindly believed them misinterpreted the religious
practices of some south seas islanders to be what is popularly called a
"Cargo Cult" -- a group of people who worship material goods and believe
that the gods will bring them gifts from the sky as did the supply
planes in the second world war.  Well it turns out that that is a
complete misinterpretation of what the native religion was actually
about but never-the-less it became a popular phrase both within and
outside anthropology.  Within anthropology the term has a more technical
meaning refering to a certain kind of reaction to acculturation, and
current anthropologists have correctly placed the "Cargo Cult"
stereotype of the natives waiting for goods from the great airplane in
the sky as as an artifact of western culture, not as a reflection of
south seas islands culture, (see for example:
http://enzo.gen.nz/jonfrum/text000.htm).  That hasn't stopped the phrase
from taking on a life of its own outside anthropology.

-- 
Jeff


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

Date: Mon, 06 Nov 2000 16:59:31 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: OT:  Behind the Cargo Cult
Message-Id: <3a06e36f.20f1$1ee@news.op.net>

In article <8bfd0toip3j179ehvs3lpar9af15hl7toi@4ax.com>,
Lou Moran  <lmoran@wtsg.com> wrote:
>--Where can I find the Story behind the Cargo Cult phrase?  

Great heavens!    Don't you have a web browser yet?  You visit
http://www.google.com/  and type "cargo cult" into the box.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Mon, 06 Nov 2000 17:56:28 -0000
From: <mischief@velma.motion.net>
Subject: Re: OT:  Behind the Cargo Cult
Message-Id: <t0ds6cfl9naq6a@corp.supernews.com>

Lou Moran <lmoran@wtsg.com> wrote:
> --Where can I find the Story behind the Cargo Cult phrase?  I read it
> in a post ages ago and I can't find it again.  It was a good story.

There are other places to check on this, but I prefer the Jargon File.
http://www.tuxedo.org/jargon ... or check out ESR's homepage at
http://www.tuxedo.org/~esr, form which you can find links to the Jargon
File (The New Hacker's Dictionary as some like to call it) and a host
of other writings and software projects by, edited/maintained by, or
contributed to by ESR.

Mr. Raymond is a must-read author for anyone using Open Source Software.


> "Ow, ow, stupid trash, rotten, stinky, hate world, revenge soon,
> take out on everyone..." 
> lmoran@wtsg.com

-- 
Christopher E. Stith
mischief@motion.net


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

Date: 06 Nov 2000 09:50:53 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Passing hash to perl module
Message-Id: <m3wvehumjm.fsf@dhcp11-177.support.tivoli.com>

spcman@my-deja.com writes:
> 
> $RunTemplate -> SetVariables(\%INFO);

This time, you've chosen to pass a reference to the hash...

> sub SetVariables {

This is a method, so the first argument is the object itself:

    my $self = shift

>   my(%hash) = @_;

You passed a reference to the hash, so that's what you should expect
here:

    my $hashref = shift;

And update the following accordingly:

>   foreach $key (keys %hash) {

    foreach my $key (keys %$hashref) {

>    print "$key value: $hash{$key}<BR><BR>";    #Look at output below

     print "$key value: $hashref->{$key}<BR><BR>";

>   }

-- 
Ren Maddox
ren@tivoli.com


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

Date: Mon, 06 Nov 2000 17:32:04 GMT
From: jalotta@earthlink.net (Joseph J.  Alotta)
Subject: perl for macintosh ibook
Message-Id: <jalotta-0611001133440001@1cust125.tnt6.chi1.da.uu.net>

What is the best perl for a macintosh ibook and where can I get it?


Joe.

-- 
Everything is beautiful in its time and the Lord God 
has put enternity in the hearts of men.     Ecc 3:11


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

Date: Mon, 6 Nov 2000 19:21:45 +0100
From: "Hopes" <hopes@ole.com>
Subject: PerlCtrl
Message-Id: <8u6sk9$oa8$1@diana.bcn.ttd.net>

Hello,
I'm using PDK.
I tried to create a dll with a component which can make a HTTP request using
LWP::UserAgent.
PDK compiles the code without error, but the ActiveX component don´t  return
the response.

I have created other dlls with methods and properties, and I haven´t found
any problem.
żDoes anyone know what is happening whith my code?

##############################################


package MyNavigatorComponent;

use LWP::UserAgent;

sub GetTheURL
{
 $ua = new LWP::UserAgent;
 $request = new HTTP::Request('GET', $mylocation);
 $response = $ua->request($request);
 $variable = $response->content();
 return $variable;
}

use vars qw($mylocation);
$mylocation='http://www.microsoft.com';




=POD
=BEGIN PerlCtrl
    %TypeLib = (
        PackageName     => 'MyNavigatorComponent',
        TypeLibGUID     => '{89ADD50E-A69F-11D4-8851-004F4E00EAA4}', # do
NOT edit this line
        ControlGUID     => '{89ADD50F-A69F-11D4-8851-004F4E00EAA4}', # do
NOT edit this line either
        DispInterfaceIID=> '{89ADD510-A69F-11D4-8851-004F4E00EAA4}', # or
this one
        ControlName     => 'My Navigator ',
        ControlVer      => 1,  # increment if new object with same ProgID
                               # create new GUIDs as well
        ProgID          => 'MyNavigator',
        DefaultMethod   => 'GetTheURL',
        Methods         => {
            'GetTheURL' => {
                RetType             =>  VT_BSTR,
                TotalParams         =>  0,
                NumOptionalParams   =>  0,
                ParamList           =>  []
            },
        },  # end of 'Methods'
        Properties         => {
        'mylocation' => {
            Type                => VT_BSTR,
            ReadOnly            => 0,
     },

        },  # end of 'Properties'
    );  # end of %TypeLib
=END PerlCtrl
=cut





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

Date: Mon, 06 Nov 2000 11:25:50 -0500
From: John Crowley <crowj@aol.com>
Subject: Re: problems creating a file
Message-Id: <3A06DB8E.2F4B5CC9@aol.com>

Mike Dorrel wrote:
> 
> Hello,
> 
> The following simple script is supposed to create a one line text file,
> but it is not working correctly and I get no error from the browser
> when I run the script.
> 
> the script is placed in 'MyDomain/cgi-bin/create.cgi' and is supposed
> to create the file as 'MyDomain/newfile.txt'.
> 
>     #!/usr/bin/perl5
> 
>     print "Content-type: text/html\n\n";
>     use CGI::Carp 'fatalsToBrowser';
> 
>     if (open(LOGFILE, "> /newfile.txt")) {
>         print LOGFILE ("sample text.\n");
>         close(LOGFILE);
>     }
> 
> Thanks for any response.
> 
> Mike

Your file open statement is not specifying "MyDomain/newfile.txt", it
is specifying "/newfile.txt".  You may be confusing web server root
with machine root; they are not the same thing.  Use "./newfile.txt".


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

Date: Mon, 06 Nov 2000 08:23:54 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: read > find > run
Message-Id: <3A06DB1A.21DCB25@vpservices.com>

Brian Canning wrote:
> 
> does that make sense now?

What you are trying to do made sense the first time.  What isn't evident
from any of your posts is that you have never said in what manner the
script fails to do what you want.  Is there an error message, if so,
what?  Is it failing to print?  Is it printing the wrong thing? Is it
failing to find the comments?  Is it replacing other things instead of
the comments?  There is no way for anyone to guess which of those things
you mean by "going wrong".

-- 
Jeff


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

Date: Mon, 06 Nov 2000 17:30:45 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: read last line only...
Message-Id: <9VBN5.447253$1h3.12087650@news20.bellglobal.com>

Enjoyer <enjoyer@aol.com> wrote:
: I'm trying to read the last line of a file only, using print, any ideas ?

	perl -ne'print if eof' yourfile

Joy,
Yanick

-- 
($_,$y)=("Yhre lo  .kePnarhtretcae\n",   '(.) (.)'  );
$y=~s/\(/(./gwhile s/$y/$2$1/xg;print;       @      !; 
                                     "     `---'    ";


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

Date: Mon, 06 Nov 2000 17:41:48 GMT
From: aklop@my-deja.com
Subject: Script seems to be running twice each time
Message-Id: <8u6qgq$ins$1@nnrp1.deja.com>

Hi,
I am building a perl cgi script. When it is called by a persons browser
it first reads a file, writes to another file and then prints the
results to their browser.

Problem is everytime I test this script from the web it opens reads and
writes these files twice before it prints to the browser.

There are no loops in this code. It runs right down the script reading
the file writes to a file and prints to the browser. Seems easy enough
but what could cause it to read and write these files twice.

I am using strict, -w, flock and I am using CGI::Carp to write errors to
a log. I am getting no errors at all.

Could there be some kind of switch that I need to cut on or off when I
change from writing to the file to printing to the browser?

I don't know maybe it's something simple? So far it has not seemed
simple to me, ha ha.

Please any help even if you slam me, I don't care. I will welcome any
and all comments or suggestions.

Thank you!



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


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

Date: 06 Nov 2000 12:02:45 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Script seems to be running twice each time
Message-Id: <m37l6hugfu.fsf@dhcp11-177.support.tivoli.com>

aklop@my-deja.com writes:

> Hi,
> I am building a perl cgi script. When it is called by a persons browser
> it first reads a file, writes to another file and then prints the
> results to their browser.
> 
> Problem is everytime I test this script from the web it opens reads and
> writes these files twice before it prints to the browser.

How do you know it does this?  I'm not doubting you, it's just that
how you know may give us a clue as to what is going on.

> There are no loops in this code. It runs right down the script reading
> the file writes to a file and prints to the browser. Seems easy enough
> but what could cause it to read and write these files twice.

Maybe the script itself is running twice... assuming that nothing in
the code causes the behavior, then is must be getting called twice.

Perhaps you could post the code here for examination.  Also include
any details about how it is invoked.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Mon, 06 Nov 2000 09:40:08 +0800
From: "Jeff Yoak" <jeff@yoak.com>
Subject: Re: Search engine woes...
Message-Id: <8u6qft01akv@news1.newsguy.com>

In article <8u6ij0$b9f$1@nnrp1.deja.com>, acroapl@my-deja.com wrote:

> how can you match strings w/o capitaliztion being checked?  Is there a
> function like in C?

If you are using something like the match operator, it has flags that
will allow case insensitive matching.  You'll find that in the
documentation.

Good luck!

Cheers,
Jeff


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

Date: Mon, 06 Nov 2000 17:36:28 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <t0dr0sfe10rh46@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 30 Oct 2000 17:35:35 GMT and ending at
06 Nov 2000 14:47:52 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2000 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com

Totals
======

Posters:  430
Articles: 1394 (654 with cutlined signatures)
Threads:  376
Volume generated: 2494.8 kb
    - headers:    1112.7 kb (22,155 lines)
    - bodies:     1293.6 kb (42,177 lines)
    - original:   820.1 kb (29,043 lines)
    - signatures: 87.1 kb (2,113 lines)

Original Content Rating: 0.634

Averages
========

Posts per poster: 3.2
    median: 1.0 post
    mode:   1 post - 241 posters
    s:      6.9 posts
Posts per thread: 3.7
    median: 2.0 posts
    mode:   1 post - 101 threads
    s:      4.0 posts
Message size: 1832.6 bytes
    - header:     817.4 bytes (15.9 lines)
    - body:       950.2 bytes (30.3 lines)
    - original:   602.4 bytes (20.8 lines)
    - signature:  64.0 bytes (1.5 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   71   139.4 ( 52.8/ 76.8/ 49.8)  Tad McClellan <tadmc@metronet.com>
   62   155.3 ( 54.8/ 87.9/ 59.1)  mgjv@tradingpost.com.au
   42   112.8 ( 30.3/ 82.5/ 68.9)  Tom Christiansen <tchrist@perl.com>
   38    77.4 ( 34.9/ 41.5/ 20.5)  Ren Maddox <ren.maddox@tivoli.com>
   36    65.0 ( 28.8/ 30.9/ 18.7)  Gwyn Judd <tjla@guvfybir.qlaqaf.bet>
   34    52.9 ( 29.7/ 23.0/ 15.4)  Bart Lateur <bart.lateur@skynet.be>
   27    47.6 ( 17.2/ 30.3/ 13.3)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   27    54.0 ( 28.2/ 20.6/ 15.7)  Mark-Jason Dominus <mjd@plover.com>
   23    32.7 ( 16.2/ 14.8/  9.7)  nobull@mail.com
   21    30.1 ( 15.6/ 13.6/  7.5)  Chris Fedde <cfedde@fedde.littleton.co.us>

These posters accounted for 27.3% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 155.3 ( 54.8/ 87.9/ 59.1)     62  mgjv@tradingpost.com.au
 139.4 ( 52.8/ 76.8/ 49.8)     71  Tad McClellan <tadmc@metronet.com>
 112.8 ( 30.3/ 82.5/ 68.9)     42  Tom Christiansen <tchrist@perl.com>
  77.4 ( 34.9/ 41.5/ 20.5)     38  Ren Maddox <ren.maddox@tivoli.com>
  65.0 ( 28.8/ 30.9/ 18.7)     36  Gwyn Judd <tjla@guvfybir.qlaqaf.bet>
  54.0 ( 28.2/ 20.6/ 15.7)     27  Mark-Jason Dominus <mjd@plover.com>
  52.9 ( 29.7/ 23.0/ 15.4)     34  Bart Lateur <bart.lateur@skynet.be>
  47.6 ( 17.2/ 30.3/ 13.3)     27  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  41.0 ( 23.0/ 14.6/ 14.2)     19  David Steuber <nospam@david-steuber.com>
  40.0 ( 18.4/ 19.1/ 10.8)     20  James Taylor <james@NOSPAM.demon.co.uk>

These posters accounted for 31.5% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.980  (  5.0 /  5.1)      7  Anthony <apsaffer@hotmail.com>
0.976  ( 14.2 / 14.6)     19  David Steuber <nospam@david-steuber.com>
0.941  (  3.3 /  3.5)      7  "Cam" <celliot@tartarus.uwa.edu.au>
0.848  (  8.2 /  9.7)      6  Fulko Hew <fulko@wecan.com>
0.848  (  2.3 /  2.7)      6  BUCK NAKED1 <dennis100@webtv.net>
0.836  ( 68.9 / 82.5)     42  Tom Christiansen <tchrist@perl.com>
0.792  (  3.6 /  4.6)      5  msalerno@my-deja.com
0.759  ( 15.7 / 20.6)     27  Mark-Jason Dominus <mjd@plover.com>
0.723  (  7.6 / 10.5)      6  Ian Boreham <ianb@ot.com.au>
0.684  (  6.0 /  8.7)      9  "mark" <markscott@barclays.net>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.429  (  3.8 /  8.8)      7  Bob Walton <bwalton@rochester.rr.com>
0.426  (  4.5 / 10.7)      8  "MNJP" <not.my.real.email@bellglobal.com>
0.420  (  2.0 /  4.7)      8  Jonathan.L.Ericson@jpl.nasa.gov
0.418  (  3.0 /  7.2)     10  Richard J. Rauenzahn <nospam@hairball.cup.hp.com>
0.390  (  1.6 /  4.0)      5  "Randy Harris" <harrisr@bignet.net>
0.381  (  0.7 /  1.9)      5  Randal L. Schwartz <merlyn@stonehenge.com>
0.357  (  6.0 / 16.8)     11  Ameen Dausha <ameen@dausha.net>
0.356  (  3.3 /  9.3)     12  Rafael Garcia-Suarez <rgarciasuarez@free.fr>
0.355  (  3.1 /  8.8)     14  Clay Irving <clay@panix.com>
0.330  (  2.8 /  8.4)      9  "Peter Sundstrom" <peter.sundstrom@eds.com>

54 posters (12%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   32  Perl Question
   30  Want to process all files less than 24 hours old
   24  "chown" of symlink instead of linked file
   20  CGI Perl vs. Java Servlets...
   18  About to slit my own throat
   18  Unix commands via perl?
   18  regular expression
   15  String manipulation??
   15  Comparing two files
   15  + or -

These threads accounted for 14.7% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  71.3 ( 26.0/ 42.7/ 27.9)     30  Want to process all files less than 24 hours old
  69.1 ( 29.7/ 35.8/ 20.7)     32  Perl Question
  57.3 ( 13.1/ 42.3/ 32.0)     15  Comparing two files
  47.5 ( 21.5/ 23.9/ 16.0)     24  "chown" of symlink instead of linked file
  39.9 ( 12.5/ 26.3/ 15.8)     13  Building a Module on Server without Install.pm
  35.1 ( 12.5/ 22.1/ 13.1)     14  1+(-1)=? can be 0 or 2, depending on context
  31.4 ( 12.3/ 17.7/ 12.1)     18  About to slit my own throat
  30.4 ( 15.0/ 14.5/  8.0)     18  regular expression
  29.9 ( 13.6/ 14.4/  8.5)     15  String manipulation??
  27.5 ( 11.5/ 14.6/  6.8)     13  embedded variables in a file

These threads accounted for 17.6% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.811  (  2.0/   2.5)      5  mySQL & Perl
0.810  (  4.6/   5.6)     13  Freelance Programmer Neede - Good Money
0.780  (  2.0/   2.6)      5  Newbie question: Get date of 3rd Friday in a given year/month?
0.757  ( 32.0/  42.3)     15  Comparing two files
0.757  (  3.1/   4.0)      6  Newbie question about hashes
0.753  ( 11.2/  14.8)      8  Tom's perlman utility ?
0.739  (  4.3/   5.8)      8  even or odd ?
0.739  (  8.3/  11.2)     12  Perl style and module searches
0.736  (  2.7/   3.7)      5  using regex to insert data
0.724  (  3.6/   4.9)      5  Passing hash to perl module

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.452  (  1.4 /  3.2)      6  running UNIX utilities in perl
0.428  (  2.4 /  5.7)      5  network security
0.425  (  2.4 /  5.6)      8  Reading a backslash in a variable?
0.421  (  2.2 /  5.2)      5  Q on returning hashes from subroutines
0.415  (  0.9 /  2.2)      5  INTERACTIVE DEBUGGER !!??
0.414  (  1.2 /  3.0)      7  Hardwood Website
0.406  (  2.7 /  6.7)      8  Do I need eval?
0.344  (  0.9 /  2.6)      7  http request with back button
0.327  (  0.9 /  2.7)      5  how to get return value of process
0.257  (  2.3 /  9.0)      5  LWP::UserAgent & loading images?

85 threads (22%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      22  comp.lang.perl.modules
       9  comp.lang.perl
       7  comp.lang.perl.moderated
       6  alt.perl
       5  de.comp.lang.perl.cgi
       4  comp.lang.pascal.delphi.misc
       4  comp.lang.javascript
       4  comp.lang.pascal.borland
       4  comp.lang.lisp
       4  comp.lang.java.programmer

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  Markus Humm <mhumm@ba-mosbach.de>
       6  "MIREBEAU.FAMILY" <MIREBEAU.FAMILY@wanadoo.fr>
       6  Phil xxx <phil_xxx@my-deja.com>
       6  "Elaine Ashton" <elaine@chaos.wustl.edu>
       6  "Daniel J. Wojcik" <wojcik@genjerdan.com>
       5  Johan Vromans <JVromans@Squirrel.nl>
       4  =?iso-8859-1?Q?Fran=E7ois=20D=E9sarm=E9nien?= <francois@fdesar.net>
       3  mail@lboth.de
       3  Ren Maddox <ren.maddox@tivoli.com>
       3  venez1@my-deja.com


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

Date: 06 Nov 2000 15:44:42 +0000
From: Edward Avis <epa98@doc.ic.ac.uk>
Subject: Re: Where to find IO/Pty.pm?
Message-Id: <xn9r94pcdg5.fsf@texel26.doc.ic.ac.uk>

Ulrich Ackermann <uackermann@orga.com> writes:

>there is still the IO/Pty.pm module missing. I have not
>found that one on CPAN.

IIRC it likes to hide in tarballs belonging to other modules.  Try the
tarball for IO::Tty.

-- 
Ed Avis
epa98@doc.ic.ac.uk


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

Date: Mon, 06 Nov 2000 16:33:35 GMT
From: Daniel Berger <djberg96@my-deja.com>
Subject: Why is my hash coming untied?
Message-Id: <8u6mgv$f35$1@nnrp1.deja.com>

Hi all,

Trying out Tie::IxHash...

It appears that hashes cannot remained tied between different
packages.  In other words, when I tie a hash in package X and try to
grab that hash in package Z (via a subroutine provided in package X),
the hash becomes "untied".

Is there any way to preserve the tie between packages without calling
tie on the hash again in package Z?

Thanks in advance.

Regards,

Dan

--
In the immortal words of Socrates, "I drank what?"


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


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

Date: Mon, 06 Nov 2000 16:55:59 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Why is my hash coming untied?
Message-Id: <3a06e29e.20d8$1c5@news.op.net>
Keywords: burette, essential, sheepskin, sole

In article <8u6mgv$f35$1@nnrp1.deja.com>,
Daniel Berger  <djberg96@my-deja.com> wrote:
>It appears that hashes cannot remained tied between different
>packages.  In other words, when I tie a hash in package X and try to
>grab that hash in package Z (via a subroutine provided in package X),
>the hash becomes "untied".

You didn't show the code, so I can only guess what is going on.  But I
suppose that you have *copied* the tied hash, which creates a new,
untied hash, with a copy of the data in it.  You might have done

        tie %old => Tie::IxHash;
        %new = %old;

in which case %old remains tied, and then its magical FETCH method is
used to generate data which initializes the (ordinary) %new hash.  Or
you might have done

        %new = function();

        sub function {
          tie %old => Tie::IxHash;
          return %old;
        }

which does the same thing.

It is the hash itself that is tied, not the data in it.  If you do
something like this:

        $ref = function();

        sub function {
          tie %old => Tie::IxHash;
          return \%old;
        }

then you return a reference to the tied hash.
          
Of course, your problem might be totally unrelated, but since you
didn't show any code, I have no way to know.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Mon, 06 Nov 2000 17:08:07 GMT
From: Daniel Berger <djberg96@my-deja.com>
Subject: Re: Why is my hash coming untied?
Message-Id: <8u6ohf$gug$1@nnrp1.deja.com>

Ok - I realize that I can keep my hash tied by returning a reference to
the hash, but what if I don't want to return a reference?

Thanks again.

Dan

In article <8u6mgv$f35$1@nnrp1.deja.com>,
  Daniel Berger <djberg96@my-deja.com> wrote:
> Hi all,
>
> Trying out Tie::IxHash...
>
> It appears that hashes cannot remained tied between different
> packages.  In other words, when I tie a hash in package X and try to
> grab that hash in package Z (via a subroutine provided in package X),
> the hash becomes "untied".
>
> Is there any way to preserve the tie between packages without calling
> tie on the hash again in package Z?
>
> Thanks in advance.
>
> Regards,
>
> Dan
>
> --
> In the immortal words of Socrates, "I drank what?"
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
In the immortal words of Socrates, "I drank what?"


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


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

Date: Mon, 06 Nov 2000 17:32:47 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Why is my hash coming untied?
Message-Id: <3a06eb3e.22e2$9f@news.op.net>

In article <8u6ohf$gug$1@nnrp1.deja.com>,
Daniel Berger  <djberg96@my-deja.com> wrote:
>Ok - I realize that I can keep my hash tied by returning a reference to
>the hash, but what if I don't want to return a reference?

Since there is no such thing as a function that returns a hash, I'd
say you are totally out of luck.
-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Mon, 06 Nov 2000 17:51:49 GMT
From: Daniel Berger <djberg96@my-deja.com>
Subject: Re: Why is my hash coming untied?
Message-Id: <8u6r3h$j95$1@nnrp1.deja.com>

Ok, here's some sample code...

package X;

sub getHash{
   tie %myHash, "Tie::IxHash";
   %myHash = whatever...;

   #return \%myHash;    - retains tie
   return %myHash;      - comes untied
}

package Z;
use X;

my %newHash = &getHash;


Is there any way to retain the tie in %newHash this way, or *must* I
return a reference in order to keep that behavior?

Thanks again.

Dan


In article <3a06e29e.20d8$1c5@news.op.net>,
  mjd@plover.com (Mark-Jason Dominus) wrote:
> In article <8u6mgv$f35$1@nnrp1.deja.com>,
> Daniel Berger  <djberg96@my-deja.com> wrote:
> >It appears that hashes cannot remained tied between different
> >packages.  In other words, when I tie a hash in package X and try to
> >grab that hash in package Z (via a subroutine provided in package X),
> >the hash becomes "untied".
>
> You didn't show the code, so I can only guess what is going on.  But I
> suppose that you have *copied* the tied hash, which creates a new,
> untied hash, with a copy of the data in it.  You might have done
>
>         tie %old => Tie::IxHash;
>         %new = %old;
>
> in which case %old remains tied, and then its magical FETCH method is
> used to generate data which initializes the (ordinary) %new hash.  Or
> you might have done
>
>         %new = function();
>
>         sub function {
>           tie %old => Tie::IxHash;
>           return %old;
>         }
>
> which does the same thing.
>
> It is the hash itself that is tied, not the data in it.  If you do
> something like this:
>
>         $ref = function();
>
>         sub function {
>           tie %old => Tie::IxHash;
>           return \%old;
>         }
>
> then you return a reference to the tied hash.
>
> Of course, your problem might be totally unrelated, but since you
> didn't show any code, I have no way to know.
>
> --
> @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona
tsuJ";sub p{
> @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P
[$f|ord
> ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^
[P.]/&&
> close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/
\S/;print
>

--
In the immortal words of Socrates, "I drank what?"


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


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

Date: Mon, 6 Nov 2000 13:38:00 -0500
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: Why is my hash coming untied?
Message-Id: <Pine.OSF.4.21.0011061332480.4686-100000@home.kiski.net>

Today around 4:33pm, Daniel Berger hammered out this masterpiece:

: It appears that hashes cannot remained tied between different
: packages.  In other words, when I tie a hash in package X and try to
: grab that hash in package Z (via a subroutine provided in package X),
: the hash becomes "untied".

This type of problem is probably due to the way you're trying to
return the hash.  You can't just return the hash, you need to return a
reference to that hash.

: Is there any way to preserve the tie between packages without calling
: tie on the hash again in package Z?

This works fine for me:

#!/usr/bin/perl -w
use strict;
$|++;

package TieHash;
sub TIEHASH { bless {}, shift }
sub STORE { warn "Keep this empty!\n" }


package X;
our @ISA = 'TieHash';

tie my( %hash ), 'TieHash';
sub gethash { \%hash }


package main;
our @ISA = 'X';

my $newhash = X::gethash();
$newhash->{key} = 'value';


-- 
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'crt@kiski.net',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>



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

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


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