[15439] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2849 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 23 21:08:51 2000

Date: Sun, 23 Apr 2000 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956538307-v9-i2849@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 23 Apr 2000     Volume: 9 Number: 2849

Today's topics:
        Archiving emails for later Web browsing <unixman@cfl.rr.com>
        basic number parsing question  <chris@aol.com>
    Re: basic number parsing question  <rootbeer@redcat.com>
    Re: basic number parsing question prakash_ojha@my-deja.com
    Re: basic number parsing question prakash_ojha@my-deja.com
        Compiling Perl <rmb34@mindspring.com>
    Re: Compiling Perl (Craig Berry)
    Re: DBI::ODBC arguments for Supra database client drive (William Herrera)
    Re: emulate a browser <jeff@vpservices.com>
    Re: executing sub in a module without calling it nobull@mail.com
    Re: executing sub in a module without calling it nobull@mail.com
    Re: executing sub in a module without calling it <uri@sysarch.com>
        Help  with split please - or maybe split isn't correct <neal@arkmola.net>
    Re: Help  with split please - or maybe split isn't corr <jeff@vpservices.com>
        how to rate the search results... hamed53@my-deja.com
    Re: how to rate the search results... <rootbeer@redcat.com>
    Re: If Statement <todd@mrnoitall.com>
        NT perl script <wrobelly@msu.edu>
    Re: NT perl script (Kragen Sitaker)
    Re: NT perl script <wrobelly@msu.edu>
    Re: NT perl script <jeff@vpservices.com>
        Perl course manual available jayshred@my-deja.com
    Re: Perl for Mac Server via Quid Pro Quo <ben@leedsnet.com>
        Perl vs Java <akil1@mindspring.com>
    Re: Perl vs Java <rootbeer@redcat.com>
    Re: Perl vs Java <akil1@mindspring.com>
    Re: problems with spaces in filenames <ben@leedsnet.com>
    Re: problems with spaces in filenames (Kragen Sitaker)
    Re: purpose of use vars ()  ? <schan_ca@geocities.com>
        qq() for java? yctao@my-deja.com
    Re: qq() for java? lcerqueira@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 23 Apr 2000 18:09:34 GMT
From: "UnixMan" <unixman@cfl.rr.com>
Subject: Archiving emails for later Web browsing
Message-Id: <y%GM4.4151$4C3.30764@typhoon.tampabay.rr.com>

I want to create a perl script that will add any incoming emails to a
database that will be browseable/searchable on the web. I just need to know
how the relationship is set between an email and a reply to it. In other
words, when you reply to an email, is there any "flag" (other that leaving
the Re: + original subject) that will "bind" those two messages as original
amd reply?

Thanks in advance!!

-
dd




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

Date: Sun, 23 Apr 2000 17:56:13 -0700
From: chris <chris@aol.com>
Subject: basic number parsing question 
Message-Id: <39039BAD.E127FA25@aol.com>

if I have a date stored in variable $date and it is equal to "20000423"
(todays date) how can I store only the last 2 digits (the day of the
month) in a new variable? in this
example I want the new variable to be equal to "23"



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

Date: Sun, 23 Apr 2000 17:28:28 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: basic number parsing question 
Message-Id: <Pine.GSO.4.10.10004231725090.25963-100000@user2.teleport.com>

On Sun, 23 Apr 2000, chris wrote:

> if I have a date stored in variable $date and it is equal to
> "20000423" (todays date) how can I store only the last 2 digits (the
> day of the month) in a new variable?

You could use the substr() function, or a pattern match, among many other
ways. You should find either of those methods covered in any introductory
book on Perl. Of course, if you really want the current date, perhaps you
should be using localtime(). Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 24 Apr 2000 00:34:08 GMT
From: prakash_ojha@my-deja.com
Subject: Re: basic number parsing question
Message-Id: <8e04pv$vmc$1@nnrp1.deja.com>

In article <39039BAD.E127FA25@aol.com>,
  chris <chris@aol.com> wrote:
> if I have a date stored in variable $date and it is equal to
"20000423"
> (todays date) how can I store only the last 2 digits (the day of the
> month) in a new variable? in this
> example I want the new variable to be equal to "23"


use something like this

$s = substr($date, -2,2) this will grab the last two character and put
it in $s. hope that helps.

Prakash


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


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

Date: Mon, 24 Apr 2000 00:35:22 GMT
From: prakash_ojha@my-deja.com
Subject: Re: basic number parsing question
Message-Id: <8e04s9$vo1$1@nnrp1.deja.com>

In article <39039BAD.E127FA25@aol.com>,
  chris <chris@aol.com> wrote:
> if I have a date stored in variable $date and it is equal to
"20000423"
> (todays date) how can I store only the last 2 digits (the day of the
> month) in a new variable? in this
> example I want the new variable to be equal to "23"
>
>

use $s= substr($date, -2, 2)  it will return the last two characters in
$s. hope that helps

prakash


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


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

Date: Sun, 23 Apr 2000 16:40:30 -0400
From: "RMB" <rmb34@mindspring.com>
Subject: Compiling Perl
Message-Id: <8dvqk4$ihm$1@slb0.atl.mindspring.net>

This is a semi-newbie question.

Can you compile Perl on a Win9x machine? If so, what software do you use to
compile.

And when you do compile (assuming you can), does it become a complete exe?
Or does it still require the interpreter?

I want to do something in Perl and be able to run it on different machines.
But I don't want to have to install a Perl Interpreter on every one.

Just wondering,

Ryan




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

Date: Sun, 23 Apr 2000 22:50:18 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Compiling Perl
Message-Id: <sg6vha7vl6e80@corp.supernews.com>

RMB (rmb34@mindspring.com) wrote:
: Can you compile Perl on a Win9x machine? If so, what software do you use to
: compile.

You can, but it's a lot easier to user the ActiveState binary
distribution.

: And when you do compile (assuming you can), does it become a complete exe?
: Or does it still require the interpreter?

Oh, you mean compile Perl *programs*.  Yes, you can, and (if it works) the
resulting programs are standalone -- though they actually contain the
entire interpreter as embedded code.

: I want to do something in Perl and be able to run it on different machines.
: But I don't want to have to install a Perl Interpreter on every one.

Given the current state of Perl->exe technology, doing that is probably
still the less painful choice.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: Sun, 23 Apr 2000 22:37:15 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: DBI::ODBC arguments for Supra database client driver ?
Message-Id: <39037a03.421342666@news.rmi.net>

On Sun, 23 Apr 2000 07:58:32 -0700, Tom Phoenix <rootbeer@redcat.com> wrote:

>On Fri, 21 Apr 2000, William Herrera wrote:
>
>> Does anyone know the syntax for the Supra driver used for access to an
>> HP/UX database running one of Cincom corporation's SQL database
>> servers?
>
>Perhaps you should try to find the documentation for one of those non-Perl
>things. Cheers!
>
>-- 

The docs for the driver were written in 1997 and include stuff for C, Fortran,
Cobol, and Pascal. No Perl. 

Thanks Tom, but frankly, the reason I quoted the documentation in my question
was to if possible avoid the "why don't you read the docs" type responses. I am
hoping somebody has done this before and can just quote a single line of code
here, so I don't have to finally get it by trial and error. I have not gotten a
reply back from Cincom support either.


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Sun, 23 Apr 2000 14:38:21 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: emulate a browser
Message-Id: <39036D4D.8BA3DBDE@vpservices.com>

Jonah wrote:
> 
>Jeff Zucker wrote:
> >
> > Ignoring threading bad. 
> >
>
> should have read a faq on usenet, sorry.

No probelm, was only pointing it out for future reference. (But reading
a usenet faq *is* a good idea.)

> But LWP returns the reponse, and I'm not sure if that would be ok if x
> script happen to be processing an order....
> 
> I just want to write data to a file before the form gets processed by x
> script, without having
> to interfere with the x script in any way.

Ok, let me paraphrase:

1. user submits form

2. script A gets data from form

3. script A writes data from form to database

4. script A sends data from form off to process B

5. process B processes data and returns a success or failure code to
script A

6. based on the value of that code, script A writes a "request
completed" or a "could not complete your request" message to user

Several issues here:  If process B is a CGI script that expects to
recieve form data, then LWP is a good way to pass it information on step
4.  If it is some other kind of process, then you may be  better off
decoding the form data in script A and passing it as parameters through
one of Perl's system functions (exec, system, qx(), backticks, depending
on your needs).  If process B either doesn't return a sucess/failure
code (how impolite) or if it is a process that runs a long time, you may
not want to wait for it to complete and instead have script A just send
the data to process B, write a "request submitted" message to the user,
and end.

> I don't like how it [LWP] returns ..... (control?) back to my script....I want
> to just do my thing then send the data from the form off on it's merry way
> I don't think I want my script to have control when it's an order form...
> it just doesn't seem like the right thing to do.

When script A waits for an LWP response from process B, it does not
"have control" over process B.  It is just waiting until process B
returns something.

> > > read (STDIN, $content, $ENV{'CONTENT_LENGTH'});
> > > &parseform;
> >
> > Throw that away and use CGI.pm.
> >
> I see so many scripts parse forms like in my example
> that I thought it was ok.

We have a name for such scripts: cargo cult.  They are perpetuated by
people who inherit scripts form others and use them without really know
what the parts do.  I've done that myself, we probably all have.  But I
try to remember which parts I don't know about and learn about them. 
That particular snippet has been discussed many times on this newsgroup
- check the archives.  You'll find that it is possible to use something
similar safely but it requires some knowledge.  CGI.pm protects you
against this and many other common errors.
 
> That's the one thing I hate about perl, you never know if you're
> doing something wrong. 

That is kinda true.  The upside is TMTOWTDI - there's more than one way
to do it.  You don't necessarily know which way is best, but you have
options each of which may be best in its own context.  Generally the
modules that come with Perl and those that are repeatedly recommended
here can be counted on to be there for a reason.  CGI.pm is both.

> I guess I should buy the camel books,
> or take CGI.pm more seriously, or both.

I'd say both are a good idea.

-- 
Jeff


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

Date: 23 Apr 2000 18:51:14 +0100
From: nobull@mail.com
Subject: Re: executing sub in a module without calling it
Message-Id: <u9og70n1t9.fsf@wcl-l.bham.ac.uk>

"Dimitri Ostapenko" <dimitrio@perlnow.com> writes:

> I need to run init sub in a package every time this package is loaded.
> 
> Is there way to do it?

BEGIN { init(); }

If when you say "package" you really mean "module" then you may also
overload the import() method which may or may not be more appropriate
to your needs.

For details: perldoc perlmod

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


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

Date: 23 Apr 2000 18:59:02 +0100
From: nobull@mail.com
Subject: Re: executing sub in a module without calling it
Message-Id: <u9n1mkn1g9.fsf@wcl-l.bham.ac.uk>

Tony Curtis <tony_curtis32@yahoo.com> writes:

> perldoc perlmod would be a good place to look for some
> info, especially about BEGIN, or possibly INIT, blocks (if
> I interpret your situation correctly).

I'd suggested BEGIN, I'd never heard of INIT.  Is INIT a new 5.6
feature?  There's no mention of it in the 5.5 (pl3) perlmod page.

I know 5.6 is "officially" stable but many people (myself included)
don't use it yet.  I think that people should make clear when they are
talking about functionality that is absent (or undocumented) prior to
5.6.


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


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

Date: Sun, 23 Apr 2000 18:59:09 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: executing sub in a module without calling it
Message-Id: <x74s8s63us.fsf@home.sysarch.com>

>>>>> "n" == nobull  <nobull@mail.com> writes:

  n> Tony Curtis <tony_curtis32@yahoo.com> writes:
  >> perldoc perlmod would be a good place to look for some
  >> info, especially about BEGIN, or possibly INIT, blocks (if
  >> I interpret your situation correctly).

  n> I'd suggested BEGIN, I'd never heard of INIT.  Is INIT a new 5.6
  n> feature?  There's no mention of it in the 5.5 (pl3) perlmod page.

grep -w INIT *.pod
perldelta.pod:have very little impact on compatibility.  See L<New C<INIT> keyword>,
perldelta.pod:=head2 New C<INIT> keyword
perldelta.pod:C<INIT> subs are like C<BEGIN> and C<END>, but they get run just before
perldelta.pod:C<INIT> blocks to initialize and resolve pointers to XSUBs.
perlfunc.pod:the C<eval ''>, C<BEGIN {}>, C<END {}>, and C<INIT {}> constructs.
perlsub.pod:functions mentioned in L<perltie>.  The 5.005 release adds C<INIT>
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
<more snipped>

INIT is like BEGIN but it executes AFTER compile time is done and BEFORE
runtime starts. BEGIN executes when it is loaded at compile time.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sun, 23 Apr 2000 11:24:34 -0500
From: "Neal" <neal@arkmola.net>
Subject: Help  with split please - or maybe split isn't correct
Message-Id: <sg6r9noil6e103@corp.supernews.com>

Hi all,
    I have came across a dilemma that I haven't figured out yet.

I have some data
"01 2334567","04/12/1999",4.56,7.98,56,789.00,"This is a comment","This is
another, comment",456,N

And others like this in a file.

I need to separate it and get the "04/12/1999" and the 456 and if I split it
on the comma, thing go wacky and I can't reference specific fields in an
array to get
my values.

How can I split the above data line into an array with the following

some_array[0]     =    "01 2334567"
some_array[1]    =    "04/12/1999"
some_array[2]    =    4.56
some_array[3]    =    7.98
some_array[4]    =    56,789.00
some_array[5]    =    This is a comment
some_array[6]    =    This is another, comment
some_array[7]    =    456
some_array[8]    =    N

Any help would be appreciated,

Jack




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

Date: Sun, 23 Apr 2000 15:05:00 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help  with split please - or maybe split isn't correct
Message-Id: <3903738C.4BACDACB@vpservices.com>

Neal wrote:
> 
> Hi all,
>     I have came across a dilemma that I haven't figured out yet.
> 
> I have some data
> "01 2334567","04/12/1999",4.56,7.98,56,789.00,"This is a comment","This is
> another, comment",456,N
> 
> And others like this in a file.
> 
> I need to separate it and get the "04/12/1999" and the 456 and if I split it
> on the comma, thing go wacky and I can't reference specific fields in an
> array to get
> my values.

The format you are describing is technically known as CSV (Comma
Separated Values) format.  One of the problems with parsing it is that
it may contain commas inside fields as well as commas that separate
fields and records.  There are several modules that can correctly parse
this kind of data.    Text::CSV_XS and Text::ParseWords will both parse
the lines.  DBD::CSV and DBD::RAM will allow you to treat files with
that kind of data as databases and manipulate them with Structured Query
Language.  If you are going to do things like searching and sorting the
files, you may be better off taking one of these database approaches.

For simply parsing the line, this takes your string above and parses it
into an array of fields, correctly ignoring the comma that is inside the
quotation marks:

    use Text::ParseWords;
    my @fields =  Text::ParseWords::parse_line( ',', 0, $str );

There is also further information about this problem in the perlfaq4 FAQ
section, titled
"How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)"

-- 
Jeff


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

Date: Mon, 24 Apr 2000 00:23:06 GMT
From: hamed53@my-deja.com
Subject: how to rate the search results...
Message-Id: <8e044t$urt$1@nnrp1.deja.com>

hi

I was wondering if anyone knows how to rate the search results, like
excite.com has done...

for example if you search anything, dependant to the results the rate
varies from 100% to lower... you can see the demo at the excite's
search engine, just search for a word... thats explains it all

Thanks for your help everyone...
hamed


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


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

Date: Sun, 23 Apr 2000 17:42:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how to rate the search results...
Message-Id: <Pine.GSO.4.10.10004231735350.25963-100000@user2.teleport.com>

On Mon, 24 Apr 2000 hamed53@my-deja.com wrote:

> I was wondering if anyone knows how to rate the search results, like
> excite.com has done...

Yes; the people at excite.com seem to know. :-)

If you want to make your own program that does something similar, you
should probably find and implement a suitable algorithm. You may or may
not choose to implement it in Perl. If you do choose to implement one in
Perl, and you run into difficulties not covered in the documentation,
please feel free to ask again here.

Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sun, 23 Apr 2000 12:35:22 -0600
From: Todd Anderson <todd@mrnoitall.com>
Subject: Re: If Statement
Message-Id: <39034168.6CD10C57@mrnoitall.com>



Anne Smith wrote:

> I am wondering if anyone can help.
>
> I am trying to validate a text field whether a user has entered any data or
> not.
>
> I am using the syntax  if (FORM_DATA {'firstname'} eq "")
>     print " Incorrect firstname";
>
> I thought that the "" would mean that the user has entered no data, but the
> system is using this in the meaning that the user has entered some data.
>
> Does anyone know what the correct operator is for empty data.
>
> Please email to anne.smith@lineone.net

Try...
if ($FORM_DATA{'firstname'} eq ""){
    print " You Dumb Ass";
}



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

Date: Sun, 23 Apr 2000 16:00:28 -0400
From: Lydia Wrobel <wrobelly@msu.edu>
Subject: NT perl script
Message-Id: <wrobelly-CE7997.16002823042000@news.msu.edu>

Hi, I found this message from a guy who posted in in 1995:

>>>>
Subject: ntPERL script
Date: 06/22/1995
Author:  Dale Ross <dale@edison.nmhu.edu>
   << previous in search  ·  next in search >> 

I am trying to submit a FORM and using PERL to extract the
info, can't even get the data to write to a file or to be
sent as mail. I can get the script to compile with no errors,
but I am just not sure of the proper (NT?) syntex or command
I should be using for $mailprog or $recipient that I should be
using on my ver. 3.5 NT box.  Any help would be appreciated.
Many Thanks...
>>>>>

I am now having the same problem. I have a form on my Web site that uses 
a perl script to send the info people fill in the form to my email 
address. But, the script has default directory paths for Unix servers, 
not NT servers, which is what my site's hosted on. Does anyone know how 
sendmail works on NT servers? Like what the directory paths should be? 
Right now, the script is set for /usr/bin/perl and /usr/lib/sendmail

I've also heard you need to use a totally different mail program on NT 
servers... is this true?

Thanks,
Lydia Wrobel
wrobelly@msu.edu


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

Date: Sun, 23 Apr 2000 21:07:36 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: NT perl script
Message-Id: <sCJM4.286$18.46448@news-east.usenetserver.com>

In article <wrobelly-CE7997.16002823042000@news.msu.edu>,
Lydia Wrobel  <wrobelly@msu.edu> wrote:
>I've also heard you need to use a totally different mail program on NT 
>servers... is this true?

More or less.  There are modules to make your life easier.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either.  :)


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

Date: Sun, 23 Apr 2000 16:38:02 -0400
From: Lydia Wrobel <wrobelly@msu.edu>
Subject: Re: NT perl script
Message-Id: <wrobelly-32C941.16380223042000@news.msu.edu>

In article <sCJM4.286$18.46448@news-east.usenetserver.com>, 
kragen@dnaco.net (Kragen Sitaker) wrote:

> In article <wrobelly-CE7997.16002823042000@news.msu.edu>,
> Lydia Wrobel  <wrobelly@msu.edu> wrote:
> >I've also heard you need to use a totally different mail program on NT 
> >servers... is this true?
> 
> More or less.  There are modules to make your life easier.

What are those modules and where can I find them with documentation?


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

Date: Sun, 23 Apr 2000 14:47:35 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: NT perl script
Message-Id: <39036F77.A6C08046@vpservices.com>

Lydia Wrobel wrote:
> 
> In article <sCJM4.286$18.46448@news-east.usenetserver.com>,
> kragen@dnaco.net (Kragen Sitaker) wrote:
> 
> > In article <wrobelly-CE7997.16002823042000@news.msu.edu>,
> > Lydia Wrobel  <wrobelly@msu.edu> wrote:
> > >I've also heard you need to use a totally different mail program on NT
> > >servers... is this true?
> >
> > More or less.  There are modules to make your life easier.
> 
> What are those modules

There are a whole group of them under the Mail:: hierarchy of modules. 
For example, Mail::Mailer and Mail::Sendmail.

> and where can I find them with documentation?

CPAN is the mirrored archive that contains almost all Perl modules. 
Start at www.cpan.org and follow the blinking lights to the closest
archive to you.  The documentation is included in the downloads and can
also be read online on CPAN as well as shorter descriptions of the
modules.

For example,
http://www.cpan.org/modules/00modlist.long.html#19)MailandUsene, lists
Mail::Sendmail as "Simple platform independent mailer".

-- 
Jeff


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

Date: Sun, 23 Apr 2000 18:34:25 GMT
From: jayshred@my-deja.com
Subject: Perl course manual available
Message-Id: <8dvfnh$9rt$1@nnrp1.deja.com>

If anyone is interested in getting the Perl manual and diskette from the
Learning Tree course, feel free to check out
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=315572825

Thanks.


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


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

Date: 23 Apr 2000 20:00:14 GMT
From: <ben@leedsnet.com>
Subject: Re: Perl for Mac Server via Quid Pro Quo
Message-Id: <8dvkoe$cj4$1@supernews.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Douglas S. Davis wrote:

>>I don't know if this is the best place to ask this, but is it possible

Maybe it is, may be it isn't, but it is always good in this
group to mention where you have looked. A lot of people have
diverse occupations and are keen to know of good places to
look for solutions to problems that they have yet to have.

>>to run Perl cgi's on a Mac/Quid Pro Quo server?  The built in CGI
>>support seems to be for some type of Apple applets.  I checked several
>>other places before asking.  If you don't know, maybe you can point me
>>in the right direction.

The built-in support is as you say.

> Go to one of MacPerl's mailing list. The list is on <www.macperl.org>.
> There's a specific mailing list for CGI, so it'd be best to go there:
> <macperl-webcgi@macperl.org>. The generic list, <macperl@macperl.org> is
> a second choice, if you don't know what other list to pick.

> I don't use a Mac for Internet, but I think you should try saving your
> script, from within MacPerl, as a CGI script. It's one of the dropdown
> options in the "save as" dialog.

> -- 
> 	Bart.

Excellent advice (of course).

It strikes me that you are looking for information on running
MacPerl scripts on a server, so you might want to try a URL
near:

< URL:http://www.deja.com/=dnc/[st_m=ps]dnquery.xp?ST=PS&QRY=information+macperl+scripts+server&defaultOP=AND&DBS=1&format=terse&showsort=score&maxhits=25&LNG=ALL&subjects=&fromdate=&todate= >

(Typed in, I'm afraid, but you get my drift).

Ben.




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

Date: Sun, 23 Apr 2000 17:54:12 -0400
From: "Kevin Bass" <akil1@mindspring.com>
Subject: Perl vs Java
Message-Id: <8dvrka$2a7$1@slb6.atl.mindspring.net>

What are the advantages and/or disadvantage of using Perl as opposed to
Java?  I am evaluating Perl and Java for performing  systems development and
administration task.

Kevin




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

Date: Sun, 23 Apr 2000 16:11:56 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl vs Java
Message-Id: <Pine.GSO.4.10.10004231601000.25963-100000@user2.teleport.com>

On Sun, 23 Apr 2000, Kevin Bass wrote:

> What are the advantages and/or disadvantage of using Perl as opposed
> to Java?

Please use a Usenet archive (such as Deja) to see what has been said when
this has come up in the past.

    http://www.deja.com/

Also see the "Perl versus..." page.

    http://www.perl.com/pub/language/versus

If, after seeing these other resources, you then have something new to ask
or add, feel free to post here. Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sun, 23 Apr 2000 20:14:46 -0400
From: "Kevin Bass" <akil1@mindspring.com>
Subject: Re: Perl vs Java
Message-Id: <8e03vl$kut$1@slb2.atl.mindspring.net>

Thanks.  I found alot of information on this topic using www.deja.com.

Kevin


Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.10004231601000.25963-100000@user2.teleport.com...
> On Sun, 23 Apr 2000, Kevin Bass wrote:
>
> > What are the advantages and/or disadvantage of using Perl as opposed
> > to Java?
>
> Please use a Usenet archive (such as Deja) to see what has been said when
> this has come up in the past.
>
>     http://www.deja.com/
>
> Also see the "Perl versus..." page.
>
>     http://www.perl.com/pub/language/versus
>
> If, after seeing these other resources, you then have something new to ask
> or add, feel free to post here. Thanks!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: 23 Apr 2000 20:11:07 GMT
From: <ben@leedsnet.com>
Subject: Re: problems with spaces in filenames
Message-Id: <8dvlcr$cj4$2@supernews.com>

Larry Rosler <lr@hpl.hp.com> wrote:
> In article <u9d7nj1ep6.fsf@wcl-l.bham.ac.uk> on 21 Apr 2000 19:39:17 
> +0100, nobull@mail.com <nobull@mail.com> says...

> ...

>> I believe you can say:
>> 
>> system("\"c:/program files/fred.exe\" $arg1 $arg2");

> Yes, you can; and you can do it even nicer by using alternate quotes 
> qq{} instead of those backslashes.

Apologies for butting in, but could I ask that the OP reports
back whether this works. I have tried to do something
similar, and whilst quoting the spaces appears to work, once you
start putting this files in lists, or globbing, it crumbles
into a bit of a mess. Most Perl (and shell) scripts get
written with an assumption that filenames can be delimited
by spaces.

Grateful for pointers to the contrary.

Ben.


















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

Date: Sun, 23 Apr 2000 22:03:38 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: problems with spaces in filenames
Message-Id: <_qKM4.480$18.107671@news-east.usenetserver.com>

In article <8dvlcr$cj4$2@supernews.com>,  <ben@leedsnet.com> wrote:
>Apologies for butting in, but could I ask that the OP reports
>back whether this works. I have tried to do something
>similar, and whilst quoting the spaces appears to work, once you
>start putting this files in lists, or globbing, it crumbles
>into a bit of a mess. Most Perl (and shell) scripts get
>written with an assumption that filenames can be delimited
>by spaces.
>
>Grateful for pointers to the contrary.

Shell scripts are a major problem --- I try very hard to avoid this
problem, but there are some cases where you just can't.

Perl scripts are another matter entirely.  I don't believe I have ever
written a Perl script that assumed filenames didn't have spaces in
them, except when passing them to open() (which gets irritated if your
filename begins with whitespace) or system().  Even Perl's globbing
doesn't get confused when you have filenames with spaces in them (at
least on my ISP's machine.)

What kinds of Perl constructs have you seen that break in new ways on
filenames with spaces?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either.  :)


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

Date: Sun, 23 Apr 2000 21:23:52 GMT
From: steve <schan_ca@geocities.com>
Subject: Re: purpose of use vars ()  ?
Message-Id: <39036B34.AF3B56C4@geocities.com>

I think I have it now, but it introduce another question.
Since you  "use vars qw($yo) " to be visible outside
" package aaa ", does that " $yo " variable pollute the
calling script's namespace?

Thanks
Steve

=======================================

msouth@fulcrum.org wrote:

> To summarize:
>
> In file 'fileaaa', if you have
>
>     package aaa;
>     use strict;
>
>     use vars qw($yo);
>     my $ya;
>
>     $yo = 1;  # that's really $aaa::yo, visible outside
>     $ya = 2;  # that's not $aaa::ya, and not visible outside
>
>     sub foo {
>         print "yo is $yo, ya is $ya\n";
>     }
>     1;
>
> Then in file 'useaaa.pl' you have
>
>         #!/usr/bin/perl -w
>         use strict;
>         require 'fileaaa';
>
>         print "aaa::yo is $aaa::yo \n";
>         print "aaa::ya is $aaa::ya \n";
>
>         print "here's what &aaa::foo says:\n";
>
>         &aaa::foo();
>
> the output is:
>
>         Name "aaa::yo" used only once: possible typo at useaaa.pl line 5.
>         Name "aaa::ya" used only once: possible typo at useaaa.pl line 6.
>         aaa::yo is 1
>         Use of uninitialized value at useaaa.pl line 6.
>         aaa::ya is
>         here's what &aaa::foo says:
>         yo is 1, ya is 2
>
> See how $aaa::ya gives you an unitialized value warning?  Nobody
> initialized it, $ya, a my() variable in fileaaa, is not related
> to $aaa::ya, and not visible outside fileaaa.  However, the
> subroutine &aaa::foo is in package aaa, and it:
>
> a) can see $ya, knowing its value is 2
>
> and
>
> b) knows that $yo means $aaa::yo in fileaaa, because use vars
> declared that to be so.
>



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

Date: Sun, 23 Apr 2000 21:28:32 GMT
From: yctao@my-deja.com
Subject: qq() for java?
Message-Id: <8dvptj$kc2$1@nnrp1.deja.com>

I need to initialize a string with many lines of characters, which may
also include special characters such as the quote symbol ("). Is there
a way I can do this in a way similar to the qq() function in PERL
without putting a backslash before each of the special characters?

In PERL, if I want to set a string s to something, I can use
$s=qq(this is a
      "multilined" string
       which includes quotes);

which is the same as

$s="this is a
      \"multilined\" string
       which includes quotes";

This feature is very handy when one wants to put something like a html
document in a string.

Y. C. Tao



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


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

Date: Sun, 23 Apr 2000 21:46:10 GMT
From: lcerqueira@my-deja.com
Subject: Re: qq() for java?
Message-Id: <8dvquv$lhp$1@nnrp1.deja.com>



You can't do that in the source code. If you really want it, you could
write it in a separate text file and then read it into your app.

In article <8dvptj$kc2$1@nnrp1.deja.com>,
  yctao@my-deja.com wrote:
> I need to initialize a string with many lines of characters, which may
> also include special characters such as the quote symbol ("). Is there
> a way I can do this in a way similar to the qq() function in PERL
> without putting a backslash before each of the special characters?
>
> In PERL, if I want to set a string s to something, I can use
> $s=qq(this is a
>       "multilined" string
>        which includes quotes);
>
> which is the same as
>
> $s="this is a
>       \"multilined\" string
>        which includes quotes";
>
> This feature is very handy when one wants to put something like a html
> document in a string.
>
> Y. C. Tao
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


------------------------------
End of Perl-Users Digest V9 Issue 2849
**************************************


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