[12545] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6145 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 27 15:07:17 1999

Date: Sun, 27 Jun 99 12:00:18 -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           Sun, 27 Jun 1999     Volume: 8 Number: 6145

Today's topics:
        A necessary # in statement <littledude@uswest.net>
    Re: A necessary # in statement <rick.delaney@home.com>
    Re: CGI and SSI <gellyfish@gellyfish.com>
    Re: Command line parameters / Wildcard characters / Rec <eman@cc.gatech.edu>
    Re: Command line parameters / Wildcard characters / Rec <gellyfish@gellyfish.com>
    Re: Command line parameters / Wildcard characters / Rec <tchrist@mox.perl.com>
    Re: Command line parameters / Wildcard characters / Rec (Philip 'Yes, that's my address' Newton)
    Re: Command line parameters / Wildcard characters / Rec <lane@rettig.com>
    Re: Comparing two associative arrays (Larry Rosler)
    Re: Comparing two associative arrays <rick.delaney@home.com>
        floor and ceil <kenrose@home.com>
    Re: floor and ceil <rick.delaney@home.com>
    Re: How to store hashes <pandich@my-deja.com>
    Re: In Mountain View did Larry Wall <jhi@alpha.hut.fi>
        looking for a free meta search type script <olindo@my-deja.com>
        MySQL vs Oracle <crensw@yahoo.com>
    Re: Removing spaces from string (Philip 'Yes, that's my address' Newton)
    Re: spawning on the left side of the assignment, or som <shaw@active.ch>
        TIMEOUT <Ch1ckEn@hotmail.com>
    Re: Unlink == delete files? Why (on earth) is it called <gellyfish@gellyfish.com>
    Re: Viral matters [completely off-topic] <gt7202e@prism.gatech.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 27 Jun 1999 10:13:21 -0700
From: Ryan Hilton <littledude@uswest.net>
Subject: A necessary # in statement
Message-Id: <37765BB1.B7B8CAA8@uswest.net>

I am fairly new at PERL and I was going over some source
code that a friend helped me with and I noticed that there
was a comment in the middle of a statement, my example is
below.

for ($i=1;$i<=$#files;$i++) {

Why is this comment field used and not marking the rest of
the line as being commented? and why will it not work if I
get rid of the comment character in all of the statements
that contain it?

Ryan



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

Date: Sun, 27 Jun 1999 17:36:41 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: A necessary # in statement
Message-Id: <377660EE.FBF5DE2B@home.com>

[posted & mailed]

Ryan Hilton wrote:
> 
> I am fairly new at PERL and I was going over some source
> code that a friend helped me with and I noticed that there
> was a comment in the middle of a statement, my example is
> below.
> 
> for ($i=1;$i<=$#files;$i++) {

Why not ask your friend?

That's not a comment, it's the last index to @files.  Read all about it
in perldata.  Another good page beginners should start with is perlsyn. 
Don't forget the main perl man page.

You might also want to get yourself a copy of the llama book, _Learning
Perl_.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 27 Jun 1999 12:06:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI and SSI
Message-Id: <7l5445$5us$1@gellyfish.btinternet.com>

On Sun, 27 Jun 1999 12:26:36 +0200 Pippo wrote:
> Hello,
> 
> I use Apache as web server. How can I configure it to recognize SSI commands
> in dynamic pages generated on the fly by  perl CGI script.
> 

You can't.

Anyhow you really should have asked this in comp.infosystems.www.servers.unix
as the question and answer would be the same whatever language was used.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 27 Jun 1999 13:10:05 -0400
From: Eric Anderson <eman@cc.gatech.edu>
Subject: Re: Command line parameters / Wildcard characters / Recursive    directories
Message-Id: <37765AED.654704B4@cc.gatech.edu>

"Philip Newton" wrote:

> I rather doubt it. Try it out once on a directory containing a.html
> and b.html, which has a subdirectory containing a.html c.html d.html
> and see which files get deleted.
> 
> (And you did know that you can quote wildcards to hide them from the
> shell, didn't you? I know I always do with commands such as find for
> this reason, e.g. find / -name '*.o' rather than just *.o. But maybe
> that's just me.)

Well, I guess there isn't a way to get it to do what I want it to do. Oh
well, thanks for everybody's help. Since this script will be mainly run
on Win32 I will get it to work there how I want and for UNIX quotes will
have to be required. Again thanks for everybody's help in clearing up
how some things worked.

-- 
Eric Anderson
Computer Science, Georgia Tech
Co-op, Southern Regional Education Board
ICQ# 1279816


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

Date: 27 Jun 1999 12:01:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive   directories
Message-Id: <7l53rh$5up$1@gellyfish.btinternet.com>

On Sun, 27 Jun 1999 11:21:08 GMT Philip 'Yes, that's my address' Newton wrote:
> 
> (And you did know that you can quote wildcards to hide them from the
> shell, didn't you? I know I always do with commands such as find for
> this reason, e.g. find / -name '*.o' rather than just *.o. But maybe
> that's just me.)
> 

No I'm with you on that ...  Although find will work without the single
quotes if *no* files in the current directory match the wildspec.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 27 Jun 1999 11:07:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive   directories
Message-Id: <37765a44@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Jonathan Stowe <gellyfish@gellyfish.com> writes:
:No I'm with you on that ...  Although find will work without the single
:quotes if *no* files in the current directory match the wildspec.

That's shell dependent.

--tom
-- 
 "VAX. For those who care enough to steal the very best."
     -- A microscopic message on the silicon chip inside
	one of Digital Equipment's often stolen computer designs.


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

Date: Sun, 27 Jun 1999 18:53:35 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Command line parameters / Wildcard characters / Recursive   directories
Message-Id: <3776727a.260979610@news.nikoma.de>

On 27 Jun 1999 12:01:53 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>On Sun, 27 Jun 1999 11:21:08 GMT Philip 'Yes, that's my address' Newton wrote:
>> 
>> (And you did know that you can quote wildcards to hide them from the
>> shell, didn't you? I know I always do with commands such as find for
>> this reason, e.g. find / -name '*.o' rather than just *.o. But maybe
>> that's just me.)
>
>No I'm with you on that ...  Although find will work without the single
>quotes if *no* files in the current directory match the wildspec.

I know, but I don't want to depend on that. (And often, I want to see
"where in the directory tree are there files that also exist in the
current directory and match a certain pattern", and so any wildcards
*would* be expanded.)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: Sun, 27 Jun 1999 13:05:06 -0400
From: Lane Rettig <lane@rettig.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive  directories
Message-Id: <377659C2.B123A12E@rettig.com>

<Message mailed to author and posted to newsgroup - comp.lang.perl.misc>

> Other command
> line utilities such as 'rm' can apply a given wildcard string
> recursively down directories (such as rm -rf *.html would delete all
> 'html' files in the current directory and every subdirectory of the
> current directory).

This isn't true.  If you called "rm -rf *.html" in a directory
containing html files, and containing directories containing further
html files, only the html files in the current directory would be
deleted.  The wildcard is expanded by the shell, and rm never sees it.

> It would seem to me with perl's slant towards
> text processing that someone would have had to deal with this issue
> before and that is why I posted hoping that a nice solution already
> existed.

One thing off the top of my mind is to KILL THE WILDCARD.  Have your
program called as "myScript -r .html", causing the program to remove all
html files in the current directory and all recursive directories.  The
program can add the wildcard to the glob itself.

-- 
Lane "Sandman" Rettig <lane@rettig.com>

"To punish me for my contempt for authority,
 Fate made me an authority myself." - Albert Einstein


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

Date: Sun, 27 Jun 1999 09:18:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Comparing two associative arrays
Message-Id: <MPG.11dfee9334903cf2989c58@nntp.hpl.hp.com>

In article <3776426b.3875343@news.skynet.be> on Sun, 27 Jun 1999 
15:27:49 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Rick Delaney wrote:
> >Okay, now explain the part where if %hash1 has all the same entries as
> >%hash2, %hash1 in list context will produce those elements in the same
> >order as %hash2 in list context.
> 
> Because to the human beholder, the order of the keys LOOKS random, but
> in fact it is not. The exact order is determined by the hashing
> function. "Pseudo-random" is more like it. Therefore, if all keys are
> identical, their order (in "foreach (keys %hash)", for example) will be
> the same, too.

I'm not convinced by this argument.  Suppose, for example, that the two 
hashes were initialized (by keys()) to different sizes and populated in 
different sequences.  Where is the guarantee that the hashing function 
will cause retrieval in the same order for each hash?

Certainly nothing like that is documented, in any case.  So relying on 
it fatuous, at best.

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


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

Date: Sun, 27 Jun 1999 18:09:59 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Comparing two associative arrays
Message-Id: <377668B8.EB9FDA96@home.com>

[posted & mailed]

Larry Rosler wrote:
> 
> I'm not convinced by this argument.  Suppose, for example, that the two
> hashes were initialized (by keys()) to different sizes and populated in
> different sequences.  Where is the guarantee that the hashing function
> will cause retrieval in the same order for each hash?

I'm not convinced either but I've not been able to produce a
counter-example.

> Certainly nothing like that is documented, in any case.  So relying on
> it fatuous, at best.

True, but if Bart is correct and this is reliable then the documentation
should be fixed.  If this is a feature then let's see it documented.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sun, 27 Jun 1999 18:30:43 GMT
From: Kenneth Rose <kenrose@home.com>
Subject: floor and ceil
Message-Id: <37766DBB.316C14F0@home.com>

Hi everyone,

Just wondering if such functions exist: floor and ceil.  Floor would
return the greatest integer less than or equal to the argument.  Ceil
would return the least integer greater than or equal to the argument.

Thanks all!

/<en


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

Date: Sun, 27 Jun 1999 18:50:31 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: floor and ceil
Message-Id: <3776723E.4DD0234@home.com>

[posted & mailed]

Kenneth Rose wrote:
> 
> Just wondering if such functions exist: floor and ceil.

Well, did you find them in perlfunc?  All Perl functions are documented
there.  If you don't find them there, then maybe you should check the
FAQ to see if there's any way to get their behaviour.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sun, 27 Jun 1999 17:03:51 GMT
From: Stephen Pandich <pandich@my-deja.com>
Subject: Re: How to store hashes
Message-Id: <7l5lhi$qsu$1@nnrp1.deja.com>


> I want to store hashes in a file. What's the best way to do this? I'm
> fairly new to Perl, and I haven't found a good beginner document for
> perl yet (the documentation which came with ActiveState Perl for Win32
> is hard to use).

I have written a pretty good, though not heavily tested by other
people, solution to this kind of a problem.

I was looking around and did not find anything that could support
complex data structures (like hashes of hashes etc.), so I tried to
write my own.

Probably it has already been done, but I couldn't find it in time to
solve my problem.

If you want to look at it, it is part of Net::RMI which is under:

ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Net/


In the Net::RMI module there are serialize and deserialize methods.
Once you serialize and object, it comes back as a scalar, then you can
just write it to disk with a single print statement to a file.

You can then just read it back in and pass it to the deserialize method.

Hope this helps.

-Steve

------------------
Stephen Pandich
steve@pandich.com
www.pandich.com
"First there were vanity plates...now this!" - me


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 27 Jun 1999 21:39:27 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: In Mountain View did Larry Wall
Message-Id: <oeeogi1ebds.fsf@alpha.hut.fi>


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

> [Posted and a courtesy copy sent.]
> 
> In article <7l3nvc$54t$1@gellyfish.btinternet.com> on 26 Jun 1999 
> 23:33:00 -0000, Jonathan Stowe <gellyfish@gellyfish.com> says...
> > On 26 Jun 1999 16:45:41 -0700 Tom Christiansen wrote:
> > > In Mountain View did Larry Wall
> > >     Sedately launch a quiet plea:
> > 
> > The lawyers of The Estate of Percy Bysshe Shelly will be contacting you ..
> 
> Oh, my.  What happened to the much-vaunted English education system?
> 
> Samuel Taylor Coleridge
> 
> 
> 
> Kubla Kahn

Kahn?

> (or, A Vision in a Dream)
> 
>      In Xanadu did Kubla Kahn

Kahn?

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Sun, 27 Jun 1999 15:45:57 GMT
From: Olindo <olindo@my-deja.com>
Subject: looking for a free meta search type script
Message-Id: <7l5gvj$pi3$1@nnrp1.deja.com>

Does anyone know of a free cgi script that acts like Dogpile or Savy
Search that searches the major search engines and outputs the results?



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sun, 27 Jun 1999 12:24:58 -0700
From: "Wendell Crenshaw" <crensw@yahoo.com>
Subject: MySQL vs Oracle
Message-Id: <casd3.190$6J4.357@news.ipass.net>

Hi all:

I'm new to Perl, and I need to develop dynamic pages with Perl on Unix that
utilize an Oracle database.  I'm having a problem finding a reasonable cost
hosting service that offers Oracle, so I'm considering using MySQL - and I'm
wondering how much syntax difference there is between Oracle and MySQL when
you consider writing web pages that do simple data chores, such as
add/change/delete records in the data base.  Can anyone share insight?  I'm
hoping the only difference is in the connection string to the data base!!!

As a bonus question, can anyone point me to a "Unix / Sun Solaris 2.6 /
Netscape 3.6 / Perl 5" commercially available web hosting service?

Cheers!

Wendell Crenshaw






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

Date: Sun, 27 Jun 1999 18:30:52 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Removing spaces from string
Message-Id: <37762ed4.243658805@news.nikoma.de>

On Sun, 27 Jun 1999 15:16:48 +0200, "Eric v.d. Lugt"
<vdlugt@kabelfoon.nl> wrote:

>Does anyone know how to remove space withing a sting?

Yes.

>$klaas = "mm 11 2 244";
>
>should become
>
>"mm112244";

perldoc -f tr, paying special attention to the /d option

>please CC to vdlugt@kabelfoon.nl

No.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: Sat, 26 Jun 1999 22:19:20 +0200
From: Shaw Kaake <shaw@active.ch>
Subject: Re: spawning on the left side of the assignment, or something like  that....
Message-Id: <377535C8.7331AA04@active.ch>



Tom Christiansen wrote:

>      [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
>     Shaw Kaake <shaw@active.ch> writes:
> :I am new to perl.  My task is as follows, I have a database with
> :currently 25 language translations of my product catalog text matched
> :with variable names in comma delimited format. (varName,Country,Text)
>
> That's not comma-delimited.  It's parenthesis-delimited.
> It's comma-separated.

Thank you for the response Tom.   I should have been clear on the data
structure, I put in the parens for the english sentence.  The actual data
structure comes from an Excel spreadsheet in a .csv format called comma
delimited format by Excel. It has no parens and looks like:

intro,france,"French text here"
intro,italy,"Italian text here"
intro,usa,"United States text here"

and so on..............

I will study the FAQ, thanks again.

Shaw Kaake



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

Date: Sun, 27 Jun 1999 16:22:23 +0000
From: GiN <Ch1ckEn@hotmail.com>
Subject: TIMEOUT
Message-Id: <37764FBF.F54406E@hotmail.com>

i have a question:

i opened i socket S

and i expect a line:        $line = <S>;
but when the line doesn't come (a timeout) then: $line = "timeout\n";

how do i do this?

thanks advanced!

Gin



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

Date: 27 Jun 1999 18:33:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <7l5qq4$6am$1@gellyfish.btinternet.com>

On Sun, 27 Jun 1999 07:18:33 -0700 Ook! wrote:
> In article <1du1d3a.dm04s6p601boN@p11.tc2.metro.ma.tiac.com>,
> rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
> 
>  >>I wonder if that clause could have been rephrased:
>  >>
>  >>such as vi, awk, sed, the Bourne and C shells, and the various GNU
>  >>application programs.
>  >>
>  >>and still meant what the original author intended...
> 
> Well, yes, of course that's what I meant, but the pedant was more
> interested in proving what a clueless wanker he was than say, enlightening
> the original poster. Little johnnie musta had a bad night and wet his bed
> again.
 

Welcome to the Hall Of Flame fool,  Your pathetic outburst has been
recorded for all to read at <http://www.gellyfish.com/flames/> wherein
will be documented every useless spouting of your sort - please feel
free to contribute further to this archive.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 27 Jun 1999 13:24:30 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: Viral matters [completely off-topic]
Message-Id: <37765E4E.D83C44D@prism.gatech.edu>

Tom Christiansen wrote:
> 
> VIRI?  Look like you didn't read
> 
>    http://language.perl.com/misc/virus.html
> 
> Yet. :-)
> 
> --tom


Good grief, what's _that_ doing at language.perl.com?  Are the perldocs
turning into the Hitchhiker's Guide to the Galaxy?





--
 andy barfoot


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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