[10682] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4274 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 22 15:07:19 1998

Date: Sun, 22 Nov 98 12:00:34 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 22 Nov 1998     Volume: 8 Number: 4274

Today's topics:
        ??? Perl iis downloaded with Personal Web Server  ???? <tastiel@email.msn.com>
        AAA Anyone out there need the full step by step instruc <sw12467@advancedits.com>
    Re: Abstact Classes (Andrew M. Langmead)
        Deleting GDBM file records <hassan@magma.ca>
        Free Web Dev. Resources heliumweb2@my-dejanews.com
    Re: Hey all i am looking <r28629@email.sps.mot.com>
    Re: How do I exit child process w/o invoking packages'  (Andrew M. Langmead)
        How get IP address logged & sent with html form? (Andri Bell-remove the "x" to reply)
        How to make a pattern non-greedy in Perl 4 <minich@globalnet.co.uk>
    Re: Is there a case function in PERL? (Tad McClellan)
    Re: PerlShop, Missing File Title carl7918@my-dejanews.com
    Re: print  " Location:  problem " <jeff@vpservices.com>
    Re: print  " Location:  problem " <r28629@email.sps.mot.com>
    Re: Recommend Perl books? <dgris@moiraine.dimensional.com>
    Re: Recommend Perl books? <uri@sysarch.com>
    Re: Recommend Perl books? <dgris@moiraine.dimensional.com>
        Regular expression problem... <Alex.Davies@tiuk.ti.com>
    Re: Regular expression problem... <J.D.Gilbey@qmw.ac.uk>
    Re: Regular expression problem... <Alex.Davies@tiuk.ti.com>
    Re: Regular expression problem... (Larry Rosler)
    Re: Regular expression problem... (Larry Rosler)
    Re: Regular expression problem... <Alex.Davies@tiuk.ti.com>
    Re: Regular expression problem... <dgris@moiraine.dimensional.com>
    Re: Regular Expression <uri@sysarch.com>
        Round with Perl (Tuomas Angervuori)
    Re: Round with Perl <nix@cyberramp.net>
        Rounding dollar values (Scott Thompson)
    Re: Rounding dollar values (I R A Aggie)
    Re: shopping cart (Sergej Zoubok)
        Sorting a flat file <gss2@roogna.eng.wayne.edu>
    Re: Why doesn't something work? <jdf@pobox.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 22 Nov 1998 10:38:02 -0500
From: "thierry tastiel" <tastiel@email.msn.com>
Subject: ??? Perl iis downloaded with Personal Web Server  ????
Message-Id: <u9PPZ4iF#GA.59@upnetnews05>

When testing my perl programs locally, the code is downloaded instead of
executed.
I'm using Windows 98, Personal Web Server and II4 or Netscape 4.5.

How should I configure the .pl files ?

thanks,

Thierry




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

Date: Sun, 22 Nov 1998 13:42:47 -0600
From: "Scott Winterstein" <sw12467@advancedits.com>
Subject: AAA Anyone out there need the full step by step instructions to setup roaming profiles on NT???
Message-Id: <739pjh$4bd$1@excalibur.flash.net>

I have the step by step instructions on how to setup roaming profiles. Not
the hard to understand ones you will find anywhere you look, these are step
by step. No BS and rhetoric, just the plain facts will trade to some on who
will build me a perl script that will include passing variables...My hard
work making it simple for you. For your easy Task of setting up something I
have very little exp at but enough to learn from someone whos willing to
help email me at
scott12467@yahoo.com




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

Date: Sun, 22 Nov 1998 17:26:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Abstact Classes
Message-Id: <F2u34E.2y5@world.std.com>

Martin Drautzburg <Martin.Drautzburg@kst.siemens.de> writes:

>Is there a way to define abstract classes, so that any attempt to
>instantiate such a class (or a derived class that left some methods
>abstract) leads to a *compile* time error ?

I don't think so. Perl doesn't know that a consuctor is a constructor
until run time, its just a class method that "happens" to return a
blessed reference. Also, it doesn't know which a method (or even which
subroutine) is going to be called until runtime.

-- 
Andrew Langmead


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

Date: Sun, 22 Nov 1998 18:55:19 GMT
From: hassan <hassan@magma.ca>
Subject: Deleting GDBM file records
Message-Id: <36585E86.4747D72B@magma.ca>

Hi,

The code below would "delete" all the records in a GDBM file, but
the file size remains almost the same!! Anybody knows why? I tried
to vi the "myfile" and found all the records still in there! Does
anybody know how I can "sure delete" GDBM file records. That is, if
my GDBM file is 2MB big, I want to see the size of that file
considerably reduced after deleting all the records.

TIA.

Hassan.

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

#!/usr/bin/perl

use GDBM_File;

# Create new GDBM database

tie %data, 'GDBM_File', "myfile", &GDBM_WRCREAT, 0664 ;
  $data{1} = "This is data number 1";
  $data{2} = "This is data number 2";
  $data{3} = "This is data number 3";
untie %data;

print "\nData stored in the database:\n\n";
tie %data, 'GDBM_File', "myfile", &GDBM_READER, 0664 ;
  foreach $i (keys %data) {
    print "$i $data{$i}\n";
  }
untie %data;

# Delete all the data records

tie %data, 'GDBM_File', "myfile", &GDBM_WRITER, 0664 ;
  foreach $i (keys %data) {
    delete($data{$i});
  }
untie %data;

print "\nData remaining in the database:\n\n";
tie %data, 'GDBM_File', "myfile", &GDBM_READER, 0664 ;
  foreach $i (keys %data) {
    print "$i $data{$i}\n";
  }
untie %data;


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

Date: Sun, 22 Nov 1998 15:54:02 GMT
From: heliumweb2@my-dejanews.com
Subject: Free Web Dev. Resources
Message-Id: <739c2l$uer$1@nnrp1.dejanews.com>

Hello
    WebKnowHow.Net is a web development directory with over 900 resources,
including tutorials, FAQ's, books, and scripts for subjects such as CGI, Perl,
Java, HTML, Web Design, Graphics, Web Promotion and more. There is also a free
search engine submission section. If you know of a good web development
resource, be sure to add it to our database.

Visit us at http://webknowhow.net

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 22 Nov 1998 11:13:52 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: "J. J. Goodrich" <JJ353@webtv.net>
Subject: Re: Hey all i am looking
Message-Id: <3658383F.9C5FD078@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

J. J. Goodrich wrote:
> 
> Hey all im looking for a script that will
> allow me to set a cookie when a person logs in and if tehy dont ahve the
> cookie then they cant visit the pages.... I would like to make it tow
> here if they dont login in then they cant access any of my pages that im
> trying to protect without first going to the login and getting the
> cookie is this possible if so could someone direct me to the script that
> will allow me to do this im a newbie so go light on the technical talk

Your post is clearly _not_ related directly to Perl. You may find the
following newgroup more suitable for this kind of questions:

       comp.infosystems.www.authoring.cgi

-TK


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

Date: Sun, 22 Nov 1998 17:30:12 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How do I exit child process w/o invoking packages' destructors
Message-Id: <F2u3AC.4BJ@world.std.com>

"Yuval Buchner" <yuval.buchner@intel.com> writes:


>I need to use fork in my program.

>When the child completes its job it exits and invokes the END blocks
>of all the packages. This is not a desired action since the father
>didn't finish its job.

You can use POSIX::_exit() to end the child process without the
standard cleanup chores being done.

-- 
Andrew Langmead


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

Date: Sun, 22 Nov 1998 16:01:38 GMT
From: usenet@one-click.xcom (Andri Bell-remove the "x" to reply)
Subject: How get IP address logged & sent with html form?
Message-Id: <739jir$2h4@sjx-ixn8.ix.netcom.com>

How get IP address logged & sent with html form?

I found a server side include which echos the client's ip address onto their 
browsers:

"<!--#echo var="REMOTE_ADDR" -->"

but what I need is a way to get their ip address included into a field on my 
order form and also logged when they find me via one of my refer pages 
(maintained by me).

The reason is that I pay commissions for referrals and when a client orders I 
need to know who to pay the commission to.  My guess is that I need to: 

1) log every ip address visiting each referer page maintained by me
2) log ip address when an order is placed
3) compare ip addresses sent with order against ip addresses in referer log

I hope this makes sense and is doable. If you know how to accmplish this or 
know of of a better system for tracking ip addresses and referrals please let 
me know.  The cookie-based tracking system I used has proved to be ineffective 
since it seems most people disable cookies in their browsers.

Thanks for your help!

Andri 


____________________________________________________________
$;%+$;'+$;%+$;'+$;%+$;'+$;%+$;'+$;%+
////////////////////////////////////////////////////////////
EARN Up to $350 Just for Referring Others to Our Web Site 
 Web Design Services
 Self-Replicating Web Sites
 Site Promotion
 Merchant M/C Visa Services
 And More!

http://www.one-click.com/

____________________________________________________________
$;%+$;'+$;%+$;'+$;%+$;'+$;%+$;'+$;%+
////////////////////////////////////////////////////////////
Need to reach me online? ICQ 21064654 - no spamming please.

Autoresponders for only $1.00 per month mailto:autobot@one-click.com


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

Date: Sun, 22 Nov 1998 18:39:06 -0000
From: "Martin" <minich@globalnet.co.uk>
Subject: How to make a pattern non-greedy in Perl 4
Message-Id: <739lmq$g0l$1@newnews.global.net.uk>

Hi all:

I've just found out the the ? modifier won't work in Perl 4.

I have the regexp:

s/abc(.*?)abc/$FOO{$1}/sg;

which works fine under Perl 5 but Perl 4 won't accept the ? modifier to make
the match .* non-greedy. I normally use Perl 5 so have never come across
this problem before. How can regexps be made non-greedy in Perl 4?

Martin




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

Date: Sun, 22 Nov 1998 08:00:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Is there a case function in PERL?
Message-Id: <3e5937.pn5.ln@flash.net>

Timothy C. Pelham (squid666@geocities.com) wrote:
: Is there a function in PERL that does the same thing as the CASE
: function in C and if so what is it? 


   You should not reask Frequently Asked Question because...
   well, they have already been asked and answered many times
   over.

   You should check the Perl FAQ before posting a question.

   Perl FAQ, part 7:

      "How do I create a switch or case statement?"



   And C doesn't have a CASE function either.


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


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

Date: Sun, 22 Nov 1998 17:03:39 GMT
From: carl7918@my-dejanews.com
Subject: Re: PerlShop, Missing File Title
Message-Id: <739g53$1h5$1@nnrp1.dejanews.com>

When I first started using PerlShop I had this a lot. The program I used to
edit my files with would change the first letter of the file name to a
capital letter. I run in a unix box and it's case sensitive. The cgi would
call for ie)catalog and the file on the server was named Catalog.
Error--Missing File-): Hope this helps. <http://www.dalzell.net/ceramics>

In article <3648a7bf.25908339@news.netdoor.com>,
  rip@5thpower.com wrote:
>
>   I have PerlShop installed on my site and as far as I can tell,
> correctly ( but what do I know ), If some kind soul could explain what
>
> would cause that error message i sure would appreciate it.
> An email reply would be nice, but I'll check back here too.
> Thanx,
> Rip & Tim Sumrall
> Authors of"5th POWER" THE PSP 5 Tutorial CD
> http://www.5thpower.com
> Enter our on-going contest by clicking on the logo!
> sales@5thpower.com
> Visit "The Button Hole" at
> http://www.sumrallworks.com/freebies/buttonhole/
>
>


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 22 Nov 1998 16:21:15 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: print  " Location:  problem "
Message-Id: <3658391C.73964676@vpservices.com>

Oooh, yes, this just bit me also and I had a heck of a time figuring it
out.  Location did fine on the command line but would not work in the
browser.  I knew it was none of the usual things that cause this - my
file associations and lib path were fine, but still on the command line
I could get the whole file and in the browser I just got an echo of the
"Location" line.  My problem had to do with browser caching and I fixed
it by erasing my browser cache and adding a no-cache to the location
statement like so:

    print "Pragma: no-cache\n",
          "Location: $url\n\n";

HTH.

- Jeff Zucker

Bob wrote:
> 
>  I have been working on a perl script that will send the user to a
> specific url if certain conditions are met..
> 
> But I can not for the life of me figure out why the line
> 
>   print "Location: http://www.mysite.com/target.shtml\n\n";
> 
> does not work !   the script doesn't force the viewing browser to
> the url specified  by Location , but prints  the text ...
> 
>  Location:  http://www.hotstart.com/pbook.shtml\n\n";
> 
> What is happening ?


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

Date: Sun, 22 Nov 1998 11:12:33 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Bob <wcd@aquik.net>
Subject: Re: print  " Location:  problem "
Message-Id: <365837F1.E28F0801@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Bob wrote:
> 
>  I have been working on a perl script that will send the user to a
> specific url if certain conditions are met..
> 
> But I can not for the life of me figure out why the line
> 
>   print "Location: http://www.mysite.com/target.shtml\n\n";
> 
> does not work !   the script doesn't force the viewing browser to
> the url specified  by Location , but prints  the text ...
> 
>  Location:  http://www.hotstart.com/pbook.shtml\n\n";
> 
> What is happening ?

Your post is clearly _not_ related directly to Perl. You may find the
following newgroup more suitable for this kind of questions:

       comp.infosystems.www.authoring.cgi

-TK


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

Date: 22 Nov 1998 10:23:42 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Recommend Perl books?
Message-Id: <m3lnl3hc9t.fsf@moiraine.dimensional.com>

"Shawn Berg" <sberg1@tampabay.rr.com> writes:

> Is the Regular Expression book worth buying?

Yes, but not for it's coverage of perl, which is sadly out
of date.

It's coverage of perl regular expressions no longer matches the
implementation available.  For example, there is a section in 
which Friedl mentions that lookbehind isn't possible.  While
this used to be true, it no longer is.

The book is still extremely valuable for explaining the
fundamental concepts of regular expressions, though.  Just
don't assume that what it says about perl is 100% accurate
anymore.  A thorough reading of perlre after reading the
book will certainly be necessary.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 22 Nov 1998 13:32:27 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Recommend Perl books?
Message-Id: <x7zp9j1suc.fsf@sysarch.com>

>>>>> "DG" == Daniel Grisinger <dgris@moiraine.dimensional.com> writes:

  DG> "Shawn Berg" <sberg1@tampabay.rr.com> writes:
  >> Is the Regular Expression book worth buying?

  DG> Yes, but not for it's coverage of perl, which is sadly out
  DG> of date.

  DG> It's coverage of perl regular expressions no longer matches the
  DG> implementation available.  For example, there is a section in 
  DG> which Friedl mentions that lookbehind isn't possible.  While
  DG> this used to be true, it no longer is.

  DG> The book is still extremely valuable for explaining the
  DG> fundamental concepts of regular expressions, though.  Just
  DG> don't assume that what it says about perl is 100% accurate
  DG> anymore.  A thorough reading of perlre after reading the
  DG> book will certainly be necessary.

i agree. but for 95% of regexes it is accurate. i dropped a use of
lookbehind when i found it wss VERY slow. it was elegant but i found a
way to do without it. there are many new features of perl's regex engine
that ilya id developing. some are only in the5.005_5x releases which are
experimental. i would hope that a second edition is being planned to
cover many of those new features when they become stable.

and in its coverage and explanations of regexes, freidl's book is
incredible. i recommend it for any perl hacker who wants to improve in
that area.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 22 Nov 1998 12:27:38 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Recommend Perl books?
Message-Id: <m367c7h6j9.fsf@moiraine.dimensional.com>

Uri Guttman <uri@sysarch.com> writes:

<snip Mastering Regular Expressions>
>               i would hope that a second edition is being planned to
> cover many of those new features when they become stable.

This would be very nice.

> and in its coverage and explanations of regexes, freidl's book is
> incredible. i recommend it for any perl hacker who wants to improve in
> that area.

Oh, yes.  I wholeheartedly recommend it, but aspiring perl hackers
should be warned that it is no longer completely accurate in its
treatment of perl.  It, like the camel, is a good book that is
rapidly losing relevance as documentation of how perl behaves.

New perl users especially need to be wary of this as they are the
most likely to be bit by the differences.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Sun, 22 Nov 1998 16:55:05 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
Subject: Regular expression problem...
Message-Id: <365841E8.68FF5B64@tiuk.ti.com>


 Can someone explain why the following
regular expression causes Perl problems:

/$ARGV[0][^\/]*$/

The workaround i've come up with is to add a space between
$ARGV[0] and [^\/]*, and use //x:

/$ARGV[0] [^\/]*$/x

  I would have thought Perl should be able to see
the intention of the former r.e. though... any ideas?

TIA

alex.




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

Date: Sun, 22 Nov 1998 17:19:11 +0000
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Regular expression problem...
Message-Id: <3658478F.6537B147@qmw.ac.uk>

Alex Davies wrote:
> 
>  Can someone explain why the following
> regular expression causes Perl problems:
> 
> /$ARGV[0][^\/]*$/

Hold on, is that a two-dimensional array there?  Certainly
looks like it!  You could try putting your variable in braces:

  /${ARGV[0]}[^\/]*$/

HTH,

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

            Julian Gilbey             Email: J.D.Gilbey@qmw.ac.uk
       Dept of Mathematical Sciences, Queen Mary & Westfield College,
                  Mile End Road, London E1 4NS, ENGLAND
      -*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-


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

Date: Sun, 22 Nov 1998 17:30:55 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Regular expression problem...
Message-Id: <36584A4F.11E559AA@tiuk.ti.com>

Julian Gilbey wrote:

> Alex Davies wrote:
> >
> >  Can someone explain why the following
> > regular expression causes Perl problems:
> >
> > /$ARGV[0][^\/]*$/
>
> Hold on, is that a two-dimensional array there?  Certainly
> looks like it!  You could try putting your variable in braces:
>
>   /${ARGV[0]}[^\/]*$/
>

  You're right, but i had thought that the r.e. 'guesser' (p.43 of
Blue Camel) could determine the intented meaning (for one thing $ARGV[0]
is not a reference to an array!)
 I'm probably being a little optimistic!

alex.


>
> HTH,
>
>    Julian
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>             Julian Gilbey             Email: J.D.Gilbey@qmw.ac.uk
>        Dept of Mathematical Sciences, Queen Mary & Westfield College,
>                   Mile End Road, London E1 4NS, ENGLAND
>       -*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-



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

Date: Sun, 22 Nov 1998 09:34:00 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regular expression problem...
Message-Id: <MPG.10c1eae4be48f6ce98991b@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <365841E8.68FF5B64@tiuk.ti.com> on Sun, 22 Nov 1998 16:55:05 
+0000, Alex Davies <Alex.Davies@tiuk.ti.com> says...
>  Can someone explain why the following
> regular expression causes Perl problems:
> 
> /$ARGV[0][^\/]*$/

The parser decides that $ARGV[0] is a reference to an array, which you 
are subscripting.  After all, it has already decided correctly that [0] 
is a subscript on $ARGV, and not the character class [0].  It can't get 
enough of a good thing. :-)

> The workaround i've come up with is to add a space between
> $ARGV[0] and [^\/]*, and use //x:
> 
> /$ARGV[0] [^\/]*$/x

Cool workaround to disambiguate, within the regex context.  Live with 
it...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 22 Nov 1998 10:16:47 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regular expression problem...
Message-Id: <MPG.10c1f4eba01e96d998991c@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <36584A4F.11E559AA@tiuk.ti.com> on Sun, 22 Nov 1998 17:30:55 
+0000, Alex Davies <Alex.Davies@tiuk.ti.com> says...
 ...
>   You're right, but i had thought that the r.e. 'guesser' (p.43 of
> Blue Camel) could determine the intented meaning (for one thing $ARGV[0]
> is not a reference to an array!)

$ARGV[0] = [];

Now $ARGV[0] *is* a reference to array.  How should the parser divine 
that?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 22 Nov 1998 18:39:51 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regular expression problem...
Message-Id: <36585A77.E3A7FE76@tiuk.ti.com>

Larry Rosler wrote:

> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <36584A4F.11E559AA@tiuk.ti.com> on Sun, 22 Nov 1998 17:30:55
> +0000, Alex Davies <Alex.Davies@tiuk.ti.com> says...
> ...
> >   You're right, but i had thought that the r.e. 'guesser' (p.43 of
> > Blue Camel) could determine the intented meaning (for one thing $ARGV[0]
> > is not a reference to an array!)
>
> $ARGV[0] = [];
>
> Now $ARGV[0] *is* a reference to array.  How should the parser divine
> that?

  OK . But doesn't the r.e. parser have the information on the contents
of $ARGV[0], so it would know if $ARGV[0][123] was more likely
to be ${ARGV[0][123]} or ${ARGV[0]}[123]?

I know this is really nitpicking, but hey, what else to do
on a sunday night ;)

alex.

>
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com



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

Date: 22 Nov 1998 12:20:01 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Regular expression problem...
Message-Id: <m3af1jh6vy.fsf@moiraine.dimensional.com>

lr@hpl.hp.com (Larry Rosler) writes:

<snip m/$ARGV[0][^\/]/ doesn't work>

> $ARGV[0] = [];
> 
> Now $ARGV[0] *is* a reference to array.  How should the parser divine 
> that?

Presumably the same way that it figures this out-

  DB<1> $a = 'this is a test'

  DB<2> $foo{foo}{foo} = '(?:\w+\s+)'

  DB<3> print qq.yup. if $a =~ /$foo{foo}{foo}{2}/
yup
  DB<4> 

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 22 Nov 1998 13:23:23 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regular Expression
Message-Id: <x73e7b37tw.fsf@sysarch.com>

>>>>> "RAL" == R A Larsen <r_larsen@image.dk> writes:

  RAL> "Shawn Berg" <sberg1@tampabay.rr.com> wrote:

  RAL>     my @mydir = ("/data", "foo/", "bar");
  RAL>     my $path = join '/', @mydir, '/';
  RAL>     $path =~ s|/{2,}|/|g;
  RAL>     print "$path\n";

  RAL> But remember, TIMTOWTDI :)

and here is a slightly simpler and faster (but similar) method:

	$path = join( '/', @mydir ) . '/' ;
	$path =~ tr|/||s;

tr/// is better than s/// for squeezing multiple chars (like //) to one
char

and if you feel like one liners:

	( $path = join( '/', @mydir ) . '/' ) =~ tr|/||s ;

hth,

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 22 Nov 1998 16:51:31 GMT
From: tumppi@nospam.icon.fi (Tuomas Angervuori)
Subject: Round with Perl
Message-Id: <Un3NuHgI1diW-pn2-TfS5m6UvffbK@armi.dyn.icon.fi>

I have a problem: for example when I divide 1 with 3, I get result 
0.3333333333.... How can I tell Perl to count only for example two 
desimals?

	-Tumppi


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

Date: 22 Nov 1998 17:03:19 GMT
From: "Leah Norman" <nix@cyberramp.net>
Subject: Re: Round with Perl
Message-Id: <01be1639$6a5a43c0$0f6a9ecf@nix>

http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#Does_perl_have_a_ro
und_function_


Tuomas Angervuori <tumppi@nospam.icon.fi> wrote in article
<Un3NuHgI1diW-pn2-TfS5m6UvffbK@armi.dyn.icon.fi>...
> I have a problem: for example when I divide 1 with 3, I get result 
> 0.3333333333.... How can I tell Perl to count only for example two 
> desimals?
> 
> 	-Tumppi
> 


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

Date: Sun, 22 Nov 1998 19:09:15 GMT
From: scotty@nospam.internetbrokers.ab.ca (Scott Thompson)
Subject: Rounding dollar values
Message-Id: <365860c9.165158958@news.cadvision.com>

What's the easiest way to round up results of a calculation, and limit
it to 2 decimal places?

Thanx in advance
Scott Thompson


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

Date: Sun, 22 Nov 1998 14:05:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Rounding dollar values
Message-Id: <fl_aggie-2211981405060001@aggie.coaps.fsu.edu>

In article <365860c9.165158958@news.cadvision.com>,
scotty@nospam.internetbrokers.ab.ca (Scott Thompson) wrote:

+ What's the easiest way to round up results of a calculation, and limit
+ it to 2 decimal places?

<url:http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#Does_perl_have_a_round_function_>

James


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

Date: Sun, 22 Nov 1998 10:58:01 -0500
From: sqz1909@is2.nyu.edu (Sergej Zoubok)
Subject: Re: shopping cart
Message-Id: <sqz1909-2211981058020001@dial2-async19.dial.net.nyu.edu>

Try WebStore at www.extropia.com.


In article <911467877.1911776447@news.mindspring.com>, Dustin Puryear
<dpuryear@usa.net> wrote:

> I'm looking for a free shopping cart program that is well documented. Any
> suggestions?
> 
> Regards, Dustin
> 
> --
> Dustin Puryear, student, Louisiana State University 
> dpuryear@usa.net * ICQ 6644253 
> Help Crack Government Encryption: www.distributed.net

-- 
Sergej Zoubok
Department of Politics
New York University
sqz1909@is2.nyu.edu


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

Date: Sun, 22 Nov 1998 14:40:45 -0500
From: shienh gurpreet <gss2@roogna.eng.wayne.edu>
Subject: Sorting a flat file
Message-Id: <365868BD.73BEE0D9@roogna.eng.wayne.edu>

Hello!!
I tried looking at the perl FAQ but couldn't figure out how they were
sorting the array with respect to any field. Here's the example database
file I have, and I wanna sort it w.r.t. the 5th column (with %) in
ascending order. Can someone please help as you have done before. Thank
you.

eir        11   9   2    81%    13
oos      13   6   4    60%    25
hrh       12   6   8    50%    15
spp      10   6   4    60%    14



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

Date: 22 Nov 1998 16:14:34 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: alany@2021.com
Subject: Re: Why doesn't something work?
Message-Id: <m3yap3n4it.fsf@joshua.panix.com>

alany@2021.com (Alan Young) writes:

>       $totals_info{$1} = $2;
> #---> Why doesn't %totals_info = ( $1 => $2 ) work?

> If I try the code as indicated above I get *one* entry in totals_info.

Well, of course: you're reinitializing the hash each time through the
loop with the code that "doesn't work".  You're saying "set the hash
%totals_info to the list ($1, $2)", which is quite different from
saying "set $totals_info{$1} to $2".

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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