[7751] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1376 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 27 14:07:18 1997

Date: Thu, 27 Nov 97 11:00:45 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 27 Nov 1997     Volume: 8 Number: 1376

Today's topics:
     Re: Contract Programmers Needed! (Jeremy D. Zawodny)
     Re: Contract Programmers Needed! (John Randolph)
     Do something 30 days from a certain date <mooneer@earthlink.net>
     Re: Do something 30 days from a certain date (Jeremy D. Zawodny)
     Re: Finding the longest common prefix over a list of st (Abigail)
     For the pro's ? repost: Leaving HTML tags alone (Patrick)
     Re: getting owner of file in NT?? <robert.friberg@your_clothes.eductus-vast.com>
     hello chrysties@mymail.com
     Re: How do i Preform a search (Tad McClellan)
     Re: How do i Preform a search (Tad McClellan)
     Re: IS THERE A DB INTERFACE INTO MS SQL SERVER? ()
     Re: Killing system calls from within perl ( Thomas Lachlan XMS x4206 )
     Re: last element in an array? (Andrew M. Langmead)
     Re: Net::FTP docs ? (Jeremy D. Zawodny)
     Re: perl bad for backgroud job? (Keith Willis)
     Re: perl development package ? lvirden@cas.org
     Re: PERL Hourly Rates <webadmin@prestel.net>
     Re: PERL Hourly Rates (Jonathan Feinberg)
     Re: PERL Hourly Rates <webadmin@prestel.net>
     Re: PERL Hourly Rates (I R A Aggie)
     Perl ODBC problem sanil@ezeenet.com
     Re: Problem with Blat in perl script (Jeremy D. Zawodny)
     Re: Regex for three equal characters (Tom Grydeland)
     Re: send mail using perl5 (Jeremy D. Zawodny)
     Re: setting cookies with newCGI.pm (Jeremy D. Zawodny)
     Re: setting cookies with newCGI.pm (Jonathan Feinberg)
     Re: Silly diamond operator (<>) problem? (Jonathan Feinberg)
     Re: Simulation & modeling <pmp@egnetz.uebemc.sie.de>
     sytem command test <eeparrad@swansea.ac.uk>
     Re: sytem command test (Jeremy D. Zawodny)
     Re: use of chdir in backquote (Casper K. Clausen)
     Re: use of chdir in backquote <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     Re: use of chdir in backquote (Tad McClellan)
     Re: use of chdir in backquote (Andrew M. Langmead)
     Re: why does this program exit? (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 26 Nov 1997 13:23:34 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Contract Programmers Needed!
Message-Id: <347e22ba.511336903@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Tue, 25 Nov 1997 20:15:33 -0800, MARK MANGUM <markmangum@ibm.net>
wrote:

>Web Blueprints is launching a national advertising campaign to sell web
>design services.  We need 150 skilled programmers and graphic artists to
>work on a contract basis.  Our sales people will sell the job, write up
>all the specification, and forward these to you for a bid.  Successful
>bidders will be awarded the contract.  If you would be interested in
>participating in this project and bidding on individual jobs, please
>email your resume to:
>
>markmangum@ibm.net
>
>Please include URL's of web pages you have designed.

What do programming and design have to do with each other?

Wouldn't example scripts be more helpful in selecting candidates?

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 26 Nov 1997 13:54:35 GMT
From: jcr.remove@this.phrase.idiom.com (John Randolph)
Subject: Re: Contract Programmers Needed!
Message-Id: <65h9mr$du3@transfer.stratus.com>

In <347BA265.7E55F6CF@ibm.net> MARK MANGUM wrote:
> Web Blueprints is launching a national advertising campaign to sell web
> design services.  We need 150 skilled programmers and graphic artists to
> work on a contract basis.  Our sales people will sell the job, write up
> all the specification, and forward these to you for a bid.  Successful
> bidders will be awarded the contract.  If you would be interested in
> participating in this project and bidding on individual jobs, please
> email your resume to:

>From this description, Web Blueprints isn't adding any value at all beyond 
writing a spec, which the customer shouldn't leave up to the body shop 
anyway.  It also appears that you will fill the gig with the low bidder, but 
there's no indication that you'll adjust your price to the customer on the 
basis of what the developer charges you.

I don't think I'd want you for a vendor *or* an agent.
 
-jcr



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

Date: Wed, 26 Nov 1997 06:55:20 -0800
From: Mooneer Salem <mooneer@earthlink.net>
Subject: Do something 30 days from a certain date
Message-Id: <347C3857.CB58D909@earthlink.net>

I am making a membership system.
I want the script to check to see if it's 30 days from the last date
that they paid. If 30 days or more passed, it would automatically charge
the person if he/she is paying with a credit card, or if he/she is
paying by check, he/she would be reminded to send the check in. It it
was 45 days from a certain date, the program is to suspend the account
until that user pays.

How do I do something like this?
I only need to find out if it was 30 or 45 days past.
I think it would be possible if I do something like this:

$current_time = time;
$db_time = &get_db_time;
$month_past = 60 * 60 * 24 * 30;
$past_due = 60 * 60 * 24 * 45;

if (($db_time + $month_past) = $current_time) {
    &remind_user_to_pay;
} elsif (($db_time + $past_due) = $current_time) {
    &disable_account;
}

Would the thing above work?

-- 
Mooneer Salem
President, Global Kids Club (http://jump.to/globalkids)
No Administration eMail Domains (http://www.arrowweb.com/sumar/namd/)
GKC List Administrator


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

Date: Wed, 26 Nov 1997 16:22:39 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Do something 30 days from a certain date
Message-Id: <347c4cae.522076416@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Wed, 26 Nov 1997 06:55:20 -0800, Mooneer Salem
<mooneer@earthlink.net> wrote:

>$current_time = time;
>$db_time = &get_db_time;
>$month_past = 60 * 60 * 24 * 30;
>$past_due = 60 * 60 * 24 * 45;
>
>if (($db_time + $month_past) = $current_time) {
>    &remind_user_to_pay;
>} elsif (($db_time + $past_due) = $current_time) {
>    &disable_account;
>}
>
>Would the thing above work?

Try it and see. Shouldn't take but a few minutes.

If it doesn't work, and you can't debug it, THEN post and ask for
help.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 25 Nov 1997 18:01:07 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Finding the longest common prefix over a list of strings
Message-Id: <slrn67m4mi.44k.abigail@betelgeuse.wayne.fnx.com>

Ken Fox (fox@pt0204.pto.ford.com) wrote on 1547 September 1993 in
<URL: news:65dhvt$mnv4@eccws1.dearborn.ford.com>:
++ abigail@fnx.com (Abigail) writes:
++ > 
++ > foreach my $w (1 .. $#words) {
++ >     $end = length $words [$w] - 1 if $end >= length $words [$w];
++ >     foreach my $i (0 .. length $words [$w] - 1) {
++                           ^^^^^^^^^^^^^^^^^^^^^^
++ Should be $end?

Yes.

++ In my original posting, I gave a similar (cleaner?) algorithm:

My newsserver was down for more than a day, and I've missed many
postings. I never saw your algorithm.

++ [ Algorithm that starts with a null prefix, then builds it up ]

Nice algorithm.

++ This algorithm is O(N) where N is the number of words in the input.
++ Actually, it has run-time T(k*N+f) where N is the number of words in the
++ input, k is the length of the common prefix, and f is the number of
++ false prefix matches that are tested (f < N).  For those that don't
++ know, it's standard in Big-O notation to drop all the constants used in
++ the run-time bound, so T(k*N+f) ends up O(N).

I'm not familiar with big-T. Or is that T as in Theta?

++ So regex is linear in N, but geometric in k.  If we know that the common
++ prefix is short, then it's probably ok to use it.  (Keep in mind that

No, no, no. My k isn't the length of the common prefix, my k is the
length of the longest word. The regex is quadratic in the word *length*,
regardless of the length of the common prefix.

++ this is a lower bound because it ignores all sorts of ugly stuff like
++ repeated scanning over the non-prefix parts of words and looking for
++ commas.)  My original algorithm and Abigail's algorithm both have have a
++ lower bound of W(k*N) though.  If k is a constant then k^2 is too... ;)

Well, if you want to see k as a constant, then certainly all the mentioned
algorithms are linear.

++ I think Abigail's example of a long prefix is a specially formulated
++ worst case.  Will it ever appear in practice?  For *my* purposes, I'm
++ doubtful.  I find in my sample data as N becomes larger, the prefix
++ length becomes smaller.  For short prefixes the regex algorithm becomes
++ (nearly) linear.  Caveat emptor.

For both my solution and the regex solution, the worst case situation
depends on the order of the words; you reach the regex worst case
if the first cN words share a prefix of dk length. (N the number of
words, k the maximum length of the words, c, d constants > 0).

Your solution if fairly independent of the order of the words.

++ Abigail's algorithm is superior to the regex from a theoretical view,
++ but it fails miserably.  Why?  Because Big-O notation ignores
++ computational "constants" and "implementation details".  :-)  Perl is
++ *much* faster at regex execution than it is at "normal" code execution.
++ The total work done in opcode dispatch, argument passing, etc. for
++ Abigail's optimized solution exceeds the regex execution, even though
++ the regex has poorer performance bounds.

Not so fast. If you don't take word lengths/prefix lengths into account,
the constant that disappears in the big-O *will* depend on the maximum
word length. For Ilya's, yours and mine, that constant is linear on the
maximum word length. For the regex solution, that constant is quadratic
in the maximum word length.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Thu, 27 Nov 1997 01:18:07 GMT
From: Venice @ euronet.nl (Patrick)
Subject: For the pro's ? repost: Leaving HTML tags alone
Message-Id: <65hi7m$lab$1@news.NL.net>

I want to replace the text in a HTML document...
but i don't want to change the HTML code...

(Useless in execution) example:

Hereby i refer to <A HREF="http://www.fictional.net">this site</A>

Http is a cool protocol, more info at: <A
HREF="http://www.fictional.net>This http site</A>


I want to replace 'http' (NOT in the HTML-code) in the above with the
full name: Hyper Text Transfer Protocol without changing the http://
in the html tag...

Or with other words: Replacements without touching things between <>

How can i solve this in a short/fast piece of code ?

BIG thanx in advance.

PS: i want to use it in a humoristic "translation" script

Patrick
venice (at) euronet . nl





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

Date: 26 Nov 1997 13:30:51 GMT
From: "Robert Friberg" <robert.friberg@your_clothes.eductus-vast.com>
Subject: Re: getting owner of file in NT??
Message-Id: <01bcfa6e$fccd70c0$c82da8c0@akilles.ittek.org>



if you were using unix capturing tbe output of a command or program is
a sinch, use backticks: 
	$list = `ls -l`;

Backticks aren't supported on my system, (perl 4 on NT3.51) perhaps they
are on some other port. I would be surprised if they weren't. 

Here's an example with a possible solution, though probably not the best
one. 
Sorry about the CGI, but it's 30 meters to the NT-box :?) (no ras)

# perl 4 on NT 3.51
print "Content-type:text/html\n\n";
$cmd = 'net user'; 
print 'Return code from systemcall is ', 
       system("$cmd > e:/wwwroot/scripts/file.txt"), "<br>\n";
print "error! $!" unless open (FD, "e:/wwwroot/scripts/file.txt");
@lines = <FD>;
close FD;
$" = "<br>\n";
print "@lines";

Hope this helps,
# robban
$_ = 'utaohrpr akrechle etn sJ';do{s/^(.)(.*)(.)$/\2/;print "$3$1";}while
($_)


Tom S. Rodman <rodmant@solaria.sol.net> wrote
<65csrk$u2@solaria.sol.net>...
> Using perl under Windows NT is there a function or
> tool that can be called to give the ownership of a file?
> 
> "fileowner.exe" would work, except that I can NOT capture
> the output in a script so far.



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

Date: Tue, 25 Nov 1997 21:32:00 -0700
From: chrysties@mymail.com
Subject: hello
Message-Id: <251197213200@mymail.com>

Nothing to do? Let's talk


1-900-786-1900


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

Date: Tue, 25 Nov 1997 22:54:50 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do i Preform a search
Message-Id: <q2ag56.fs3.ln@localhost>

Mike Torrence (mst@fadavis.com) wrote:

: $killwords returns the number of elements in the array @killwords.


Eh?



$killwords has no relationship to @killwords. They sure do look
similiar, but nope, they are completely independant of each other.

from the 'perldata' man page (6th paragraph):

-------------
Every variable type has its own namespace.  You can, without fear of
conflict, use the same name for a scalar variable, an array, or a hash
(or, for that matter, a filehandle, a subroutine name, or a label).
This means that $foo and @foo are two different variables.  It also
-------------



Maybe you meant to say 

   the value of $#killwords is last index of array @killwords

?

from the 'perldata' man page (again ;-) (4th paragraph):

-------------
    $#days              # the last index of array @days
-------------


(which is often _not_ the "number of elements")



Or, after:

   $killwords = @killwords;


*then* you could say:

   $killwords contains the length of the array @killwords.

(it can't 'return' anything, it is a scalar)


from the 'perldata' man page (again, again):

-------------
If you evaluate a named array in a scalar context, it returns the length of
the array.  (Note that this is not true of lists, which return the
last value, like the C comma operator.)  The following is always true:
-------------



Handy things, those man pages...



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


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

Date: Tue, 25 Nov 1997 23:21:44 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do i Preform a search
Message-Id: <8lbg56.l04.ln@localhost>

Mike (mike@novahome.com) wrote:
: I am trying to perform a search on some user input for words found in a kill
: file.

:  foreach $killword (@KILLWORDS)
:  {
:   if ( $testwords  =~ /$killwords/i)
:   {
:    print " \n test word found in file $testword with $killword\n";
:   }

: @killwords comes from a file which contains the words I want searched for.
: $test words is a test string containing one of the words found in @killwords

: can any one help me??
      ^^^^^^^

There is a file already sitting on your computer that can give you
the answer in a few seconds.

Wanna hava a looksee at it?


from the Perl FAQ, part 6:

   "How do I efficiently match many regular expressions at once?"


Which has a pretty scary looking bunch of code with it  ;-)


For a bunch of fixed strings though, you could build a 
big 'or' list of them, and use the m//o modifier:

   $pat = join '|', @KILLWORDS;

   print "pattern is '$pat'\n" if $debug;  #    ;-)

   print " \n test word found in file $testword with $1\n" if m/($pat)/o;


Though you might want to escape regex metachars in each element
of @KILLWORDS (\Q), and throw in some word boundary matches (\b)
(unless your killwords are not all \w characters):


: please email me at caticus@nsis.com
: or mike@novahome.com


Please read the newsgroup where you asked the question.


: Thanks


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


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

Date: 26 Nov 1997 16:02:26 GMT
From: mhempel@select.net ()
Subject: Re: IS THERE A DB INTERFACE INTO MS SQL SERVER?
Message-Id: <65hh6i$jar@newshub.atmnet.net>

>> On Tue, 25 Nov 1997 10:46:11 -0800, "csa@netcom.com" <csa@netcom.com>
>> wrote:
>> 
>> >Does anybody know of a module that would allow me to interface
>> >into MS SQL SERVER on a Windows NT machine (besides the ODBC module)?
> 

I was able to connect to SQL Server on an NT box (with much difficulty)
using the OpenLink Drivers (www.openlinksw.com), which are free, 
and DBI::ODBC.  It forces you to run a service on the NT box to pass
queries to the  SQL Server, but it does work well ... and quickly.
  
-- 
____________________________________________________________________________
Matthew Hempel			SelectNet Internet Services
Systems Administrator		Carlsbad, California
				(760) 438-9555


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

Date: 26 Nov 1997 13:24:07 GMT
From: etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 )
Subject: Re: Killing system calls from within perl
Message-Id: <65h7tn$b35@newstoo.ericsson.se>

Alex Schajer (alex@online.emap.com) wrote:
: Hi,

: I have a script that kills the web server everytime the load gets above
: 10. I measure the load by using `UPTIME`. However we would like to know
: more information as to why the load has got so high. I thought about
: doing `TOP` after the load is over 10. However when I run TOP it goes on
: forever until I kill it from another window. Is there anyway of killing
: TOP from within perl?

: Thanks

: Alex

: -------------------==== Posted via Deja News ====-----------------------
:       http://www.dejanews.com/     Search, Read, Post to Usenet


open(PROCS,"ps -ax |grep top|grep -v grep|awk '{print \$1}'|")
		|| die "$!\n";
	while(<PROCS>)
	{
	kill 9,$_;
	}

	Pretty sloppy way of doing things, but I hope you get the general
	idea!

	Be Well 

	Regds

	Tom


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

Date: Wed, 26 Nov 1997 14:56:47 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: last element in an array?
Message-Id: <EK9DIn.EHE@world.std.com>

, snailgem@aol.com writes:

>In order to do this, I need to be able to reference the last element of
>the array returned by grep. How do I do this?
>I.E., if
>@matches=grep (/line\d_/, @myfile);
>and
>$nu_matches=grep (/line\d_/, @myfile);
>how do I reference the last element of @matches? ($matches[$nu_matches]
>doesn't work).

For the array @matches, the last element of the array can be refered
to as $#matches. You can also find out the number of elements in the
array by referring to the array name in a scalar context. (and from
the number of elements, you can get the index of the last element.)
See the perldata man page for details.

But what you probably really want to be doing is using the push()
function to append elements to an array. See the entry for push() in
the perlfunc man page.

I hope you don't take offense, but these seem to be very elementary
questions a person would learn when studying from any tutorial book on
perl. You might do youself a big favor by picking up a copy of
"Learning Perl".
-- 
Andrew Langmead


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

Date: Wed, 26 Nov 1997 13:29:51 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Net::FTP docs ?
Message-Id: <348023d7.511621823@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Wed, 26 Nov 1997 06:11:34 -0600, Alex Schajer
<alex@online.emap.com> wrote:

>Hi,
>
>Does anybody know where I can get some documentation for net::FTP
>
>or better still could you tell me how to check a Transfer has got to
>it's destination?

The docs are included, aren't they?

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 26 Nov 1997 12:09:25 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: Re: perl bad for backgroud job?
Message-Id: <3482111a.433918822@elf.bri.hp.com>

On 22 Nov 1997 02:50:11 GMT, esiu@cs.UAlberta.CA (Ernest Siu) wrote:

>Is perl bad for a job which is run continously on background?
>I have a simple perl program to periodically record some data.
>It is supposed to be run continuously on the background.
>However, after I ran it for couple of days, it seems like it
>is eating up more and more RAM as time goes.  Is there anything
>special about memory allocation in perl?  Any suggestion?

Assuming you haven't done anything daft that has created a memory
leak, then make sure that you have v5.004_04 of Perl.  I was using
5.004_03 and there was definitely a leak problem with that, which went
away when I upgraded.
----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.


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

Date: 26 Nov 1997 14:02:51 GMT
From: lvirden@cas.org
Subject: Re: perl development package ?
Message-Id: <65ha6b$hef$8@srv38s4u.cas.org>


According to Kermit Tensmeyer  <kermit@ticnet.com>:
:  Sorry, but this type of functionality already exists in the
: One-True Editor. I can have it track function definition
: module usage and some pretty good syntax verification.

That's probably true.  However, not everyone can/will run TOTE
(The One True Editor) and so in the spirit of perl doing things
in multiple ways, some of us were seeking another way.


: oh by the way... go to a prompt  and type perl -dw filename.pl
:
:  and use the T, W or V commands to examine variables in packages

Okay, I did.  I got an error from perl 5.004_054 saying that there
wasn't any such method as W.  

: as well. This is documented in the perl man pages AND the camel

Yes, there is some doc on the debugger.  I myself would never have
thought of looking at a debugger for a source code browser.  And
in fact, looking at the T and V options and trying them still leaves
me wishing for something like cscope for perl.  But my
plate of tasks is rather full so I just will dream of the day that
someone out there will get inspired to write a different development
environment for folk who want to do things differently.
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Wed, 26 Nov 1997 14:04:43 +0000
From: iqbal <webadmin@prestel.net>
Subject: Re: PERL Hourly Rates
Message-Id: <347C2C7B.B45F8A68@prestel.net>

twod@not.valid wrote:
> 
> Jacqui Caren (Jacqui.Caren@ig.co.uk) wrote:
> : other techniques and tools is always a plus. There are many almost
> : competent perl progammers out there who write perl that works but
> : a good perl progammers shudders when they see it - I know I usually
> : do so when I am asked to "enhance" someones software.
> 
> Is it not one of the unwritten rules about contracting/consulting that
> you
> reserve the right to throw your hands in the air and exclaim 'Who the
> hell
> wrote this junk and why ? when maintaining code ?
> 
> Believe me, someone will have said this about some of your code in the
> past if
> you have been in the industry for a while - I'm sure it's been said of
> some
> of my early work :)
> 
> IAP
> --
> I am using anti-spam measures, please replace 'not.valid' with
> 'value.net'

yeah some of my late work even :-)

Iqbal


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

Date: Wed, 26 Nov 1997 09:39:33 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: PERL Hourly Rates
Message-Id: <MPG.ee5fead4fd4c31798969b@news.concentric.net>

comdog@computerdog.com said...
> (Jonathan Feinberg) wrote:

> > comdog@computerdog.com said...

> > > CGI scripting is trivial.

> > Strong words from someone whose web page is broken.
> > (Go take a looksee.)

> please keep personal attacks in private mail.  if you would like to submit
> a bug report, you'll have to be more specific since i deal with many
> web sites.

If you troll, you've got to expect some kind of response.

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Wed, 26 Nov 1997 13:57:52 +0000
From: webadmin <webadmin@prestel.net>
Subject: Re: PERL Hourly Rates
Message-Id: <347C2AE0.53F612E3@prestel.net>

> 
> CGI is only one way of using perl as part of a web system. Knowledge
> of
> other techniques and tools is always a plus. There are many almost
> competent perl progammers out there who write perl that works but
> a good perl progammers shudders when they see it - I know I usually
> do so when I am asked to "enhance" someones software.
> 

Tell me about it. Having said that to be fair, my code is no where near 
as good as it should be, simply because in the web industry or my
postion for instance you are required to write perl scripts left right
and centre but its not your primary job, although you would like it to
be, and hence you cannot explain to your boss why you have spent days
writng beautiful code , just because it will look nice to all
programmers.

Most people need to get the thing up and running. If I'm asked to write
something specific, that has been tested to the moon and back, then the
code will sparkle, but getting time to do it is another problem :-)

Iqbal


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

Date: Wed, 26 Nov 1997 11:17:18 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: PERL Hourly Rates
Message-Id: <-2611971117180001@aggie.coaps.fsu.edu>

In article <347B635A.89C1FDA4@uswest.com>, Kevin Eson <keson@uswest.com> wrote:

+ And I can humbly say that when I have gone back and looked at my own code
+ after several months, I have said, " What the hell was I thinking?!"

That sounds familiar. Usually followed with "No, no, NO! I should have
done it _this_ way."

James - usually followed with the sounds of rewriting the code

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Wed, 26 Nov 1997 06:21:27 -0600
From: sanil@ezeenet.com
Subject: Perl ODBC problem
Message-Id: <880538825.20079@dejanews.com>

Hi, I've been trying to install Perl ODBC interface on WIN95. I've
downloaded the ODBC package from www.roth.net .As per instructions ,I've
copied the ODBC.pm file to the c:\perl\lib\ directory and the ODBC.pll to
c:\perl\lib\auto\win32\ \odbc\ directory. My script includes the line 
use Win32::ODBC ; However , when I run the script , I get the error ,
Can't load 'c:\perl\lib\auto\win32\odbc\odbc.pll in modules Win32::ODBC
at c:\perl\lib\dynaloader.pm line 450 I've tried with a different version
of Perl but the problem persists. Any suggestions ?? Sanil

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 26 Nov 1997 13:22:41 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Problem with Blat in perl script
Message-Id: <347d21e6.511125048@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On 26 Nov 1997 03:40:37 GMT, amhardin@erols.com wrote:

>I am running perl scripts on an NT server.

>I am having a problem
>with one of my scripts that registers them for our system then
>presents a form to them for additional information.

What or who is "them"?

>At the end
>of the script (after all the HTML is completed) I make a call
>to BLAT to send the user an email with the registration information.

You might use Net::SMTP to mail without spawning a separate process.

>The email is working fine, but the problem is that in the
>HTML I am getting a message right in the middle of my form which
>reads:    Sending C:\WINNT\blt55.tmp to xxxx@erols.com Subject:
>xxxxx  Password Login name is xxxx@erols.com where the xxxx is 
>data the user entered previously. 

Looks like a debugging message from Blat. Can you disable it?

>Am I using BLAT correctly?

Probably not.

Does the documentation explain how to turn off those messages?

>Can I use variable names in the BLAT command?

Probably.

>Why does it seem like the send command is being
>executed before the entire HTML code has been completed?

The buffering of STDOUT and STDERR is probably confusing things.

>Any help would be appreciated! 
>
>Annie          

Sounds like a "blat" problem, not a Perl problem. Your Perl code
appears to work fine.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 26 Nov 1997 14:39:08 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Regex for three equal characters
Message-Id: <slrn67od4c.int.Tom.Grydeland@mitra.phys.uit.no>

On 26 Nov 1997 02:28:05 GMT,
? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> wrote:

> /(.)\1\1*/
> 
> Matchers what the person asked in the body.

Nope.  That's two or more.  The last \1 is optional.

/(.)\1\1+/


-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Wed, 26 Nov 1997 13:26:49 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: send mail using perl5
Message-Id: <347f2386.511540566@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On 26 Nov 1997 10:43:44 GMT, kthl@msg.ti.com (Thana Letchumi) wrote:

>hi,
>  I'm  writing a perl script using cgi.pm modules (on Windows NT) to interface 
>with web for user entry form. I need to know how I could send an automated 
>mail to receipients with the user input as the message to send?.
>Thanks.

Have you looked for Mail-related modules on CPAN?

I think you'll find some.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 26 Nov 1997 13:17:00 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: setting cookies with newCGI.pm
Message-Id: <347c210e.510908848@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Tue, 25 Nov 1997 23:57:18 GMT, mischa@pi.net (Mischa van Rijswijk)
wrote:

>Can somebody explain to me how I can set a cookie with newCGI.pm?
>I tried the following:
>
>$new_cookie = query->cookie(-name=>'bla');
>print query->cookie etc.
>
>but it doesn't work. I don't get errors, but the thing just doesn't
>set the cookie. 
>Thank you for your trouble to help me.

I don't know what 'newCGI.pm' is, so maybe you ought the mail the
author and ask him/her--especially if it isn't well documented.

However, I do know that 'CGI.pm' is well documented and the cookies
work well. You may want to consider switching.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 26 Nov 1997 11:16:48 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: setting cookies with newCGI.pm
Message-Id: <MPG.ee6157e2448463498969d@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the cited author.]

mischa@pi.net said...
> $new_cookie = query->cookie(-name=>'bla');
> print query->cookie etc.

You'll want to read the documentation that accompanies CGI.pm.
As with all of Mr. Stein's stuff, it's well-written and thorough.

In brief, cookies are sent as part of the http header.

print header( -cookie => $new_cookie );

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Wed, 26 Nov 1997 11:08:34 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Silly diamond operator (<>) problem?
Message-Id: <MPG.ee6138dc8fd559d98969c@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the cited author.]

mcdermidg@acm.org said...

> The problem is that if the input is a specified list of files, or
> redirected input it works OK, but if I use wildcards it fails, e.g.  perl
> x.pl *.err, the error being like "Can't open *.err". Is there something
> silly I missed here?

Sounds like whatever shell you're using isn't globbing.  I just tried
the following program from my NT command shell

   #!perl -w
   print join(" ", @ARGV), "\n";

and then invoked it from the command line thusly:

   perl foo.pl *.pl

and got the output

   foo.pl security.pl test.pl tree.pl

What do you get?  Are you using unnecessary quotes in your command line?

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Tue, 25 Nov 1997 13:34:41 +0100
From: Bernard Weiler <pmp@egnetz.uebemc.sie.de>
Subject: Re: Simulation & modeling
Message-Id: <347AC5E0.3F31@egnetz.uebemc.sie.de>

Andy Leigh wrote:
> 
> I'm curious to know if anyone has built any Discrete-event simulations
> using Perl. I know there are lots of languages well suited to such an
> enterprise, but I'm a lousy programmer, and don't have time to learn
> another language (I'm not exactly sparkling at Perl)
> 
> I've had a look through a news archive and CPAN, but can't see any
> relevant references. If you've done some experimenting or I've missed
> an obvious thread, please let me know.
> 
> --
> Andy Leigh

We scheduled an information transition simulator for telecommunication
equipment. We arn't really sure about implementing
a huge core like the one in VHDL.

berni
-- 
--------------------
Name:		Bernard Weiler
Org.:		OeN TR HW A, Mch-H, Siemens AG
email: 		pmp@egnetz.uebemc.sie.de (add 'mens' to 'sie'; Sorry, spamming
suppression) 
PGP:		the public key may be downloaded from
pgp-public-keys@uni-paderborn.de


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

Date: Wed, 26 Nov 1997 16:03:40 +0000
From: Dean Parratt <eeparrad@swansea.ac.uk>
Subject: sytem command test
Message-Id: <347C485C.658B@swansea.ac.uk>

I want to test out perl's system() command. I have been told to use
something along the lines of "pwd >/tmp/pwd" so that I can actualy read
the file in tmp. Can anyone tell we the correct way to implement this?


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

Date: Wed, 26 Nov 1997 16:23:49 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: sytem command test
Message-Id: <347d4cdb.522121390@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On Wed, 26 Nov 1997 16:03:40 +0000, Dean Parratt
<eeparrad@swansea.ac.uk> wrote:

>I want to test out perl's system() command. I have been told to use
>something along the lines of "pwd >/tmp/pwd" so that I can actualy read
>the file in tmp. Can anyone tell we the correct way to implement this?

The system() call is clearly documented in the Perl documentation that
comes with every Perl distribution.

If you're on Unix, try "man perl" or "perldoc system" and see what
happens.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 26 Nov 1997 13:36:55 +0100
From: ckc@hobbes.ejoper.dmi.min.dk (Casper K. Clausen)
Subject: Re: use of chdir in backquote
Message-Id: <wvpbtz7al20.fsf@hobbes.ejoper.dmi.min.dk>

venkat5@hotmail.com writes:

[DISCLAIMER: I do not have access to an NT system, so I've been unable
to test this.]

>  print `chdir \dir1`;    is not working.
> i am using Perl5.001 under WinNT 4.0

IIRC, backticks are subject to double-quote interpolation. This means
that e.g. `chdir $1` will interpolate the value of $1 before spawning
the process. It also means, however, that special characters should be
escaped if they are to 'fall through' to the shell. In your case,

print `chdir \\dir1`;

ought to do the trick. Notice that I escaped the backslash.

Regards,
Kvan.

-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- |  unattempted is impossible.'
           Lokal  544            |   
I do not speak for DMI, just me. |        - Lord Mhoram, Son of Variol.      


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

Date: Wed, 26 Nov 1997 06:28:00 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: use of chdir in backquote
Message-Id: <65hbjj$oj2@bgtnsc02.worldnet.att.net>

No, it probably works, but it probably also isn't doing what you want. Are
you trying to change to a different directory so you can have your Perl
script use that directory as its default? If so, put on your peril-sensitive
sunglasses and try this experiment:

$p = `chdir \\dir1`;
print $p,"\n";
print `cd`;

The first two lines will tell you what, if anything, chdir says when you try
to invoke it (like if it can't change to that directory because it doesn't
exist). The third line will tell you what your current working directory is.
If it's not the one you're looking for, you may want to use Perl's chdir:

chdir ("\\dir1") or die "Can't chdir to \\dir1 (does it exist?)";
print `cd`;

HTH,

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl

venkat5@hotmail.com wrote in message <880542687.21842@dejanews.com>...
>could anyone please heip me in how to use chdir(change directory) in
>backquotes.
> print `chdir \dir1`;    is not working.
>i am using Perl5.001 under WinNT 4.0
>Regards.
>venkat
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet




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

Date: Wed, 26 Nov 1997 06:44:12 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: use of chdir in backquote
Message-Id: <si5h56.0k.ln@localhost>

venkat5@hotmail.com wrote:
: could anyone please heip me in how to use chdir(change directory) in
: backquotes.
:  print `chdir \dir1`;    is not working.
          ^^^^^

Backticks run system commands, and return their output.

system() is used to run system commands when you do not need to
capture the command's output.

Does NT have a command named 'chdir'?

You can do it with Perl's built-in chdir(), which will run faster
and be platform independant. See how to use it in the 'perlfunc' man page.



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


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

Date: Wed, 26 Nov 1997 15:04:43 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: use of chdir in backquote
Message-Id: <EK9Dvw.Ju6@world.std.com>
Keywords: chdir in backquote

venkat5@hotmail.com writes:

>could anyone please heip me in how to use chdir(change directory) in
>backquotes.
> print `chdir \dir1`;    is not working.
>i am using Perl5.001 under WinNT 4.0
>Regards.
>venkat

Backquotes start a child process. A child processes can only do a
limited number of things that affect its parent. Changing the parent's
current working directory is not one of them.

Take a look at the chdir() function in the perlfunc man page.

You should also be wary using backslashes in double quoted strings or
any "doublequotish" construct. (of which backticks are one.)
-- 
Andrew Langmead


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

Date: Wed, 26 Nov 1997 07:17:16 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: why does this program exit?
Message-Id: <sg7h56.jp.ln@localhost>

Ty Cage Warren (tycage@infi.net) wrote:
: Joel Bremson wrote:


: >         open(TEMP ,"cat tempagree.doc|") || "can't cat tempagree.doc
: > $!";

: I wouldn't bother with cat there.  


Even if there was a die() in there, pipe opens don't return
success/failure like most folks expect it to.

This is explained in the Perl FAQ, part 8:

   "Why doesn't open() return an error when a pipe open fails?"


Try (after putting in the missing 'die'):

   open(TEMP ,"cat non-existant-file|") || die "Can't open tempagree.doc: $!";

and see that the die() doesn't print anything...


So "wouldn't bother" is not strong enough.

I would say "using cat and a pipe open there is wrong" (or at least
a lot more trouble to test for success).



: Perl should be able to read the file
: just fine.  I'd use

:           open(TEMP,"tempagree.doc") or die "Can't open tempagree.doc:
: $!\n";

: You also left out the die there, which should be giving you an error of
: some
: sort.


No it is not a (syntax) error.

It is a logic error.

You are allowed to use a string in a void context (which is what perl
is seeing there)

Yet another occasion where perl will remain silent when you make a
mistake, unless you use the -w switch.


Using the -w switch, it's not just a good idea, it's the...


well, it _is_ just a good idea   ;-)


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


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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