[13028] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 438 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 10 00:07:18 1999

Date: Mon, 9 Aug 1999 21: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)

Perl-Users Digest           Mon, 9 Aug 1999     Volume: 9 Number: 438

Today's topics:
    Re: Custer's Last Code (brian d foy)
    Re: file manipulation? (William Herrera)
        Help - Split Function Blowing My Mind Away!! <dbattams@canada.com>
    Re: Help - Split Function Blowing My Mind Away!! <uri@sysarch.com>
    Re: Help - Split Function Blowing My Mind Away!! (Sam Holden)
    Re: Help - Split Function Blowing My Mind Away!! (Larry Rosler)
    Re: I Installed Active Perl, but how can I run my CGI-S <cassell@mail.cor.epa.gov>
    Re: kill pid scripts (Abigail)
    Re: kill pid scripts (Abigail)
    Re: Need help with Perl expression and replace <resource@ERASEjps.net>
        Newbie: File I/O + Locking question (Chris)
    Re: Newbie: File I/O + Locking question (Martien Verbruggen)
    Re: Nicer Way (Abigail)
    Re: Nicer Way (Abigail)
    Re: POST via Imagemap - How? <cassell@mail.cor.epa.gov>
    Re: POST via Imagemap - How? (Abigail)
    Re: pricing a perl job (brian d foy)
    Re: pricing a perl job <max@maxgraphic.com>
    Re: pricing a perl job (Benjamin Franz)
    Re: print to file using here document <cassell@mail.cor.epa.gov>
    Re: print to file using here document <cassell@mail.cor.epa.gov>
    Re: Problem reading forms with perl (Abigail)
    Re: Reading the Online Documentation? <cassell@mail.cor.epa.gov>
    Re: Reading the Online Documentation? <ljp@209.204.251.8>
    Re: Reading the Online Documentation? (Sam Holden)
    Re: Replace section in file with another file <cassell@mail.cor.epa.gov>
    Re: send perl-users mini-faq ("Bill Jones")
    Re: Sorting Backwards (Chris)
    Re: Upload files with Perl for Win32 ? <bornholtz@home.com>
    Re: User Authentication <matthew.porter@wwt.com>
    Re: User Authentication (brian d foy)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 09 Aug 1999 22:20:03 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Custer's Last Code
Message-Id: <brian-ya02408000R0908992220030001@news.panix.com>

In article <m1aes0h10e.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) posted:

> >>>>> "Frank" == Frank Krul <fkrul@acc.com> writes:

> Frank> Insecure $ENV{PATH} while running setuid at /dev/fd/3 line 120.

> Set $ENV{PATH} to a value that didn't come from the outside world.
> This will work:
> 
>         $ENV{PATH} = "/bin:/usr/bin";

i recommend setting the PATH to undef, and then specifying the full
path in the appropriate places for various security reasons.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Tue, 10 Aug 1999 02:54:16 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: file manipulation?
Message-Id: <37af9208.12617969@news.rmi.net>

On Sun, 08 Aug 1999 14:48:11 GMT, "ted fiedler" <tfiedler@ptd.net>
wrote:

>I have a file which looks like this:
>
>008
>PAGE   1
>015                 JOHN DOE
>   1                1 CEDAR AVE.
>   1                SOMEWHERE         PA     11111-0000
>   1                                                     07/15/99  006056-1
>10.00
>   2 80     1
>027     08/12/98   EST PT. E/M LEVEL III        55.00 I:    29.22-    15.78-
>10.00
>   1   5-1002 -CRS  99213  715.95 OFFICE
>061         ***       ***       ***       ***       ***
>   2          .00       .00       .00     10.00     10.00
>008
>PAGE   1
>015                 JANE DOE
>

etc.

>It goes on and on, but my dilema is that i need to take the fist part of the
>file and put it in a format that can be read by microsoft access ie

>name,account,date,address,etc...
>jane doe,12345,2/10/99,182 market st,etc
>john doe,23455,4/8/99,109 harmony lane,etc
>
>this much i have done...
>
>my dilemma is getting the detail of the file into the same format.  All the
>data is in varying lengths, but it is consistant, i can pull the detail out
>but am having trouble manipulating it...

This has been done before, you know. 

The key lies in knowing exactly what each field in the records
represents. Without that, you will just have a useless Approach
database you will wind up rebuilding again and again. (By the way, SQL
is IMO better for the big databases, and you can interface Approach
with it).

As a first step, sit down with a printout and pencil in a name for
every field of the billing records until you are sure you have a
consistent set of field names for the database for every entry you try
them on.

Only then should you start coding. It will save lots of time in the
long run. Make sure that the program warns about missing fields and
adjusts for them.

>also is there a way that i can print a file and in one font and switch to
>another font in the middle of it such as in adding a barcode font... i am
>using linux, if it helps...

I think Ghostscript will do what you want. But still, concentrate on
the database field structure first before you work on printing it to
the paper forms. Otherwise you will wind up filling them out wrong.

Good luck!

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


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

Date: Mon, 9 Aug 1999 23:33:15 -0400
From: "Derek Battams" <dbattams@canada.com>
Subject: Help - Split Function Blowing My Mind Away!!
Message-Id: <a1Nr3.57892$jl.36696862@newscontent-01.sprint.ca>

Please consider the following function:

sub writeEntry
{
   @record = split("|",$_[0]);
   foreach $field (@record)
   {
      print "$field<br>\n";
   }
}

During debugging I have printed the value of $_[0] and it's as expected.
The value is:

Derek Battams|Mail Address Here|URL Here|Comment Here

When I do the print in the foreach loop I get each character as an element
of the array @record.  Why isn't the string being split with the pipe as the
delimiter?  If I were to change the delimiter to something like "tt" then
the split is done as expected.  I'm new to Perl so I'm probably doing
something stupid, but I just don't see it.

Help appreciated,

Derek Battams




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

Date: 09 Aug 1999 23:33:32 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <x71zdccnsj.fsf@home.sysarch.com>

>>>>> "DB" == Derek Battams <dbattams@canada.com> writes:

  DB>    @record = split("|",$_[0]);

  DB> Derek Battams|Mail Address Here|URL Here|Comment Here

  DB> When I do the print in the foreach loop I get each character as an
  DB> element of the array @record.  Why isn't the string being split
  DB> with the pipe as the delimiter?  If I were to change the delimiter
  DB> to something like "tt" then the split is done as expected.  I'm
  DB> new to Perl so I'm probably doing something stupid, but I just
  DB> don't see it.

split takes a full regular expression and not just a fixed string as its
split argument. and | is a special character in regexes. so you have to
quote it to get it to look like a plain char.

	split( '\|', blah

will do it.

for more, read these documents:

perldoc -f split
perldoc perlre

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 10 Aug 1999 03:37:46 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <slrn7qv7l4.ncj.sholden@pgrad.cs.usyd.edu.au>

On Mon, 9 Aug 1999 23:33:15 -0400, Derek Battams <dbattams@canada.com> wrote:
>Please consider the following function:
>
>   @record = split("|",$_[0]);

split wants a regular expression as its first argument. Regular expressions
have a certain syntax that is explained in the perlre documentation.

You want something like : split /\|/. $_[0]

I suspect anyway.

-- 
Sam

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
	--Isaac Asimov 


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

Date: Mon, 9 Aug 1999 20:50:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <MPG.1219416194e012aa989e15@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <a1Nr3.57892$jl.36696862@newscontent-01.sprint.ca> on Mon, 9 
Aug 1999 23:33:15 -0400, Derek Battams <dbattams@canada.com> says...
 ...
>    @record = split("|",$_[0]);
 ...
>       Why isn't the string being split with the pipe as the
> delimiter?  If I were to change the delimiter to something like "tt" then
> the split is done as expected.  I'm new to Perl so I'm probably doing
> something stupid, but I just don't see it.

The first argument to split(), though for historical reasons often 
written as a string, is really a regular expression.  The vertical bar 
is a regular-expression metacharacter.

Write that line thus:

     @record = split(/\|/, $_[0]);

And all will be well.  (This is on my Top Ten list of Perl surprises for 
beginners.  The vertical bar is a popular field separator!)

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


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

Date: Mon, 09 Aug 1999 19:28:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: I Installed Active Perl, but how can I run my CGI-Scripts activated by webside on my computer?
Message-Id: <37AF8E31.7F11E56C@mail.cor.epa.gov>

Bill Moseley wrote:
> 
> Henni (noah@cs.tu-berlin.de) seems to say...
> > I Installed Active Perl, but how can I run my CGI-Scripts activated by
> > webside on my computer?
> >
> > Please help.
> 
> Don't you know pit bulls live here?

Yes, in fact that is why you often see the following functions used
in Perl:

tied
alarm
seek
study
wait
open
chomp
pop
truncate
split
kill
sleep

> Please read the FAQs that come with Active State Perl.  perlwin32faq6 is
> a good place to look.

Hey, you were polite!  

"Off to the salt and gravel mines with you and your mother!" 
 [Steve Landesburg]

HAND,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: 9 Aug 1999 22:46:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: kill pid scripts
Message-Id: <slrn7qv83q.ahe.abigail@alexandra.delanet.com>

vlad@doom.net (vlad@doom.net) wrote on MMCLXIX September MCMXCIII in
<URL:news:7omm1p$t8c$1@news.servint.com>:
 .. Dutch McElvy <dutch@mindspring.com> wrote:
 .. > Anyone else know of a script to kill specific hung processes?
 .. 
 .. > The script below will not work either through command line or in a perl
 .. > script. Anyone know why?
 .. 
 .. > kill -9 `ps -ef | grep foo | awk -e '{print $2}'`
 .. 
 .. It won't work in a command line?  Works for me, I often use it to kill tons of httpd

84 chars. Bad. Very bad. One notch closer to the killfile.

 .. processes when /var/run/httpd.pid is not available.

Should I care about the command line in clpmisc? Command lines belong
in comp.unix.whatever.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 9 Aug 1999 22:47:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: kill pid scripts
Message-Id: <slrn7qv86b.ahe.abigail@alexandra.delanet.com>

Jerome O'Neil (jeromeo@atrieva.com) wrote on MMCLXIX September MCMXCIII
in <URL:news:7omt3s$j5c$2@brokaw.wa.com>:
-- In article <slrn7qs86i.9fk.abigail@alexandra.delanet.com>,
-- 	abigail@delanet.com (Abigail) writes:
-- > Dutch McElvy (dutch@mindspring.com) wrote on MMCLXVIII September MCMXCIII
-- > in <URL:news:7ol1k0$is0$1@nntp6.atl.mindspring.net>:
-- > `` 
-- > `` kill -9 `ps -ef | grep foo | awk -e '{print $2}'`
-- > 
-- > That doesn't compile. 
--
-- ksh finds it quite agreeable.


And perhaps a dozen other languages as well. But this is comp.lang.PERL.misc.
Not comp.unix.shells.ksh.kill.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 09 Aug 1999 19:07:09 -0700
From: Warren Bell <resource@ERASEjps.net>
Subject: Re: Need help with Perl expression and replace
Message-Id: <37AF894D.E309F92B@ERASEjps.net>

Can I do somthing like this:

If quotes are inside greater than and less than signs < >, strip them,
otherwize leave them alone?

Can someone show me how to write this?

Warren Bell


Georg Weissenbacher wrote:
> 
> elephant wrote:
> >
> > Warren Bell writes ..
> > >I'm trying to make an expression in a script that says somthing like:
> > >
> > >If line of text contains <img src="anything" anything> replace it with
> > ><img src=anything anything>.  The anything would be any charactor.
> > >
> 
> $a =~ s/<img src="(.*?)" \1>/<img src=$1 $1>/;
> 
> But this works only if anything = anything (is this what you wanted?)
> 
> cu,
> Georg

-- 
####### Remove ERASE to reply #######


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

Date: Mon, 09 Aug 1999 03:43:32 GMT
From: chrisl@hamptons.com (Chris)
Subject: Newbie: File I/O + Locking question
Message-Id: <37ae4dd8.560199@news.swbell.net>

Howdy all

I have to write some simple CGI scripts. Thes scripts are going to be
writing to some common files, and I have to have some kind of
synchronization. Is there any file locking in Perl? And if not, can I
just do something like 

	while (open(OUT, ">> common.txt"))
	{
		# Loop until the open() succeeds
	}

without being mocked?

Thanks a lot,
Chris


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

Date: Tue, 10 Aug 1999 03:55:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie: File I/O + Locking question
Message-Id: <dpNr3.5425$rR.10128@nsw.nnrp.telstra.net>

In article <37ae4dd8.560199@news.swbell.net>,
	chrisl@hamptons.com (Chris) writes:

>                  Is there any file locking in Perl?

# perldoc -f flock

Please try to read some of the documentation. Start with 

# perldoc perl

Martien
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Interactive Media Division          | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: 9 Aug 1999 22:51:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Nicer Way
Message-Id: <slrn7qv8cv.ahe.abigail@alexandra.delanet.com>

Scott Beck (admin@gatewaysolutions.net) wrote on MMCLXIX September
MCMXCIII in <URL:news:rqtrki89kur47@corp.supernews.com>:
`` Mabe there is somthing wrong with the way Outlook Exp. is reading the Mime
`` Type.
`` What program are you using and where can I get a copy. I've been looking for
`` somthing to replace Outlook!
`` Here is what I am looking at when I see your post.

We saw that the first time, as you haven't mastered trimming postings
yet. Nor have you mastered Usenet etiquette yet, despite the repeated
postings about Jeopardy. 

You're 90% on the way to become killfile fodder.



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 9 Aug 1999 22:53:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Nicer Way
Message-Id: <slrn7qv8hp.ahe.abigail@alexandra.delanet.com>

wayne clerke (clerke@emirates.net.ae) wrote on MMCLXIX September MCMXCIII
in <URL:news:7on55b$57m4@news.emirates.net.ae>:
 .. Yep. This is correct (OE5). Cutting and pasting doesn't help. You need to go
 .. all the way back to the original message source to see the correct '//' and
 .. not 'file://'.
 .. Wow.

Another jeopardy style poster, who hasn't mastered the delete function yet.

What is it with those inbreds?



Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 09 Aug 1999 19:22:31 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: lr@hpl.pl.com
Subject: Re: POST via Imagemap - How?
Message-Id: <37AF8CE7.D58DBB71@mail.cor.epa.gov>

[courtesy copy e-mailed to poster]

Larry Rosler wrote:
> In article <37AF4472.71D55A1C@mail.cor.epa.gov> on Mon, 09 Aug 1999
> 14:13:22 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
[snip of usual drek]
> > Well *I* thought Abigail's intention was imminently clear.  But then,
> > I'm the sort of person who uses the word 'imminently' in conversation.
> 
> When you should be using the word 'eminently'.  Ow!

<ThePathologicalLiar>
Umm.. urr...  Oh!  I *meant* to say that!  Yeah, that's the ticket.
I meant to say it.  In fact.. it was my ObPerl!  That's right, my
copy of the PSI::ESP module warned of an impending danger or evil, 
so I wrote 'imminently' instead.  And sure enoguh, there you were.
</ThePathologicalLiar>

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: 9 Aug 1999 22:56:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: POST via Imagemap - How?
Message-Id: <slrn7qv8ml.ahe.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCLXIX September MCMXCIII
in <URL:news:37b12942.1103168@news.skynet.be>:
{} Abigail wrote:
{} 
{} >Oddly enough, someone asked the same question recently in this
{} >newsgroup, with a slightly different subject line.
{} >
{} >Perhaps you want to contact the poster, maybe he got an answer,
{} >or figured it out himself. His email address is: cmeilahn@nauiww.org
{} 
{} What a strange sense of humour. It *is* the same poster. Should he
{} contact himself? Is this an advanced case of schisophrenia?


Do you really have to contribute to the notion amongst Dutch people
that people from Belgium don't understand any humour?



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 09 Aug 1999 22:16:47 -0400
From: brian@pm.org (brian d foy)
Subject: Re: pricing a perl job
Message-Id: <brian-ya02408000R0908992216470001@news.panix.com>

In article <090819991743144695%max@maxgraphic.com>, Max Pinton <max@maxgraphic.com> posted:

> I hope you're joking. I'm asking for a rough estimate of cost for
> writing the Perl script I described. It has to do with Perl in that
> only a Perl scripter would be able to make such an estimate. I'm a
> graphic designer, but wrote the script without a contract for a client
> that I've worked closely with for a long time, and would like to charge
> her fairly for the work I did.

my post was completely serious.  pricing has nothing to do with the
Perl language.  it has to do with what your time is worth and how much
the client will pay, not what you do during the time that you spend
working on the project.  that's how it works in the real world.  get
a book that talks about being a contractor and you'll find the same
advice.  ask your accountant, attorney, or business coach and they'll
tell you the same thing.

> Would I have gotten a real response if I had posed as a client looking
> for a quote? Or has usenet simply ceased being a useful resource?

that was the best response you can hope to get.  i've been doing this
for awhile, and that's how it works.

if you were a client looking for a quote, i would have figured out
how much time it would take me, figure out how much that time is 
worth to me at that time, and come up with a number.  the factors
and multipliers i use in my equation will be different from yours.
if you asked a different person what his rate would be, you'd get a 
different number for the same reason.

usenet is a useful resource.  you just have to recognize expert
advice when you get it.  if i were joking there would have been
a smiley.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Mon, 09 Aug 1999 20:09:07 -0700
From: Max Pinton <max@maxgraphic.com>
Subject: Re: pricing a perl job
Message-Id: <090819992009079188%max@maxgraphic.com>

In article <brian-ya02408000R0908992216470001@news.panix.com>, brian d
foy <brian@pm.org> wrote:

> my post was completely serious.  pricing has nothing to do with the
> Perl language.  it has to do with what your time is worth and how much
> the client will pay, not what you do during the time that you spend
> working on the project.  that's how it works in the real world.  get
> a book that talks about being a contractor and you'll find the same
> advice.  ask your accountant, attorney, or business coach and they'll
> tell you the same thing.

So it's simply not possible for you to estimate the amount of time it
would take you to write the script I described, multiply it by your
approximate hourly rate, and give me a *rough* idea of final cost? What
sort of an axe are you grinding here?

> that was the best response you can hope to get.  i've been doing this
> for awhile, and that's how it works.

No, I could've gotten an actual response to my question. You could've
read my initial post, thought "hmm, that'd take me about five hours,
and I generally charge around $75 an hour," then replied with that
information. But instead you decided to post a diatribe about business
practices that expressly avoids answering my question.

> if you were a client looking for a quote, i would have figured out
> how much time it would take me, figure out how much that time is 
> worth to me at that time, and come up with a number.  the factors
> and multipliers i use in my equation will be different from yours.
> if you asked a different person what his rate would be, you'd get a 
> different number for the same reason.

So why couldn't you have posted that number? Believe me, I understand
that prices vary. Did you catch my use of words like "rough,"
"approximate," and "estimate"? Remember, I asked:

"How much would you charge for such a script?"
                ^^^
Thanks for your response. While it hasn't been informative in the way
I'd hoped, it has been informative.


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

Date: Tue, 10 Aug 1999 03:48:16 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: pricing a perl job
Message-Id: <4iNr3.1862$Bs.73249@typhoon01.swbell.net>

In article <090819992009079188%max@maxgraphic.com>,
Max Pinton  <max@maxgraphic.com> wrote:
>In article <brian-ya02408000R0908992216470001@news.panix.com>, brian d
>foy <brian@pm.org> wrote:
>
>> my post was completely serious.  pricing has nothing to do with the
>> Perl language.  it has to do with what your time is worth and how much
>> the client will pay, not what you do during the time that you spend
>> working on the project.  that's how it works in the real world.  get
>> a book that talks about being a contractor and you'll find the same
>> advice.  ask your accountant, attorney, or business coach and they'll
>> tell you the same thing.
>
>So it's simply not possible for you to estimate the amount of time it
>would take you to write the script I described, multiply it by your
>approximate hourly rate, and give me a *rough* idea of final cost? What
>sort of an axe are you grinding here?

He's not grinding any kind of axe. You asked a question without 
a clear answer. Programmers get paid anywhere from minimum
wage to hundreds of dollars an hour. The particular rate charged
for a particular project depends on the programmer and the customer.

It is as if you walked up to a museum director and asked 'how much 
should I charge for a picture of some flowers?' 

Well - that depends on the artist and the buyer, now doesn't it?

-- 
Benjamin Franz


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

Date: Mon, 09 Aug 1999 19:43:42 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: print to file using here document
Message-Id: <37AF91DE.8C9321E8@mail.cor.epa.gov>

Jflowers44 wrote:
> 
> I am trying to print to a file using the here document notation.  I know that
> the script works fine otherwise, but when I telnet into my web server (it's a
> cgi-script that writes to html files) and try to compile it with perl, it says
> that it doesn't find the terminator (the thing that it's supposed to print to
> untill it reads).  The terminator has no spaces.  can anyone help?  Thanks.

The FAQ has several hints about what can go wrong with here-docs.  But
one of the things unstressed in the Core Perl FAQ is a problem that can
happen in win32 [but not in unix].  Is your terminator on the last line
of
your program?  If so, stick a hard return there so you have a blank line
afterward.  The invisible ^Z at the end of the file in DOS can confuse
the
parser.  If that's not the problem, you'll want to read the FAQ that
deals
with this topic and see which other problem is there.

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Mon, 09 Aug 1999 19:46:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: print to file using here document
Message-Id: <37AF927B.5B573EC8@mail.cor.epa.gov>

Jflowers44 wrote:
> 
> Here is the relevant code;
> 
> open (LOG, $filename);
>    print LOG << "(HTMLCODE)";
>    <HTML> <HEAD> <TITLE> Hello </TITLE> </HEAD>\n;
>    <BODY background = \"../backgrounds/$background\">;
>    <FONT COLOR = \"$fontcolor\">;
>    <H1> $heading </H1> <BR> $comments </FONT> </BODY> </HTML>;
>    (HTMLCODE)
>    close(LOG);

Oh.  The FAQ specifically warns about spacing.  Take out the spaces in 
*front* of your terminator, or else add exactly the same number of
spaces
to the front, just after the first quotemark, in the second line you
have above.

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: 9 Aug 1999 23:03:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Problem reading forms with perl
Message-Id: <slrn7qv94v.ahe.abigail@alexandra.delanet.com>

genelong@my-deja.com (genelong@my-deja.com) wrote on MMCLXIX September
MCMXCIII in <URL:news:7oned1$16n$1@nnrp1.deja.com>:
-- Thanks to all for your patience with a unix-challenged windows
-- programmer.  Some more questions:
--
-- I went to activestate.com, and there are a lot of things to download.
-- Which one(s) do I need?

Last time I looked, it was explained.

-- Is the "standard distribution" basically a perl compiler?  Why would I
-- want to compile my perl when the server interprets the source?  Or is
-- it just for documentation purposes?

No, and the documentation isn't their for the compilers purpose either.
RTFM.

-- There seems to be a huge communication gap between unix and windows
-- programmers.  Where do people enter commands such as perldoc (or
-- whatever it was) in Windows?  Windows consists of icons and screens,
-- not command lines.  The only way I know of entering commands is opening
-- a DOS window, and I would think DOS has nothing to do with perl.

Well, if you think Windows consists of icons and screen, please do tell
me, how do you expect to use Perl? By clicking on icons? 

-- I am glad to get a hold of all these resources to enhance my knowledge
-- of perl, but I also feel I am buying a car when all I want to do is go
-- to the house next door.

Noone is forcing you to use Perl. If you don't need it, don't use it.
If you don't know whether you need it, shouldn't you feel more like
you are buying a car when all you want to do is go to the house next
door, but you don't know where that house is?

--                          Is all this really necessary to read angle
-- brackets from a form?

What the fsck is reading angle brackets from a form?

--                        I see forms all the time that let users enter
-- addresses such as "joe <joe@domain.com>".  How do those forms get the
-- input into some place where it can be manipulated?

That's a question that has nothing to do with Perl. Unless you write
a browser in Perl.

--                                                     I will be glad to
-- learn all these things, but if someone could hand me a line of code
-- that would do the trick, I would be greatly appreciative.  It just
-- can't be that hard.

I've a strong impression you don't know what you are talking about. Or
perhaps you do, but then you express that real awkwardly.



Abigail
-- 
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 09 Aug 1999 19:36:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Reading the Online Documentation?
Message-Id: <37AF9045.C99D900C@mail.cor.epa.gov>

Mesarchm wrote:
> 
> My point is that they obviosly tried the docs and it didn't make sense.  So

But you're wrong.  All you have to do is read the questions and the
replies-to-replies to see that many poster do not yet know about the
FAQ or the documentation or the module docs or the free modules at
CPAN or a wide variety of other things Perlish.

> people turn here for help.  Then a few people who THINK they know everything
> reply to half the messages posted w/ "Read the Docs"

A lot of people only need to be told that their answer is already 
available in a specific place.  The thank-yous that come in here are
proof of that.

Well, at least they are as long as no one traces them back to Tom's
anonymizer.  :-)

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: 09 Aug 1999 20:58:35 -0600
From: ljp <ljp@209.204.251.8>
Subject: Re: Reading the Online Documentation?
Message-Id: <wvv4s5no.fsf@wind.localdomain>

>You just don't get it, do you?  What do you do if your child or spouse
>makes a mistake?  You berate her loudly in public for being an idiot,
>of course.  By being demeaning, you ensure that will she be more
>careful in the future.  Better yet, other people---seeing her public
>humiliation---will think twice before they open their mouths.  

boy, I'd kill myself if I were YOUR child.

>Humiliation and ridicule are used by *all* the best teachers.

All the *Best* teachers that I knew in school were understanding. I
never learned anything from the ones that used your ill-thought
technique, of humiliation and mind torture.
The best teachers show patience and understanding, and realize that
the only way to really teach anything, is from a positive side.

>Right?

NO

>-mike



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

Date: 10 Aug 1999 03:21:44 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Reading the Online Documentation?
Message-Id: <slrn7qv6n1.ms5.sholden@pgrad.cs.usyd.edu.au>

On 09 Aug 1999 20:58:35 -0600, ljp <ljp@209.204.251.8> wrote:

Another one misses the sarcasm... ;)

-- 
Sam

You can blame it all on the internet. I do...
	--Larry Wall


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

Date: Mon, 09 Aug 1999 19:33:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Replace section in file with another file
Message-Id: <37AF8F94.C4D2D8F6@mail.cor.epa.gov>

Chris L wrote:
> 
> I've searched the archives and read the fAQ (5)... and while I

Excellent.  Learning how to look up stuff is an important programming
skill.

> understand how to replace a string in a file with another string, I'm
> unclear how to replace a section in a file with the whole of another
> file.
> 
> My website has menus surrounded by comment tags:
> <!--startmenu-->
> foostuff
> <!--endmenu-->
> 
> I would like to replace that section with another section that resides
> in a file...

Well, one way would be to read your file into a single array:

   @file_contents = <INFILE>;

and now you can use that array in the same sort of substitution you saw 
in the FAQ.  That's all it takes.  Give it a try (or three) and see how
things go.

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Mon, 09 Aug 1999 22:54:26 -0400
From: bill@fccj.org ("Bill Jones")
Subject: Re: send perl-users mini-faq
Message-Id: <199908100250.WAA18521@astro.fccj.cc.fl.us>

[Posted Only]

OK, Please allow me to clear up some things:

(My replies are interspersed below) -


> Date: Mon, 09 Aug 1999 11:25:33 -0700
> From: David Cassell <cassell@mail.cor.epa.gov>
> Subject: Re: send perl-users mini-faq
> Message-Id: <37AF1D1D.E5128D03@mail.cor.epa.gov>
>
> Dennis M. Parrott wrote:
>>
>> Bill Jones wrote:
>> >
>> > send perl-users mini-faq
>>
>> ahem. Usenet IS NOT an FTP-by-email device.
>>
>> Read the post titled '[Perl] How to find the Perl FAQ' which
>> can be found in the comp.lang.perl.announce newsgroup on a
>> very regular basis. ...and then say thank you to Tom Phoenix
>> who makes sure that it gets posted there...
>
> Dennis [and others who have wondered about this]:
>
> I checked, and this is actually the same Bill Jones who has been
> providing reasonably correct answers here under the alias Sneex.
> He is currently at the mercy of some sysadmins who are mucking things
> up for him, and he is not the one posting these stupid one-line
> autobot requests.  But feel free to e-mail him at bill@fccj.org so
> you can make him feel even worse about these stupid posts he has not
> been able to prevent.

Yes. I originally made a mistake sending these three (there were three)
requests to the perl-users gateway and not the list manager.  My reply to
David was that my news server is out of my hand for the last year and I
would REALLY enjoy reading those long flames...

I did ask Dennis why he burned me via mail and posted - David didn't, but I
was remiss and missed his post which (though no fault of his own) stated I
am -Sneex- but Sneex didn't send the requests.

I did, and I apologize; I didn't want to add insult to injury by repeating a
long drawn out -Usenet isn't a FAQ gateway, etc- thread...


>
> Date: 10 Aug 1999 01:15:49 GMT
> From: stanley@skyking.OCE.ORST.EDU (John Stanley)
> Subject: Re: send perl-users mini-faq
> Message-Id: <7onug5$jku$1@news.NERO.NET>
>
> In article <37AF1D1D.E5128D03@mail.cor.epa.gov>,
> David Cassell  <cassell@mail.cor.epa.gov> wrote:
>>Dennis [and others who have wondered about this]:
>>
>>I checked, and this is actually the same Bill Jones who has been
>>providing reasonably correct answers here under the alias Sneex.
>>He is currently at the mercy of some sysadmins who are mucking things
>>up for him, and he is not the one posting these stupid one-line
>>autobot requests.  But feel free to e-mail him at bill@fccj.org so
>>you can make him feel even worse about these stupid posts he has not
>>been able to prevent.
>
> Excuse me, but yes, he is the one who posted those requests. He has
> been using my digest gateway to do it. He complained to the campus
> admins that his mail to the gateway was being bounced as "no such host"
> (sendmail "MAIL FROM host must exist" combined with NIS-only name
> resolution), and after I told him I fixed the problem the first three
> articles from him were the "send perl-users xxx" ones that appeared
> here.
>
> What I think he was trying to do was request them from my mailing list
> manager, where those would be valid requests. This is a service that has
> been available to the digest readers since I started running it. The
> mailbox isn't even close to the same.
>
> If he is saying he did not send these, then I will immediately block
> the addresses from which they came, since someone is forging his
> address and we certainly do not want that to happen. He has not
> complained of this problem to me, however.

John's reply here is the one which caught my attention.  My posts to Usenet
thru his gateway have failed to supply a correct References header (which
Abby caught) and he posted a note about it.  I am not sure how to fix it as
I am prolly not going to change my reader anytime soon - those of you who
are long time "get a real news reader" prone may be so inclined to
continuously remind me of my chosen life style - tuff  :)

John has asked me about something related (I suppose to verify my e-mail in
preparation to blocking me) but since he didn't specifically ask about these
three requests I erroneously posted, I didn't make the connection at that
time.

I appreciate David Cassell for not nuking me in public, and I appreciate
John Stanley's efforts in making such a gateway available to those who do
not have a true newsfeed; in light of the recent threads I have read in this
group (sounds like an early 1997 repeat) I honestly didn't want to
contribute to the noise ratio.

Sorry,
-Sneex-  :]

PS - Am I blocked now?



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

Date: Mon, 09 Aug 1999 03:50:08 GMT
From: chrisl@hamptons.com (Chris)
Subject: Re: Sorting Backwards
Message-Id: <37ae4f59.944657@news.swbell.net>

1) It wasn't obvious it all that you read the perldoc and didn't
understand it. If you had said something like "I read the perldoc and
didn't understand it", I'm sure people would have responded
differently.

2) It's free help delivered to your home (or work or whatever). Don't
be so testy - these people don't owe you a thing,

Fondly,
Chris

On 09 Aug 1999 23:23:02 GMT, mesarchm@aol.com (Mesarchm) wrote:

>I obviously read those and it didn't make sense.  I also read the perl cookbook
>p.144 and several other references.  If it had made sense I wouldn't be asking
>for help.  If you don't know the answer don't reply.  If you do, I appreciate
>it.



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

Date: Tue, 10 Aug 1999 02:26:30 GMT
From: "Tim Bornholtz" <bornholtz@home.com>
Subject: Re: Upload files with Perl for Win32 ?
Message-Id: <q5Mr3.3080$4p2.3656@news.rdc1.ne.home.com>

Use CGI.pm.  In its manpage there is an example for multi-part forms and an
upload input type.
If you still can't make it work feel free to e-mail me.

hth,

Tim Bornholtz
tbornhol@prioritytech.com


Frederic Jeanbart <telenet@citenet.net> wrote in message
news:37AF5225.68E58A86@citenet.net...
> Can someone give me a starting script, a clue or a resource center about
> uploading a file on a Win32 platform via Perl with a Web form? I found
> some that are made for UNIX, but they do not work on Win 95/NT...
>
> Thanks in advance,
> Frederic
>




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

Date: Mon, 09 Aug 1999 19:55:49 +0000
From: Matthew Porter <matthew.porter@wwt.com>
Subject: Re: User Authentication
Message-Id: <37AF3245.6657AA96@wwt.com>

    My question about grabbing the username and password is specific to Netscape
Enterprise Server.  How does one grab the username and password entered via a basic
authentication prompt.  Documentation shows that this is passed via the header in
"username:password" format.  So, basically this should be as simple as pulling the header
named "Authorization".
    Is anyone aware what is needed to accomplish this.  I have tried the HTTP::Headers
module, but with limited success.  $ENV{'REMOTE_USER'} and the CGI.pm remote_user() give
me the username by pulling from the header (I think); however, nothing grabs the password.

    This is a known problem with Basic Authentication that crackers could exploit, so I
would imagine someone knows how to accomplish this.  Also, I know this is possible in
Java, but would prefer to user Perl.

 Any help would be appreciated.


Matthew Porter
matthew.porter@wwt.com



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

Date: Mon, 09 Aug 1999 23:51:41 -0400
From: brian@pm.org (brian d foy)
Subject: Re: User Authentication
Message-Id: <brian-ya02408000R0908992351410001@news.panix.com>

In article <37AF3245.6657AA96@wwt.com>, Matthew Porter <matthew.porter@wwt.com> posted:

>     My question about grabbing the username and password is specific to Netscape
> Enterprise Server.  How does one grab the username and password entered via a basic
> authentication prompt.  Documentation shows that this is passed via the header in
> "username:password" format.  So, basically this should be as simple as pulling the header
> named "Authorization".

it's not that simple.  you have to be able to get to the headers, which
means you have to work with a server plug-in or soemthing.  you're out
of luck with Perl unless you'd like to use an easy to extend server like
Apache.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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