[22212] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4433 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 20 14:11:06 2003

Date: Mon, 20 Jan 2003 11:10:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 20 Jan 2003     Volume: 10 Number: 4433

Today's topics:
    Re: server and client on the same port (Markus Rachbauer)
        SetOption not working (Win32::Internet) <None@None.com>
    Re: split composite hash key into sub key fields. (qanda)
    Re: split composite hash key into sub key fields. <nobull@mail.com>
        Starting with Perl <brian.smart@blueyonder.co.uk>
    Re: Starting with Perl <perl-dvd@darklaser.com>
    Re: Starting with Perl <LaoTzu@TaoTeChing.co.uk.us>
    Re: Starting with Perl <jurgenex@hotmail.com>
    Re: Starting with Perl (Tad McClellan)
    Re: Starting with Perl <LaoTzu@TaoTeChing.co.uk.us>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        storable - typo made script work! <spikey-wan@bigfoot.com>
    Re: storable - typo made script work! <ubl@schaffhausen.de>
    Re: storable - typo made script work! <spikey-wan@bigfoot.com>
    Re: storable - typo made script work! <nobull@mail.com>
    Re: Suggestion: sub mysort(&?@) or (& @) <nobull@mail.com>
    Re: Using domain.com/?query+string and domain.com/index (krakle)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 20 Jan 2003 09:49:01 -0800
From: markus.rachbauer@chello.at (Markus Rachbauer)
Subject: Re: server and client on the same port
Message-Id: <51afb9de.0301200949.104d0f15@posting.google.com>

hi,

sorry, if i described my problem not exactly enough.
i have to write a (perl) script, which sends (over tcp) a reqest (more
exactly a hl7 message, but this is not the problem) from a fixed port
on my machine (let's say machine a, port 9000) to a second machine
(machine b, port 12000). the problem is, that the (response-)data is
send back later (connection is initiated by machine b) and not within
this connection. and the answer is sent back to the clients ip and
port (in this case, my machine a on port 9000). so if i request some
data over my port 9000, i have to start a listening socket on this
port. but as it can happen, that a second request is necessary before
the first response is received, i have to send a message through the
port, where a socket is already listening. when i try this, i get a
"port already in use" error (when try to create the socket, as
expected). is there any workaround to send a message through the same
port where a server is already listening?
i hope,i didn't  forget any important details this time


thanks,

markus


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

Date: Mon, 20 Jan 2003 10:49:40 -0500
From: "Altoid" <None@None.com>
Subject: SetOption not working (Win32::Internet)
Message-Id: <pUUW9.243244$C8.799363@nnrp1.uunet.ca>

Hi all,

Try as I might, I can't seem to get SetOption to work properly with the
options I want. I want to set the INTERNET_OPTION_PROXY* settings (proxy,
username, password). I've googled high and low, but I can't seem to find any
example of SetOption working with these options. Is there anything that I am
missing?

Any suggestions?

My code snippit

   use Win32::Internet;
   my $I = new Win32::Internet();
   $I->SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,12345);
   $I->SetOption(INTERNET_OPTION_PROXY_USERNAME, 'frank');
   $timeout = $I->QueryOption(INTERNET_OPTION_CONNECT_TIMEOUT);
   $username = $I->QueryOption(INTERNET_OPTION_PROXY_USERNAME);
   print "Timeout: $timeout\n";
   print "Username: $username\n";

returns

   C:\frank>perl temp.pl
   Timeout: 12345
   Username:

   C:\frank>






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

Date: 20 Jan 2003 06:23:08 -0800
From: fumail@freeuk.com (qanda)
Subject: Re: split composite hash key into sub key fields.
Message-Id: <62b4710f.0301200623.3e36839a@posting.google.com>

Thanks for the replies, the reason is part of another post that had no
replies, that post was itself a small part of a much larger script. 
Here is a cut down version of a function (with DATA) from the original
 ...

#!/usr/bin/perl

use strict;
use warnings;
dup_chk();

sub dup_chk{
    use Time::Local;

    my %f1_keys;
    my %f2_keys;

    while( <DATA> ) {
        my @flds = split( /,/, $_, -1 );

        $flds[7] += 3;     # Need to modify some fields, add 3 as an
example.
        my $f2 = $flds[2]; # Keep key fields, 2,3,5.
        my $f3 = $flds[3];
        my $f5 = $flds[5];

        my $rec = join ',', @flds; # Re-join split fields after
modifying some.

        # Simulate 2 files using first field of __DATA__ lines.
        if( $flds[0] eq "file1" ) {
            if( exists $f1_keys{$f2,$f3,$f5} ) {
                print STDOUT "Duplicate: $rec";
            }
            else { 
                chomp $rec; 
                $f1_keys{$f2,$f3,$f5} = $rec; # Load unique record.
            }   
        }
        else {
            if( exists $f2_keys{$f2,$f3,$f5} ) {
                print STDOUT "Duplicate: $rec";
            }
            else {
                chomp $rec;
                $f2_keys{$f2,$f3,$f5} = $rec; # Load unique record.
            }   
        }
    }

    print STDOUT "File1 unique recs (key:value):-\n";
    for my $key( keys %f1_keys ) {
        print STDOUT "$key:$f1_keys{$key}\n";
    }
    print STDOUT "File2 unique recs (key:value):-\n";
    for my $key( keys %f2_keys ) {
        print STDOUT "$key:$f2_keys{$key}\n";
    }

    # Resolve records.
    foreach my $key( keys %f1_keys ) {
        if( exists $f2_keys{$key} ) {
            print STDOUT "Resolved:$f1_keys{$key}-$f2_keys{$key}\n";
            delete $f1_keys{$key};
            delete $f2_keys{$key};
        }
        else {  
            print STDOUT "Unresolved file1:$f1_keys{$key}\n";
        }
    }

    # Any records left in f2_keys are unresolved.
    foreach my $key( keys %f2_keys ) {
        print STDOUT "Unresolved file2:$f2_keys{$key}\n";
    }
}

# Cut down version of original records.
=pod
__DATA__
file1,r1,c1,100,f5,200,f7,1,uniq
file1,r2,c2,130,f5,230,f7,3,uniq
file1,r3,c1,120,f5,220,f7,5,uniq
file1,r4,c1,100,f5,200,f7,7,dup_r1
file1,r5,c1,100,f5,210,f7,9,dup_r1
file1,r6,c1,110,f5,200,f7,11,dup_r1
file2,r1,c1,101,f5,202,f7,2,uniq,resolve_r1
file2,r2,c1,119,f5,221,f7,6,uniq,resolve_r3
file2,r3,c2,132,f5,233,f7,4,uniq,resolve_r2
file2,r4,c1,103,f5,201,f7,8,dup_r1
file2,r5,c1,101,f5,207,f7,10,dup_r1
file2,r6,c1,110,f5,203,f7,12,dup_r1
file2,r7,c1,140,f5,223,f7,12,dup_r2
=cut
__DATA__
file1,r1,c1,100,f5,200,f7,1,uniq
file1,r2,c2,130,f5,230,f7,3,uniq
file1,r3,c1,120,f5,220,f7,5,uniq
file1,r4,c1,100,f5,200,f7,7,dup_r1
file2,r1,c1,100,f5,200,f7,2,uniq,resolve_r1
file2,r2,c1,120,f5,220,f7,6,uniq,resolve_r3
file2,r3,c2,130,f5,230,f7,4,uniq,resolve_r2
file2,r4,c1,100,f5,200,f7,8,dup_r1

My problem is that I must now use a range factor for checking fields 4
and 6 in file2 records.  The commented out DATA section shows the data
and desired result if we have a factor of 5.  So in file2 records,
record 4 is a duplicate because field3 matches record1, field 4
plus/minus 5 matches or field 6 plus/minus 5 matches.  This works OK
with the second DATA set as expected because there is no factor
involved, however I wanted help with processing the commented out DATA
section.

Thanks again, looks like I'm using old features - learning all the
time - slowly! :)


Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> wrote in message news:<newscache$r3909h$zxc$1@news.emea.compuware.com>...
> Tassilo v. Parseval wrote (Monday 20 January 2003 09:15):
> 
> > Also sprach Koos Pol:
> > 
> >> qanda wrote (Monday 20 January 2003 08:14):
> >> 
> >>> Hi all
> >>> 
> >>> I have a hash with keys made from several fields, for example
> >>> 
> >>> my %f1_keys;
> >>> ...
> >>> $f1_keys{$f2,$f3,$f5} = $rec;
> >> 
> >> 
> >> This is gibberish. What are trying to do?
> > 
> > It isn't actually gibberish. It is just very old: This idiom dates back
> > to long gone Perl4 days where it was used to emulate multidimensional
> > hashes. $; is used in conjunction with the above.
> 
> 
> Hmm... I've tried some variations on $rec (href, aref, scalar) and inspected 
> %f1_keys with Data::Dumper. And %f1_keys just contained... well... 
> gibberish :-) 
> 
> 
> </study mode>
> (And after Tad made clear that I also need to brush up my version 8 RE's 
> (some other thread) I'll ignore the request to backlearn Perl4 :-).
> <study mode>  # yes, I deliberately reversed them :-)
> 
> 
> Cheers,


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

Date: 20 Jan 2003 18:15:14 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: split composite hash key into sub key fields.
Message-Id: <u98yxfadsd.fsf@wcl-l.bham.ac.uk>

fumail@freeuk.com (qanda) writes:

> Thanks for the replies,

If you do not want to quote replies then that's maybe OK in this context.

But quoting the entirity of the post to which you are replying at the
end of your post (TOFU) will be considered to be rudeness.

Note: I'm not going to address things in the order you posted...

>         if( $flds[0] eq "file1" ) {
>             if( exists $f1_keys{$f2,$f3,$f5} ) {
>                 print STDOUT "Duplicate: $rec";
>             }
>             else { 
>                 chomp $rec; 
>                 $f1_keys{$f2,$f3,$f5} = $rec; # Load unique record.
>             }   
>         }
>         else {
>             if( exists $f2_keys{$f2,$f3,$f5} ) {
>                 print STDOUT "Duplicate: $rec";
>             }
>             else {
>                 chomp $rec;
>                 $f2_keys{$f2,$f3,$f5} = $rec; # Load unique record.
>             }   
>         }

If you find yourself writing exactly the same code multiple times
then you should realise that you probably need another level of abstraction.

            if( exists $keys{$flds[0]}{$f2,$f3,$f5} ) {
                print STDOUT "Duplicate: $rec";
            }
            else { 
                chomp $rec; 
                $keys{$flds[0]}{$f2,$f3,$f5} = $rec; # Load unique record.
            }   


[ attempting to put stuff back in context ] fumail@freeuk.com (qanda) writes:

> Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> wrote in message news:<newscache$r3909h$zxc$1@news.emea.compuware.com>...
> > Tassilo v. Parseval wrote (Monday 20 January 2003 09:15):
> > 
> > > Also sprach Koos Pol:
> > > 
> > >> qanda wrote (Monday 20 January 2003 08:14):
> > >> 
> > >>> $f1_keys{$f2,$f3,$f5} = $rec;
> > >> 
> > >> This is gibberish. What are trying to do?
> > > 
> > > It isn't actually gibberish. It is just very old: This idiom dates back
> > > to long gone Perl4 days where it was used to emulate multidimensional
> > > hashes. $; is used in conjunction with the above.

> Thanks for the replies, the reason is part of another post that had no
> replies, that post was itself a small part of a much larger script. 

> Thanks again, looks like I'm using old features - learning all the
> time - slowly! :)


> My problem is that I must now use a range factor for checking fields 4
> and 6 in file2 records.  The commented out DATA section shows the data
> and desired result if we have a factor of 5.

The commented-out DATA section would be:

> __DATA__
> file1,r1,c1,100,f5,200,f7,1,uniq
> file1,r2,c2,130,f5,230,f7,3,uniq
> file1,r3,c1,120,f5,220,f7,5,uniq
> file1,r4,c1,100,f5,200,f7,7,dup_r1
> file1,r5,c1,100,f5,210,f7,9,dup_r1
> file1,r6,c1,110,f5,200,f7,11,dup_r1
> file2,r1,c1,101,f5,202,f7,2,uniq,resolve_r1
> file2,r2,c1,119,f5,221,f7,6,uniq,resolve_r3
> file2,r3,c2,132,f5,233,f7,4,uniq,resolve_r2
> file2,r4,c1,103,f5,201,f7,8,dup_r1
> file2,r5,c1,101,f5,207,f7,10,dup_r1
> file2,r6,c1,110,f5,203,f7,12,dup_r1
> file2,r7,c1,140,f5,223,f7,12,dup_r2

How do you mean that this shows the desired output?

>  So in file2 records,
> record 4 is a duplicate because field3 matches record1, field 4
> plus/minus 5 matches or field 6 plus/minus 5 matches.  This works OK
> with the second DATA set as expected because there is no factor
> involved, however I wanted help with processing the commented out DATA
> section.

You really are seriously failing to express what you want clearly.

I can, actually, work out what you want - but I think it is mostly
your inability to express your requirments that is preventing you
expressing those requirements in Perl.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 20 Jan 2003 17:27:30 -0000
From: "Brian Smart" <brian.smart@blueyonder.co.uk>
Subject: Starting with Perl
Message-Id: <7cWW9.11712$SX4.4468@news-binary.blueyonder.co.uk>

Hello all,
I am just starting with Perl. Can anybody help me to get started. I am using
a Windows2000 m/c and want to run a script from a web page. As is usual with
a beginer, although I have followed the instructions, regarding where to put
the script, and to make it executable, it doesn't work. The script should
print "Hello world" (Very original) but all I get is a page from the server
saying : You do not have permission to access the requested file on this
server.

I can obviously supply any information that my ignorance has stopped me
providing with this request.

Any help will be much appreciated.

regards

Brian Smart





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

Date: Mon, 20 Jan 2003 17:32:40 GMT
From: "David" <perl-dvd@darklaser.com>
Subject: Re: Starting with Perl
Message-Id: <YoWW9.9$EZ2.12815@news-west.eli.net>

"Brian Smart" <brian.smart@blueyonder.co.uk> wrote in message
news:7cWW9.11712$SX4.4468@news-binary.blueyonder.co.uk...
> Hello all,
> I am just starting with Perl. Can anybody help me to get started. I am
using
> a Windows2000 m/c and want to run a script from a web page. As is
usual with
> a beginer, although I have followed the instructions, regarding where
to put
> the script, and to make it executable, it doesn't work. The script
should
> print "Hello world" (Very original) but all I get is a page from the
server
> saying : You do not have permission to access the requested file on
this
> server.
>
> I can obviously supply any information that my ignorance has stopped
me
> providing with this request.
>
> Any help will be much appreciated.

    There are a few things I would check initially.  Make sure your web
server is allowing you to run perl scripts.  Make sure you have Perl on
your machine.  Make sure your perl script is printing a good content
type.  Make sure the perl script works (no errors).
    If you have perl installed correctly on your machine, you should be
able to open a cmd and run the script from the command line.  If that
works, then you probably did not print the content type correctly or,
you have a mis-config in your web server.

Good Luck,
David




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

Date: Mon, 20 Jan 2003 12:54:23 -0500
From: "Lao Tzu" <LaoTzu@TaoTeChing.co.uk.us>
Subject: Re: Starting with Perl
Message-Id: <PvWW9.25739$F_3.5126@news.bellsouth.net>


"Brian Smart" <brian.smart@blueyonder.co.uk> wrote in message
news:7cWW9.11712$SX4.4468@news-binary.blueyonder.co.uk...
> Hello all,
> I am just starting with Perl. Can anybody help me to get started. I am
using
> a Windows2000 m/c and want to run a script from a web page. As is usual
with
> a beginer, although I have followed the instructions, regarding where to
put
> the script, and to make it executable, it doesn't work. The script should
> print "Hello world" (Very original) but all I get is a page from the
server
> saying : You do not have permission to access the requested file on this
> server.
>
> I can obviously supply any information that my ignorance has stopped me
> providing with this request.
>
> Any help will be much appreciated.
>
> regards
>
> Brian Smart
>
>

I am almost positive that the error you get when you try to access that
script, has little to do with your script at all.  I would be willing to bet
that the problem is with your http server configuration.  A quick search on
google.com will return a nice looking tutorial that should help you out.  I
will not vouch for its accuracy, I just took a quick glance and it looks ok.

Good luck.





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

Date: Mon, 20 Jan 2003 18:08:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Starting with Perl
Message-Id: <IWWW9.483$PR2.402@nwrddc02.gnilink.net>

Brian Smart wrote:
> I am just starting with Perl. Can anybody help me to get started. I
> am using a Windows2000 m/c and want to run a script from a web page.

Stop right here. Perl and web pages have nothing to do with each other.
The first is a universal programming language, the other is a document
written in [D]HTML.

Of course you can use any programming language (including Perl) to generate
a file which contains HTML. Or you can use any programming language to
return the proper response to a CGI web server. But that is one or two
additional layers of complexity.

You said that you are new to Perl.
Well, can we assume that you are familiar with
- HTML? and maybe DHTML?
- CGI programming?
Because those areas are separate from and have nothing to do with Perl.

Ok, now: "Running a script from a web page". Taking this literally I would
assume that you were trying to run a script on the client when the browser
renders some HTML page.
While there is a PerlScript it is limited to IE only. And the user will have
to install PerlScript first.
Therefore I suggest to look for other solutions, most notably JavaScript.

> As is usual with a beginer, although I have followed the
> instructions, regarding where to put the script, and to make it
> executable, it doesn't work. The script should print "Hello world"
> (Very original) but all I get is a page from the server saying : You
> do not have permission to access the requested file on this server.
>
> I can obviously supply any information that my ignorance has stopped
> me providing with this request.

Assuming you are talking about a CGI script (you negleted to tell us): Does
your script produce the desired output (that is the desired HTML content
plus the proper header) when run from the command line?
If yes, then you don't have a Perl problem. For further information please
see PerlFAQ9:
      My CGI script runs from the command line but not the browser.

If it doesn't produce the desired output then please show us the script
(reduced to a minimal example that still reproduces the problem), explain
the desired output, and chances are someone here will be able to fix it.

jue




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

Date: Mon, 20 Jan 2003 12:13:08 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Starting with Perl
Message-Id: <slrnb2of1k.q5v.tadmc@magna.augustmail.com>

Brian Smart <brian.smart@blueyonder.co.uk> wrote:

> I am just starting with Perl. Can anybody help me to get started. I am using
> a Windows2000 m/c and want to run a script from a web page. 


The absolutely best way to get started with Perl is NOT to
get a script running from a web page!    :-)

Run the program from a command line first, see if its output
looks right, then move it to a web server.


> As is usual with
> a beginer, although I have followed the instructions, regarding where to put
> the script, and to make it executable, it doesn't work. The script should
> print "Hello world" (Very original) but all I get is a page from the server
> saying : You do not have permission to access the requested file on this
> server.


If you had chosen to write your CGI program in Python or Java or
Visual Basic, you would have gotten the same error message.

It is not a Perl problem.

It is a web server configuration problem.

Questions about WWW stuff should be asked in a newsgroup that cares
about WWW stuff, such as:

      comp.infosystems.www.authoring.cgi
      comp.infosystems.www.servers.ms-windows


> Any help will be much appreciated.


1) Learn Perl from the command line, not in a CGI environment.

2) Type this at the command line:

   perldoc -q CGI

      "Where can I learn about CGI or Web programming in Perl?"

      "What is the correct form of response from a CGI script?"

      "My CGI script runs from the command line but not the
       browser.  (500 Server Error)"

      "How can I get better error messages from a CGI program?"

      "How do I make sure users can't enter values into a form
       that cause my CGI script to do bad things?"

      "How do I decode a CGI form?"


But none of that will help until after you get your web server
configured correctly.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 20 Jan 2003 13:25:25 -0500
From: "Lao Tzu" <LaoTzu@TaoTeChing.co.uk.us>
Subject: Re: Starting with Perl
Message-Id: <XYWW9.25883$F_3.19709@news.bellsouth.net>


"Lao Tzu" <LaoTzu@TaoTeChing.co.uk.us> wrote in message
news:PvWW9.25739$F_3.5126@news.bellsouth.net...
>
> "Brian Smart" <brian.smart@blueyonder.co.uk> wrote in message
> news:7cWW9.11712$SX4.4468@news-binary.blueyonder.co.uk...
> > Hello all,
> > I am just starting with Perl. Can anybody help me to get started. I am
> using
> > a Windows2000 m/c and want to run a script from a web page. As is usual
> with
> > a beginer, although I have followed the instructions, regarding where to
> put
> > the script, and to make it executable, it doesn't work. The script
should
> > print "Hello world" (Very original) but all I get is a page from the
> server
> > saying : You do not have permission to access the requested file on this
> > server.
> >
> > I can obviously supply any information that my ignorance has stopped me
> > providing with this request.
> >
> > Any help will be much appreciated.
> >
> > regards
> >
> > Brian Smart
> >
> >
>
> I am almost positive that the error you get when you try to access that
> script, has little to do with your script at all.  I would be willing to
bet
> that the problem is with your http server configuration.  A quick search
on
> google.com will return a nice looking tutorial that should help you out.
I
> will not vouch for its accuracy, I just took a quick glance and it looks
ok.
>
> Good luck.
>

Doh! I forgot to include the URL
http://perl.xotechnologies.net/tutorials/IIS/IIS.htm





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

Date: Mon, 20 Jan 2003 14:25:37 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <v2o1n1gejiq06a@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 13 Jan 2003 14:24:55 GMT and ending at
20 Jan 2003 13:55:57 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) 2003 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
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com

Totals
======

Posters:  236
Articles: 783 (305 with cutlined signatures)
Threads:  180
Volume generated: 1583.0 kb
    - headers:    695.6 kb (13,090 lines)
    - bodies:     840.5 kb (27,260 lines)
    - original:   521.3 kb (18,063 lines)
    - signatures: 46.2 kb (1,120 lines)

Original Content Rating: 0.620

Averages
========

Posts per poster: 3.3
    median: 2.0 posts
    mode:   1 post - 105 posters
    s:      5.6 posts
Posts per thread: 4.3
    median: 3.0 posts
    mode:   1 post - 41 threads
    s:      4.2 posts
Message size: 2070.2 bytes
    - header:     909.7 bytes (16.7 lines)
    - body:       1099.2 bytes (34.8 lines)
    - original:   681.7 bytes (23.1 lines)
    - signature:  60.4 bytes (1.4 lines)

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

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

   55   138.8 ( 64.0/ 67.3/ 49.4)  tadmc@augustmail.com
   31    57.3 ( 23.2/ 34.1/ 16.4)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   28    61.7 ( 23.8/ 37.9/ 15.8)  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
   27    56.5 ( 22.6/ 28.6/ 16.2)  Benjamin Goldberg <goldbb2@earthlink.net>
   22    38.7 ( 21.9/ 12.7/  7.5)  "Harald H.-J. Bongartz" <bongie@gmx.net>
   21    31.5 ( 18.7/ 12.8/  6.8)  "Jürgen Exner" <jurgenex@hotmail.com>
   17    33.9 ( 15.1/ 17.6/ 10.3)  Brian McCauley <nobull@mail.com>
   16    41.4 ( 16.4/ 20.2/  8.7)  Uri Guttman <uri@stemsystems.com>
   13    29.4 ( 12.5/ 14.3/  5.9)  tassilo.parseval@post.rwth-aachen.de
   12    19.7 ( 11.7/  7.9/  3.4)  Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>

These posters accounted for 30.9% of all articles.

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

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

 138.8 ( 64.0/ 67.3/ 49.4)     55  tadmc@augustmail.com
  61.7 ( 23.8/ 37.9/ 15.8)     28  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
  57.3 ( 23.2/ 34.1/ 16.4)     31  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  56.5 ( 22.6/ 28.6/ 16.2)     27  Benjamin Goldberg <goldbb2@earthlink.net>
  41.4 ( 16.4/ 20.2/  8.7)     16  Uri Guttman <uri@stemsystems.com>
  38.7 ( 21.9/ 12.7/  7.5)     22  "Harald H.-J. Bongartz" <bongie@gmx.net>
  33.9 ( 15.1/ 17.6/ 10.3)     17  Brian McCauley <nobull@mail.com>
  33.3 (  2.1/ 29.1/ 26.9)      2  Thomas Mellman <thomas@mellman.net>
  31.5 ( 18.7/ 12.8/  6.8)     21  "Jürgen Exner" <jurgenex@hotmail.com>
  30.0 ( 13.6/ 16.0/ 11.3)     12  "Alan J. Flavell" <flavell@mail.cern.ch>

These posters accounted for 33.0% of the total volume.

Top 10 Posters by Volume of Original Content (min. five posts)
==============================================================

        (kb)
Posts   orig  Address
-----  -----  -------

   55   49.4  tadmc@augustmail.com
   31   16.4  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   27   16.2  Benjamin Goldberg <goldbb2@earthlink.net>
   28   15.8  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
   12   11.3  "Alan J. Flavell" <flavell@mail.cern.ch>
   17   10.3  Brian McCauley <nobull@mail.com>
   16    8.7  Uri Guttman <uri@stemsystems.com>
    9    8.2  mgjv@tradingpost.com.au
    9    8.2  "Richard S Beckett" <spikey-wan@bigfoot.com>
    8    7.8  "Neil Trenholm" <neil@alaweb.com>

These posters accounted for 29.2% of the original volume.

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

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

0.967  (  4.6 /  4.8)      6  abigail@abigail.nl
0.848  (  5.1 /  6.0)      7  Bart Lateur <bart.lateur@pandora.be>
0.828  (  1.1 /  1.3)      6  ZZT <a@b.c>
0.813  (  2.1 /  2.5)      5  "Jeff Snoxell" <Jeff@aetherweb.co.uk>
0.781  (  8.2 / 10.4)      9  "Richard S Beckett" <spikey-wan@bigfoot.com>
0.734  ( 49.4 / 67.3)     55  tadmc@augustmail.com
0.710  (  2.2 /  3.1)      5  Marek Zawadzki <mzawadzk@man.poznan.pl>
0.708  ( 11.3 / 16.0)     12  "Alan J. Flavell" <flavell@mail.cern.ch>
0.685  (  2.3 /  3.3)      5  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
0.674  (  2.0 /  2.9)      5  Michele Dondi <bik.mido@tiscalinet.it>

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

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

0.432  (  8.7 / 20.2)     16  Uri Guttman <uri@stemsystems.com>
0.431  (  3.4 /  7.9)     12  Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
0.417  ( 15.8 / 37.9)     28  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
0.415  (  5.9 / 14.3)     13  tassilo.parseval@post.rwth-aachen.de
0.415  (  1.0 /  2.5)      5  helgi@decode.is
0.403  (  1.7 /  4.2)      5  Cameron Dorey <camerond@mail.uca.edu>
0.397  (  1.3 /  3.2)      6  istink <istink@real.bad.com>
0.381  (  3.9 / 10.2)      6  Kevin Newman <knewman00@earthlink.net>
0.315  (  3.6 / 11.3)      7  Andrew Allaire <Andrew.Allaire@na.teleatlas.com>
0.311  (  4.0 / 12.9)     11  Michael Budash <mbudash@sonic.net>

37 posters (15%) had at least five posts.

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

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

   22  Question about high performance spidering in perl
   18  sysopen problem
   15  security of open(TAR, "tar -cvf - $filelist|")
   14  How to execute a perl script from within a perl script and return info
   13  most popular unix scripting language
   12  Extraction from variable
   11  My, our, etc.
   11  How to delete leading&trailing spaces&tabs at once?
   11  hard
   10  Is logic in regular expression possible?

These threads accounted for 17.5% of all articles.

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

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

  51.5 ( 20.3/ 29.3/ 15.8)     22  Question about high performance spidering in perl
  37.1 ( 14.0/ 22.8/ 12.4)     18  sysopen problem
  36.1 (  3.0/ 30.9/ 27.8)      3  auto vs. ARCH vs. 5.005 vs. 5.00503 vs. site_perl etc. etc. etc
  33.9 ( 16.0/ 17.0/  7.4)     14  How to execute a perl script from within a perl script and return info
  30.7 ( 14.4/ 15.2/  8.0)     15  security of open(TAR, "tar -cvf - $filelist|")
  29.1 (  9.3/ 19.3/  9.6)     10  command-line args style flags from a file
  26.1 (  0.9/ 25.3/ 25.3)      1  The Year In Scripting Languages  Lua/Perl/Python/Ruby/Tcl 2002
  25.5 ( 10.0/ 15.1/  7.6)     11  My, our, etc.
  24.5 ( 13.0/  9.9/  4.7)     13  most popular unix scripting language
  21.7 (  8.9/ 12.1/  4.2)     10  Variable naming convention

These threads accounted for 20.0% of the total volume.

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

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

0.890  (  3.6/   4.1)      5  comment multiple lines
0.840  (  3.7/   4.4)      5  How are named unary operators that take $_ created?
0.819  (  3.8/   4.6)      5  Code-page Browser Output
0.773  (  1.2/   1.6)      6  parse email from /var/spool/mail/username
0.739  (  6.1/   8.2)      8  got me foxed
0.703  (  4.8/   6.8)      7  compare variable with next variable in a loop
0.702  (  7.6/  10.9)      8  regex newbie
0.695  (  2.2/   3.2)      5  Image::Magick for Activestate 5.8.0 (Win32)
0.690  (  2.0/   2.8)      7  ~ Urgently require a Webpage Hit counter script !!??~
0.688  (  3.2/   4.7)      6  Using domain.com/?query+string and domain.com/index.cgi?query+string...

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

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

0.438  (  7.4 / 17.0)     14  How to execute a perl script from within a perl script and return info
0.436  (  3.7 /  8.5)      6  Suggestions for counter
0.425  (  2.1 /  4.9)      6  FAQ: How do I convert between numeric representations?
0.409  (  4.0 /  9.8)     10  Outputting a binary file to the browser
0.396  (  3.0 /  7.6)      8  DBI::rows reliability on SELECT statements
0.393  (  4.1 / 10.4)      7  The "default thing"
0.355  (  3.6 / 10.1)     10  Arrays. What don't I get?
0.345  (  4.2 / 12.1)     10  Variable naming convention
0.329  (  2.0 /  6.2)      8  Recompile Perl with CPAN?
0.279  (  0.9 /  3.3)      5  finding largest repeat values in array

67 threads (37%) had at least five posts.

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

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

      19  alt.perl
      16  comp.lang.perl.modules
      14  comp.lang.tcl
      10  comp.lang.rexx
       8  comp.lang.ruby
       6  de.comp.lang.perl.misc
       6  comp.infosystems.www.authoring.cgi
       6  comp.lang.basic.visual.misc
       5  tw.bbs.comp.lang.perl
       5  fr.comp.lang.perl

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

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

       8  Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca>
       7  Benjamin Goldberg <goldbb2@earthlink.net>
       6  lvirden@yahoo.com
       5  Jan Korger <QSPDVOFMGTUJ@spammotel.com>
       5  pauli@johannes-pauli.de
       5  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
       5  "oooooops" <oooooops@163.com>
       5  Michele Dondi <bik.mido@tiscalinet.it>
       4  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
       4  Marek Zawadzki <mzawadzk@man.poznan.pl>


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

Date: Mon, 20 Jan 2003 13:51:19 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: storable - typo made script work!
Message-Id: <b0guuc$mc4$1@newshost.mot.com>

Guys,

I'd been struggling to save %vars to a file using storable, and successfully
recover them. I wrote this script, and tried various combinations to get the
retrieve to work. Finally it started working, and when I looked at why, I'd
made a typo, but it made it work!

Am I doing it right, or is it working for another reason?

If you run this script twice, the second time it loads the saved values.

Thanks.

R.

use strict;
use warnings;
use Storable;
my (%vars, $vars, $ref, %ref);

# Load saved variables, or use default values.
$ref = retrieve 'saved.dat' if -e 'saved.dat';

if ($ref) {
   print "Saved values found.\n";
   %vars = %$ref; #  This line works,
#   %vars = $ref; # These don't
#   %vars = %ref; # work.
}
else {
   print "Using defaults.\n";
 %vars = (
  dog_name => ["Please enter your dog's name: ", "Rover"],
  fav_food => ["What is your favourite food? ",  "Cheese"],
  testicles => ["How many testicles do you have? ", 3],
  fear => ["What is your biggest fear? ", "Elephants"],
  );
}

foreach (keys(%vars)) {
 my $key = $_;
 print "$vars{$key}[0]\n";
 print "You said $vars{$key}[1]\n";

 if ($vars{$_}[1] eq "Rover") {print "I've got a dog called Rover!\n\n";}
 else {print "Our survey said \"UU UUUUUGH!\"\n\n";}

}

store \%vars, 'saved.dat' or die "store failed: $!";
print "Save complete.\n";




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

Date: Mon, 20 Jan 2003 15:47:36 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: storable - typo made script work!
Message-Id: <b0h5e9$b4m$1@news.dtag.de>

Richard S Beckett wrote:
> Guys,
> 
> I'd been struggling to save %vars to a file using storable, and successfully
> recover them. I wrote this script, and tried various combinations to get the
> retrieve to work. Finally it started working, and when I looked at why, I'd
> made a typo, but it made it work!

> if ($ref) {
>    print "Saved values found.\n";
>    %vars = %$ref; #  This line works,
> #   %vars = $ref; # These don't
> #   %vars = %ref; # work.

There is no typo. %ref and $ref are completely different variables. 
%$ref dereferences the hash ref which happens to be inside $ref.

The two other lines do work, too.
%vars = $ref
stores $vars{$ref} = undef;
%vars = %ref;
copies the contents of %ref to %vars which happen to be empty.

Bye,
->malte



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

Date: Mon, 20 Jan 2003 15:35:33 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: storable - typo made script work!
Message-Id: <b0h51r$oqb$1@newshost.mot.com>

> There is no typo. %ref and $ref are completely different variables.
> %$ref dereferences the hash ref which happens to be inside $ref.
>
> The two other lines do work, too.
> %vars = $ref
> stores $vars{$ref} = undef;
> %vars = %ref;
> copies the contents of %ref to %vars which happen to be empty.

Ah, so if some time earlier, I did this...

 store \%vars, 'saved.dat';

Is the correct way to get the values back from the file and into %vars...?

$ref = retrieve 'saved.dat';
%vars = %$ref;

I didn't know about %$, and there's no mention of it in my books.

Thanks.

R.




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

Date: 20 Jan 2003 18:52:41 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: storable - typo made script work!
Message-Id: <u9vg0j8xhi.fsf@wcl-l.bham.ac.uk>

"Richard S Beckett" <spikey-wan@bigfoot.com> writes:

>  store \%vars, 'saved.dat';

> $ref = retrieve 'saved.dat';
> %vars = %$ref;
> 
> Is the correct way to get the values back from the file and into %vars...?

The "correct way" is not to want to do so in the first place.

If you want to copy %$ref to %vars that's the way to do it.

Better still work directly with $ref and avoid the copy.
 
> I didn't know about %$, and there's no mention of it in my books.

Dereferencing ("using") Perl references is explained in the section
"Using References" in the manual "perldoc perlref".

The syntax %$ref is syntax number 1, the first one it explains.

Don't treat your books as a replacement for the standard reference
manuals.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 20 Jan 2003 18:37:23 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Suggestion: sub mysort(&?@) or (& @)
Message-Id: <u94r83acrg.fsf@wcl-l.bham.ac.uk>

Daniel Pfeiffer <occitan@esperanto.org> writes:

> Daniel Pfeiffer <occitan@esperanto.org> skribis:
> 
> > it is inconsistent that functions like sort can have an optional first code
> > block, while if I declare mysort(&@) it becomes mandatory.  Having to pass
> > undef as first argument, when you don't want it, is ugly.  And having to put
> > a comma, beacause it's not a code block is also inconsistent with sort.
> 
> > Now, if we could have a prototype like above (I don't care how, ? is as in
> > regexps, ' ' is because, if it's there, it has to be followed by a space, not
> > a comma, then this function would work like the original:
> 
> > @list = mysort { ... } @list;
> > @list = mysort $subref @list;
> > @list = mysort @list;
> 
> > The parser can already handle it, and it wouldn't break any compatibility.
> 
> Actually  grep /.../, @list  and  map "add $_ some", @list  are also
> inconsistent, because the first argument is a hidden code ref.  So, there
> should be no comma!  I believe the comma should be deprecated.

There is a hidden coderef but I disagree that the comma should be made
optional.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 20 Jan 2003 07:28:18 -0800
From: krakle@visto.com (krakle)
Subject: Re: Using domain.com/?query+string and domain.com/index.cgi?query+string...
Message-Id: <237aaff8.0301200728.78395cb4@posting.google.com>

mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow) wrote in message news:<b0fjaj$apg$1@wisteria.csv.warwick.ac.uk>...
> 
> In particular, do you have DirectoryIndex index.cgi set on /test? I suspect
> not...

Why would you suspect not? Did you not read my post? I said going to
that directory WILL bring up the index.cgi successfully but appending
the query string to the end of the directory holding the index.cgi
script will not pass the query string to the script. However server #1
does.

> 
> This is Not A Perl Question.
> 
> Ben

If you read my post you would see that I clearly addressed it wasn't
and I even appologized for being off topic.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4433
***************************************


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