[8837] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2454 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 29 12:07:39 1998

Date: Wed, 29 Apr 98 09:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 29 Apr 1998     Volume: 8 Number: 2454

Today's topics:
    Re: $100 - PERL NEWSGROUP POSTER <doellkendv@compuserve.com>
    Re: 1701 days hath September (was: Re: rename funciton) <sowmaster@juicepigs.com>
    Re: == vs. eq (Kevin Reid)
    Re: a way to remove files? <pdcawley@bofh.org.uk>
    Re: a way to remove files? <pdcawley@bofh.org.uk>
    Re: ANNOUNCE: Perl Builder IDE Now Available (Dr. Fridemar Pache)
    Re: ANNOUNCE: Perl Builder IDE Now Available (Dr. Fridemar Pache)
    Re: ANSI Colour in Perl (Shawn )
        backreferencing trouble <seo@sorona.se>
        Can't open shared library (Richard Tomasso)
        can't see CPAN page!!! <tw96@email.msn.com>
    Re: Date of last change of any file (John Porter)
    Re: Dateinamen + Datum letzte Aenderung <bmb@ginger.libs.uga.edu>
    Re: Email Authentication (John Porter)
    Re: file comparison (Hunter Johnson)
        How Can I Check Return Codes on Net::FTP calls? <zahrndtj@agcs.com>
    Re: How to find the number of matches in a string (Mark-Jason Dominus)
    Re: How to find the number of matches in a string (Mark-Jason Dominus)
    Re: Initializing hash with null array: which is best? (John Porter)
    Re: makemake, makedepend, etc... (Matthew H. Gerlach)
    Re: msql <brianm@kodak.com>
        Named Pipes (FIFOs) ... <aqumsieh@matrox.com>
        Perl for Win32 not writing to file <gilberto@locaweb.com.br>
        Perl for WindowsNT <aaa@dms2.com>
        Perl for WindowsNT <aaa@dms2.com>
    Re: Permutations in hashes make Perl hurt (John Porter)
    Re: Print Currency (John Porter)
    Re: print($b=1,$b=2) <cnwetzel@linguistik.uni-erlangen.de>
    Re: print($b=1,$b=2) <p-fein@uchicago.edu>
    Re: rename funciton (was: Re: Dummie question) (John Porter)
    Re: Syntax to make my hit counter work? (Kevin Reid)
    Re: warnings and Getopt::Std (Johan Vromans)
    Re: where are the examples in the newer (blue) camel bo <grinch@whoville.com>
        Windows/NT, Perl, and redirection <mikeg@slpma8.ed.ray.com>
    Re: You people want Perl to be popular? (Chris Nandor)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 29 Apr 1998 10:08:56 +0200
From: "Jochen Gaeng" <doellkendv@compuserve.com>
Subject: Re: $100 - PERL NEWSGROUP POSTER
Message-Id: <uyJn8a0c9GA.323@nih2naab.prod2.compuserve.com>

APPLAUSE to lvirden@cas.org ! !
jochen

lvirden@cas.org schrieb in Nachricht <6ht5dq$koo$1@srv38s4u.cas.org>...

According to Alexander Kovalenko  <luckycom@ica.net>:
:willing to pay for program which would work like formmail , but not send
:e-mail , but rather post it to newsgroups..
:
:if you can help me... reply back...
:

You want to pay a hundred bucks for a program to fill newsgroups up
with form letters?

I suspect someone would come up with a couple hundred to stop you...
--
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.




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

Date: Wed, 29 Apr 1998 11:00:52 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <354740A4.573B@juicepigs.com>

Calle Dybedahl wrote:
> 
> Lloyd Zusman <ljz@asfast.com> writes:
> 
> > But now that we've been enlightened, I'm disappointed to find that
> > it's just more gratuitous anti-"newbie" snobbery.
> 
> "Gratuitous"? If you'd been there you'd know the difference, boy.
> Abigail is absolutely right.


I have been on the net and contributing to USENET for over 10 years and
yes it has changed but who's to say whether it is for the better or the
worse?  The September date really makes no sense when talking about AOL.
Anyone that has been around long enough knows that newbies are at their
worst right after Christmas when a lot of clueless people get a computer
as a present.

Change happens and all you can do is enjoy it. If it weren't for change,
Abigail would be raising 18 children and cleaning the outhouse while her
husband was out hunting for dinner. And Australia would still be a
British penal colony.

-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Wed, 29 Apr 1998 10:28:07 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: == vs. eq
Message-Id: <1d88l6t.1eln4fus1rfjkN@slip-32-100-246-240.ny.us.ibm.net>

Jason Gloudon <jgloudon@hyssop.bbn.com.bbn.com> wrote:

> Greg Bacon <gbacon@cs.uah.edu> wrote:
> >Greg
> >-- 
> >open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
> >f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
> >d2ac158c84c4ece4d22d1000118a8d5491000000
> >EOF
> 
> You should use Compress::Zlib. :).

Greg, 

Please do. I would like to be able to run your signature under MacPerl.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.
-------------------+----------------------
sub AUTOLOAD {join+"",reverse+split//,$_
[0].q. ..($AUTOLOAD =~ /^.*::(.*)$/)[0]}
print tsuJ(qq)\n).hacker(rehtona(lreP)))


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

Date: 29 Apr 1998 16:44:15 +0200
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: a way to remove files?
Message-Id: <s7pd8e0g01s.fsf@surion.elsevier.nl>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, shane michael harwood <sharwood@cs.uiowa.edu> writes:
> :is there a way from within a perl script to remove files?
> 
> I wish I knew why no one ever reads the perlfunc manpage.

It's got to be either sheer bloody mindedness or plain old supidity.
Or maybe both.

-- 
Piers Cawley
Where is the life we have lost in living?
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? -- T. S. Eliot. 


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

Date: 29 Apr 1998 16:44:26 +0200
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: a way to remove files?
Message-Id: <s7pbttkg01h.fsf@surion.elsevier.nl>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, shane michael harwood <sharwood@cs.uiowa.edu> writes:
> :is there a way from within a perl script to remove files?
> 
> I wish I knew why no one ever reads the perlfunc manpage.

It's got to be either sheer bloody mindedness or plain old stupidity.
Or maybe both.

-- 
Piers Cawley
Where is the life we have lost in living?
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? -- T. S. Eliot. 


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

Date: Wed, 29 Apr 1998 15:46:08 GMT
From: dr.pc@t-online.de (Dr. Fridemar Pache)
Subject: Re: ANNOUNCE: Perl Builder IDE Now Available
Message-Id: <6i7hj4$698$1@rznews.rrze.uni-erlangen.de>

"Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> wrote:

>I was able to get the download started by opening up the parent
>directory in IE4 (ftp://ftp13.pair.com/pub/solnsoft) and clicking on the
>link to PerlBuilder.exe. Maybe that would work for you . . .

>-- Creede
Thank you Creede,

although I had done your parent approach earlier, I redid it and again
I didn't get any access with the message:
'
Forbidden
You don't have permission to access ftp://ftp13.pair.com/pub/solnsoft
on this server.
'
Trying to figure out the cause:
my host-site: 'www.gunnet.baynet.de'  could easily lead to the
impression, that it is a military site, what it is not:
'gunnet' contains the abbreviation of a small peaceful and romantic
town in Germany (Gunzenhausen) and has nothing to do with 'guns'.
Perhaps some peace-orientied filter-program prevents my access:-)
 




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

Date: Wed, 29 Apr 1998 15:54:35 GMT
From: dr.pc@t-online.de (Dr. Fridemar Pache)
Subject: Re: ANNOUNCE: Perl Builder IDE Now Available
Message-Id: <6i7i2u$7kk$1@rznews.rrze.uni-erlangen.de>

Dear solutionsoft-team:

please help me, to get solved the download-problem with your
ftp-server.
I posted the following message in the perl newsgroup, that contained
your announcement. Nobody else seems to have that download problem.
Or do I share this problem with other readers of this newsgroup?

S 
Fridemar

>I was able to get the download started by opening up the parent
>directory in IE4 (ftp://ftp13.pair.com/pub/solnsoft) and clicking on the
>link to PerlBuilder.exe. Maybe that would work for you . . .

>-- Creede
>> Thank you Creede ...

>>although I had done your parent approach earlier, I redid it and again
>>I didn't get any access ..




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

Date: Wed, 29 Apr 1998 15:33:56 GMT
From: sweiner@usa.net (Shawn )
Subject: Re: ANSI Colour in Perl
Message-Id: <354747e0.928813@news.wwa.com>

On 11 Apr 1998 11:42:30 GMT, avatar@ultra.net.au (Karl Hanmore) was
forced by space aliens to write:

>G'Day,
>	I was wondering if anyone knows of any code / modules for printing
> ANSI colour in Perl.  I have had a snoop through CPAN to no avail, and I
> really want to avoid re-inventing the wheel.   Anyone got any ideas? 
> If so, can you email me, as I rarely have time to read newsgroups :)
>
>Regards,
>	Karl
>
There is at least 1 module in CPAN that I know of, located I believe
in the user interfaces area.
The name of the module is: ANSIColor-1_01.tar.gz

I don't know the rules about posting here, so I'll only give the
reference in deference to any rules about posting binaries.


Shawn
 
shawn@wwa.com
shawns@wwa.com   
sweiner@usa.net   
slweiner@juno.com
sweiner@yahoo.com
IrunWulf@aol.com
ICQ#1925117 (visit www.mirabilis.com for more info)


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

Date: Wed, 29 Apr 1998 16:11:03 +0200
From: "Andreas Olsson" <seo@sorona.se>
Subject: backreferencing trouble
Message-Id: <354734a8.0@d2o26.telia.com>

Why doesn't $idobj hold the number of substitutions instead of the text
within the parentethies in the following code?

($idobj) = $srcobj =~ s#<OBJSRC$id>(.*?)</OBJSRC$id>##s;


But here it's correct.

($idobj) = $srcobj =~ m#<OBJSRC$id>(.*?)</OBJSRC$id>#s;


I wan't to save and erase at the same time.

Please help me.
my email is     niclas@nillgraf.se

Niclas Lindberg





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

Date: 29 Apr 1998 14:43:51 GMT
From: tomasso@wal.hp.com (Richard Tomasso)
Subject: Can't open shared library
Message-Id: <6i7eb7$hgc@hpaneqb4.an.hp.com>
Keywords: HP-UX Perl5

I recently downloaded and compiled Perl5.004 w/o a problem. I put the
binaries and libraries into our nfs-mounted /usr/local/ hierarchy and all
was fine.
Yesterday I deleted the source and other files from where I built it
in /usr/tmp and now I get this error message when I run perl:

/lib/dld.sl: Can't open shared library: /usr/tmp/perl5.004_04/libperl.sl
/lib/dld.sl: No such file or directory
Abort(coredump)


This is on a HP-UX 9.05 system. /lib/dld.sl exists. I created a soft link
from the /usr/tmp file to the real libperl.sl file, but that didn't help.

The weird part is that perl works on the host machine where /usr/local
really lives.

Any suggestions?



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

Date: Wed, 29 Apr 1998 10:24:05 -0500
From: "tw96" <tw96@email.msn.com>
Subject: can't see CPAN page!!!
Message-Id: <e7SKhL4c9GA.270@uppubnews03>

hello:
i want to download some useful perl source through links in perl home page,
but everytime when i was linked to a site called,for example:

ftp"//ftp.archive.de.uu.net/pub/programming/languages/perl/CPAN/modules/by-m
odule/Net/libnet-1.0605.tar.gz

i can only see a blue frame, then an error message, saying that unknown VRML
or something like that, my browser is Explore 4.0,
could somebody tell me how i can get through this problem?

thanks!
meng




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

Date: Wed, 29 Apr 1998 15:44:11 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Date of last change of any file
Message-Id: <fVH11.22$al1.258386@newsread.com>

In article <35471590.4992CB3@htwm.de>
Arne Steinbacher <asteinba@htwm.de> wrote:

> how can I find out the date of the last change of any file ?

Look at the -M (and -C and -A) file test operators.

John Porter






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

Date: Wed, 29 Apr 1998 11:20:51 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Dateinamen + Datum letzte Aenderung
Message-Id: <Pine.A41.3.96.980429111958.89038H-100000@ginger.libs.uga.edu>

I think I've just been cussed out.

On Wed, 29 Apr 1998, Christian Kirsch wrote:
> Arne Steinbacher wrote:
> > Hallo zusammen,
> > wie bekomme ich eigentlich das Datum der letzten Aederung einer
> > beliebigen Datei heraus?
> > Danke.
> Ich f=FCrchte mal, da=DF diese Frage in einer englischsprachigen Newsgrou=
p,
> die sich mit PERL besch=E4ftigt, eher etwas fehl am Platze ist.
> Das mindeste w=E4re vielleicht noch eine Information =FCber das benutzte
> Betriebssystem.
> Christian

---
Brad Baxter, UGA



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

Date: Wed, 29 Apr 1998 15:40:32 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Email Authentication
Message-Id: <QRH11.21$al1.256278@newsread.com>

In article <6i69s4$glt$1@nntp3.interaccess.com>
"Orin Fink" <orin@thirdwaveweb.com> wrote:

> I will be running a Perl script on an IRIX system that would send mail to
> users that have "registered" on a web site.  Problem is, I don't want to
> send mail to bunk addresses.  Is there a way to "validate" someone's e-mail
> address before sending the message.

Here we go again.

This issue has been beaten to death already. Go search DejaNews.

John Porter



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

Date: 29 Apr 1998 15:40:45 GMT
From: jhunterj@lexis-nexis.com (Hunter Johnson)
Subject: Re: file comparison
Message-Id: <6i7hlt$san@mailgate.lexis-nexis.com>

[Posted to clpm, CCed to the author.]

In article <6i6g1f$9u1$1@camelot.ccs.neu.edu>,
Greg Land  <gland@ccs.neu.edu> wrote:
> Since I know that there are ppl here that really *KNOW* perl, here goes:

> I have one file looking like this:

> MOVE_IXLEFT  GRP_PK                       102400       20480
> MOVE_IXLEFT  ER_MESS_TEMP_IDX              20480       20480
>
> TABLESPACE_N SEGMENT_NAME         INITIAL_EXTENT NEXT_EXTENT
> ------------ -------------------- -------------- -----------
> MOVE_IXLEFT  ER_MESS_IDX                   20480       20480
> MOVE_IXLEFT  DOWNLD_ERR_LOG_PK           5120000     5120000
>
> And another file that looks like this:
>
> TABLESPACE_NAME                TOTAL******BYTES
> ------------------------------ ----------------
> "MOVE_IXLEFT                         152,203,264                                 "
> "MOVE_IXMIX1                           5,525,504                                 "
> "MOVE_IXMIX1                         298,881,024                                 "
>
> now for the question: I need to compare the number values between the
> "NEXT_EXTENT" and the "TOTAL BYTES" and see which is larger, but only
> when the "TABLESPACE_N" is the same as "TABLESPACE_NAME".

Read the second file into a hash indexed by tablespace_name (strip off
the quotes and commas, then split on whitespace to get the key-value
pair).

Then read the first file, doing the compare if $hash{$tablespace_n} is
defined.

HTH,
Hunter
--
J. Hunter Johnson        | "A little consistent wholesome modeling and
jhunterj@lexis-nexis.com |   costly servanthood are worth millions of
(937) 865-6800 x5385     |    true words harshly spoken."
Lexis-Nexis, Dayton, OH  |                               -- Ron Sider



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

Date: Wed, 29 Apr 1998 09:22:07 -0500
From: James Zahrndt <zahrndtj@agcs.com>
Subject: How Can I Check Return Codes on Net::FTP calls?
Message-Id: <3547378F.BCD3CFF7@agcs.com>

I'm writing an automated script to send files to vendors using the
Net::FTP module.
I works well, but I can't seem to find information on how to check if a
particular command (i.e., $FTP->new("somehost")) actually can connect to
a host.  I need
to trap errors on this.

The CPAN docs helped me use the module, but really didn't cover this
topic.
Thanks for any/all pointers!

Jim Zahrndt
zahrndtj@agcs.com



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

Date: 29 Apr 1998 10:00:28 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: How to find the number of matches in a string
Message-Id: <6i7bps$5dg$1@monet.op.net>
Keywords: cadaver cottonmouth expletive icky


In article <35471A44.19F3@cse.bridgeport.edu>,
Seong Y. Kim <seong@cse.bridgeport.edu> wrote:
>I want my program able to tell me the number of matches within a string.

	$count++ while $string =~ m/pattern/g;



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

Date: 29 Apr 1998 10:04:32 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: How to find the number of matches in a string
Message-Id: <6i7c1g$5fv$1@monet.op.net>
Keywords: Colloq monomer playback Wiley


>Seong Y. Kim wrote:
>> I want my program able to tell me the number of matches within
>> a string.

In article <35472942.3FF11BFA@kodak.com>,
Brian Mathis  <brianm@kodak.com> wrote:
>    grep EXPR,LIST

And this is relevant how?  A list is not a string.



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

Date: Wed, 29 Apr 1998 15:37:01 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Initializing hash with null array: which is best?
Message-Id: <xOH11.20$al1.253927@newsread.com>

In article <8cpvi0oq4t.fsf@gadget.cscaper.com>
Randal Schwartz <merlyn@stonehenge.com> wrote:

> 	There is no rule of converting lists to scalars.  It can't be done.
> 	A list will never exist in a scalar context, even for a moment.


I think a better way of putting it is:

There is no general rule for determining the value of an expression in a
scalar context, which evaluates to something interesting in a list context.

John Porter



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

Date: Wed, 29 Apr 1998 15:31:35 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: makemake, makedepend, etc...
Message-Id: <gerlachEs6Lsn.Ku3@netcom.com>


In the current issue of The Perl Journal, there is great article on
"cons".  This is what you really want.

Matthew

In article <6i5uht$8d3@co-op.newsguy.com> kin@c-cube.com writes:
>Are there such tools or similar written in perl available?
>
>I'm interested in building a simple make replacement tool where
>given some include path and source (C++) directories, the tool automatically
>compiles the needed binaries.
>
>I'm mainly interested in using this tool on NT.
>
>-kin




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

Date: Wed, 29 Apr 1998 10:09:48 -0400
From: Brian Mathis <brianm@kodak.com>
To: Brad Legge <blegge@iafrica.com>
Subject: Re: msql
Message-Id: <354734AC.ADB4E67D@kodak.com>

Brad Legge wrote:
> 
> Help Please.
> 
> Is there anyone out there who knows how to use perl to connect to msql
> through odbc. I need to be able to access msql from perl. They have got the
> Lite engine but I cannot use it. Is there an ODBC component that can be used
> to connect through. Or maybe a perl library file written to connect to msql
> 
> TIA
> Brad Legge

There is a module available from CPAN that provides this interface.  I
think there is also a module that comes with the Msql dist.  You don't
need an ODBC driver for this module.

Brian Mathis


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

Date: Wed, 29 Apr 1998 10:43:44 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Named Pipes (FIFOs) ...
Message-Id: <35473CA0.72AAC0B1@matrox.com>

Hi all,

In the Camel book, the authors state that

"A FIFO is convenient when you want to connect a process to an unrelated
one. When you open a FIFO, the program will block until there's somethng
on the other end."

Perfect, I like that ... but can't you know WHO is on the other end? for
example, the pid, or the machine name .. etc ..

ThanX,

Ala Qumsieh



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

Date: Wed, 29 Apr 1998 10:52:13 -0300
From: "Gilberto Mautner" <gilberto@locaweb.com.br>
Subject: Perl for Win32 not writing to file
Message-Id: <3547302b.0@news1.ibm.net>

Hi,
I have just installed PERL for Win32 in a NT/IIS 4.0 environment.

I wrote a test script, resposta.pl, which works except for it does not write
to files. It does return the HTML as specified but the file is simply not
there.

It's funny that the file is created and written with no problems if I run
this exactly same script from DOS command prompt.

This is the script:

use CGI;
$query = new CGI;
$SAIDA = ">>OUTPUT2.TXT";
open(SAIDA);
@list = ('Teste');
print SAIDA @list ;
print $query->header;
print $query->start_html("Resposta");
print $query->endform;
print "<P>Esta e a resposta</P>\n";
print $query->end_html;

I've already checked the permissions for IUSR_computername, it has "Change"
priviledge to the directory in which the script runs.

Any help will be greatly appreciated

Gilberto Mautner




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

Date: Wed, 29 Apr 1998 10:53:19 -0400
From: Alee Ali <aaa@dms2.com>
Subject: Perl for WindowsNT
Message-Id: <35473EDF.330@dms2.com>

Hi I am using a search engine to list all the related htm's on the page
but somehow when I run the script @ command prompt everything works
fine  but when I access it from the web the links to those files do not
show up .  Does anyone have any idea why this is happening.

Thanks

Alee


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

Date: Wed, 29 Apr 1998 11:01:26 -0400
From: Alee Ali <aaa@dms2.com>
Subject: Perl for WindowsNT
Message-Id: <354740C6.49A@dms2.com>

Hi I am using a search engine to list all the related htm's on the page
but somehow when I run the script @ command prompt everything works
fine  but when I access it from the web the links to those files do not
show up .  Does anyone have any idea why this is happening.

Thanks

Alee


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

Date: Wed, 29 Apr 1998 14:48:18 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Permutations in hashes make Perl hurt
Message-Id: <S4H11.17$al1.219762@newsread.com>

In article <6i6133$p6d@srvr1.engin.umich.edu>
gsar@engin.umich.edu (Gurusamy Sarathy) wrote:
>
> The "Dragon Book" has a hashpjw() function that they said behaves well
> for most cases.  I wonder how much performance we'd loose with that
> for the common cases.

Worth looking into, but it's gonna hafta be slow: Look at all those ops!

Here it is, for reference, slightly edited from the book:

int hashpjw( char* s ) {
  unsigned g;
  unsigned h = 0;
  for ( char* p = s; *p; p++ ) {
    h <<= 4;
    h += *p;
    if ( g = h & 0xF0000000 ) { // any top 4 set?
      h ^= (g >> 24);   // xor them into the bottom
      h &= 0x0FFFFFFF;  // clear top 4
    }
  }
  return h % 211; // some prime
}

John Porter



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

Date: Wed, 29 Apr 1998 14:58:02 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Print Currency
Message-Id: <_dH11.18$al1.225794@newsread.com>

In article <3546A5B9.551@comenius.ms.mff.cuni.cz>
Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz> wrote:

> What's wrong with
> 
> 	use Interpolation 'eval' => 'eval';
> 	
> 	print "The lenght of '$string' is $eval{length $string}";
> ?
> 
> Or if you realy want to have $length{...}
> 
> 	use Interpolation 'length' => sub {length $_[0]};
> 
> I don't think such easily definable functions should be
> predefined. IMHO, M-J should predefine only 
> tricky and more elaborate functions.


I tend to agree, except that I think M-J *should* predefine
for very commonly used cases.

	"$length{$s}"

is preferable to

	"$eval{length $s}"

if it occurs very much in your code.  (We're lazy, after all.)

John Porter



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

Date: Wed, 29 Apr 1998 16:07:21 +0200
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: Re: print($b=1,$b=2)
Message-Id: <35473419.BF@linguistik.uni-erlangen.de>

Horst Fickenscher wrote:

> my $b;
> print($b = "basename", $b = "directory/$b");
> 
> I thought it should print: basenamedirectory/basename
> but it prints:             directory/basenamedirectory/basename

Your print statement is equivalent to the following:

$b = "basename";
$b = "directory/$b";  # so $b results in "directory/basename"
print ($b,$b);        # Here you print an anonymous array
                      # consisting of two $b's

You should not mix assignments and print statements.
If you want $b to be "basename" and the output to be
"basenamedirectory/basename", then you should write
it like this, for example:

my $b;
$b = 'basename';
print $b, 'directory/', $b;

Christian


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

Date: Wed, 29 Apr 1998 15:04:41 GMT
From: Peter A Fein <p-fein@uchicago.edu>
Subject: Re: print($b=1,$b=2)
Message-Id: <87d8e0pt2u.fsf@bj2-64.rh.uchicago.edu>

Horst Fickenscher <horst.fickenscher@it.erlm.siemens.de> writes:

> Perl 5.003 on Linux:
> 
> The following code makes a little more sense
> than that in the subject line:
> 
> my $b;
> print($b = "basename", $b = "directory/$b");
> # do some other stuff with $b
> 
> I thought it should print: basenamedirectory/basename
> but it prints:             directory/basenamedirectory/basename
> 

I believe that the parens mean do the evaluation first.  This then
returns the list of evaluated $b's to print.  What I think you're
looking for is 

print ($b = "basename"), ($b = "directory/$b");

I'm not sure the parens here are needed, but I doubt they'll hurt.
Why are you writing code like this anyway?



-- 
Peter Fein
1005 E. 60th St.
Chicago, IL 60637
773-834-6206
p-fein@uchicago.edu
http://pfein.home.ml.org/


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

Date: Wed, 29 Apr 1998 14:18:01 GMT
From: jdporter@min.net (John Porter)
Subject: Re: rename funciton (was: Re: Dummie question)
Message-Id: <tEG11.16$al1.199306@newsread.com>


Won't You Take Me To

Funciton


John Porter



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

Date: Wed, 29 Apr 1998 10:28:11 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Syntax to make my hit counter work?
Message-Id: <1d88ljw.1jh1ri3dtfotbN@slip-32-100-246-240.ny.us.ibm.net>

Grinch <grinch@whoville.com> wrote:

> Iain Gatt wrote in message <3544B7D2.41C6@strath.ac.uk>...
> 
> >        I'd appreaciate any help on how to get the hit counter
> >operational.
> 
> wc -l /path/to/your/log/file

But that would also count requests for images and other such things.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: 29 Apr 1998 16:11:56 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: warnings and Getopt::Std
Message-Id: <wl3lnsowwcz.fsf@plume.nl.compuware.com>

David Boyce <David.Boyce@fmr.com> writes:

> Bill Mooney wrote:
> > Is there a "standard" way to remove these warnings?
> 
> Previous responses suggest the "vars" pragma, which is the correct
> general solution.  Another way to deal with your specific problem is to
> use Getopt::Long (note that there's nothing wrong with using
> Getopt::Long to process "short" options). This allows you to pass a
> reference to a hash instead of populating a bunch of scalars:
> 
> 	use Getopt::Long;
> 	GetOptions(\%Opt, 'v');
> 	print "-v\n" if $Opt{v};

use strict;
use Getopt::Long;
# The next line enables classical option bundling, like getopts.
Getopt::Long::config('bundling'); 

my $opt_var;
GetOptions ('v' => \$opt_var);
print "-v\n" if $opt_var;

-- Johan


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

Date: Wed, 29 Apr 1998 10:15:19 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: where are the examples in the newer (blue) camel book?
Message-Id: <6i7bng$btn@fridge.shore.net>

Mark-Jason Dominus wrote in message <6i78ng$4tf$1@monet.op.net>...

>Not so far as I know, and I'm the person who has the list of moderators.


What's this got to do with Perl?

Couldn't resist... :-)

-grinch

--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Wed, 29 Apr 1998 09:59:28 -0400
From: Michael Genovese <mikeg@slpma8.ed.ray.com>
Subject: Windows/NT, Perl, and redirection
Message-Id: <35473240.18D@slpma8.ed.ray.com>

A co-worker learning perl has it installed on his Windows/NT box.

The other day,  when I was helping him with a simple perl problem,
we noticed that redirection doesn't work quite the same as in UNIX.

For instance, the following
######################
foreach $A (@ARGV) {
    printf("$A\n");
}
######################

WILL redirect under UNIX (foo arg1 arg2 arg3 ... > www);
but NOT under Windows/NT.  Can anyone tell me why, or suggest
a fix ?




-- 
Mike Genovese


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

Date: Wed, 29 Apr 1998 10:15:37 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: You people want Perl to be popular?
Message-Id: <pudge-2904981015530001@ppp-44.ts-1.kin.idt.net>

In article <35469455.4B144377@cglis.com>, Chris Lambrou
<archive@cglis.com> wrote:

# Well?

/mode #clpm +b *!archive@cglis.com
/kick #clpm Lambrou thanks for playing ...

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2454
**************************************

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