[10405] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3998 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 17 14:01:57 1998

Date: Sat, 17 Oct 98 11:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 17 Oct 1998     Volume: 8 Number: 3998

Today's topics:
    Re: Are there no PERL experts out there?? Is there no o <matt@whiterabbit.co.uk>
        comparing variables out of list array? (Ok1aGo)
        File upload from www to Windows server <javaneese@hotmail.com>
        Getting Perl to forget - reinitialisation of variables jerh@my-dejanews.com
    Re: Getting Perl to forget - reinitialisation of variab (David Alan Black)
    Re: How to write a recursive function (Larry Rosler)
    Re: Is this a bug? (Tad McClellan)
    Re: Is this a bug? <jdf@pobox.com>
        my perl programs can't use sendmail - HELP please! (urg ultrabyte@my-dejanews.com
        My perl-scripts can't send emails using sendmail - HELP ultrabyte@my-dejanews.com
    Re: New Module: File::Finder -- OO version of File::Fin <tchrist@mox.perl.com>
        On the untrustworthyness of Benchmark.pm (was: The spac <tchrist@mox.perl.com>
    Re: Passing Filehandle as parameters to function (Tad McClellan)
    Re: Perl & window.open <andrewcs@tig.com.au>
    Re: PERL and SQL (Linux) (Garth Sainio)
        Perl Q: wrong output Q's <bobm@cunix.com>
        Perl, SQL & Oracle tutorial sought <mds-resource@mediaone.net>
        Please help me - unknown script routine ... (David Rummel)
        Please help me - unknown script routine ... (David Rummel)
    Re: Please help me - unknown script routine ... <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (Patrick Timmins)
    Re: Slow Sort? <alexis@danae.demon.co.uk>
    Re: Sorry (Bart Lateur)
    Re: Statistics for comp.lang.perl.misc (Bart Lateur)
        sub and return <army.tennis@lineone.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 17 Oct 1998 18:25:57 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <3628D325.66376935@whiterabbit.co.uk>

rafely@xxiname.com wrote:

> (snip) I've posted this questions several
> times in this newsgroup and other CGI newsgroup and
> CGI forums.

If you post a question and nobody replies, it's generally due to one or
more of the following:

1) This newsgroup is _busy_.  Posts get missed.
2) Nobody who sees the post knows the answer.
3) Everybody knows the answer but is tired of explaining it.
4) Your title is so crap that it gives no hint whatsoever to the content
of your message.
5) Your title is crap and obnoxious, and makes people take an instant
dislike to you before even reading what you have written.

And, in spite of loads of good answers here, I see no "thanks guys for
your help"... kinda makes you wonder why people bother, doesn't it?

Matt


-- 
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons


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

Date: 17 Oct 1998 17:16:10 GMT
From: ok1ago@aol.com (Ok1aGo)
Subject: comparing variables out of list array?
Message-Id: <19981017131610.27164.00000947@ng77.aol.com>

Hi, I am not a perl expert and would like help with the following:

I would like to know how to match
if ($blabla eq $whatever) out of 2 different lists; what I can do is compare
those variables when they are exactly the same. But how to verify that $blabla
contains the word behind $whatever. (Ex $blabla would be "myself" and $whatever
would be "myself and I": how to encode this?) 
How to exclude whenever a PART of a variable matches?
I would like to know the code, similar to 
if ('blabla" eq " /^blabla/") but for variables out of a list array.

Thanks in advance,
Claire


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

Date: Sat, 17 Oct 1998 12:58:16 +0200
From: Daniel <javaneese@hotmail.com>
Subject: File upload from www to Windows server
Message-Id: <36287848.978B2FAE@hotmail.com>

Hi,

I have a problem with upload from a browser I am trying to use fup.pl to
upload files to a windows server. I have tried with both Windows NT
(IIS3) and PWS on Win95. I CAN upload .txt files but NOT any other kind
of files like .doc and .zip.

Anyone who have a good solution for this? All help would be greatly
appreciated!
If possible, please send an e-mail since my ISP removes the news older
than a day or so (approximately)

Thanks,
Daniel



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

Date: Sat, 17 Oct 1998 15:08:27 GMT
From: jerh@my-dejanews.com
Subject: Getting Perl to forget - reinitialisation of variables
Message-Id: <70abtb$4mv$1@nnrp1.dejanews.com>

This is tricky to explain but here goes.

I'm processing through many files and generating hashes of hashes on each
pass and then using these HoHs to generated new data files. My problem is
that I want the HoH to be blank at the start of each iteration s.t. each new
file doesn't contain an amalgamation of the info form the previous iteration.
(something akin to free'ing the mem. associated with the HoH b4 the start of
the next iteration)

I've tried putting the stuff into a subroutine and using local but it doesn't
appear to be working (possible because I'm not using the correct form for a
HoH to the local fnc.)

The only way I've been able to get this to happen is by using a little batch
file and calling my perl script numerous times with the dirrerent args. Kludge
or what.

Any help would be appreciated.

Cheers,

Jerh.

Also is there anywhere expounds the virtues of Perl and it's various elements

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 17 Oct 1998 12:23:40 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Getting Perl to forget - reinitialisation of variables
Message-Id: <70agac$6qq$1@pilot.njin.net>

Hello =


jerh@my-dejanews.com writes:

>This is tricky to explain but here goes.

>I'm processing through many files and generating hashes of hashes on each
>pass and then using these HoHs to generated new data files. My problem is
>that I want the HoH to be blank at the start of each iteration s.t. each new
>file doesn't contain an amalgamation of the info form the previous iteration.
>(something akin to free'ing the mem. associated with the HoH b4 the start of
>the next iteration)


How about:

%hash = ();

or

undef %hash;

?


David Black
dblack@pilot.njin.net


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

Date: Sat, 17 Oct 1998 08:42:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to write a recursive function
Message-Id: <MPG.10925aca8d4b82d9898bf@nntp.hpl.hp.com>

In article <VA.00000014.02713dae@dlucas.gol.com> on Sat, 17 Oct 1998 
09:49:16 GMT, Dan Lucas <dlucas@removethisgol.com> says...
> I am trying to write a script which uses a recursive function which 
> walks through a directory tree and does something to each file
 ...
> any pointers to what I have done wrong would be much appreciated.

Some might say that what you have done wrong is not using File::Find.  
However, ...
 ... 
> $input_dir = "e:foo"; # for testing purposes

"e:\\foo" or 'e:\foo' or (better, IMO) 'e:/foo'

> if (substr($input_dir,(length($input_dir)-1),1) ne "\\") {$input_dir .= 
> "\\"}; # add slash if necessary

This line is OK as written, but somewhat verbose.  'substr' lets you 
count from the back directly:

  if (substr($input_dir,-1,1) ne "\\") {$input_dir .= "\\"}; # add slash 
if necessary

Of course, I would add a forward slash instead.  Another way, using a 
regex:

  $input_dir =~ s!([^\\/])$!$1/!;

This allows either flavor of slash at the end.

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


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

Date: Fri, 16 Oct 1998 22:02:12 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Is this a bug?
Message-Id: <kb1907.l14.ln@flash.net>

Renata Janosi (rjanosi@uakron.edu) wrote:
: Jonathan Feinberg wrote:
: > 
: > Renata Janosi <rjanosi@uakron.edu> writes:
: > 
: > > % perl -ne 'unless ( /^ *$/ ) { s/[^|]$/$&|/; print }' < xx
: > 
: > Try this:
: > 
: >   % perl -wlne 'next if /^\s*/; chomp; s/([^|])$/$1|/; print';
: > 
: I tryed:

:    % perl -wlne 'next if /^\s*/; chomp; s/([^|])$/$1|/; print;' < xx
                                ^
                                ^

   I think Jonathan meant to stick a dollar sign in there.

   It matches any line at all in its current form...


: and I got no output at all. 


   ... which explains why it never got to the print() statement   ;-)


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


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

Date: 17 Oct 1998 19:11:26 +0200
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Is this a bug?
Message-Id: <m3r9w73ygx.fsf@joshua.panix.com>

tadmc@flash.net (Tad McClellan) writes:

> :    % perl -wlne 'next if /^\s*/; chomp; s/([^|])$/$1|/; print;' < xx
>                                 ^
>    I think Jonathan meant to stick a dollar sign in there.

Yup. Oops.

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


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

Date: Sat, 17 Oct 1998 12:13:53 GMT
From: ultrabyte@my-dejanews.com
Subject: my perl programs can't use sendmail - HELP please! (urgent!)
Message-Id: <70a1m1$r0p$1@nnrp1.dejanews.com>

Hi!

Another stupid question:

Since i had to switch to another provider and server i have to re-configure my
perl-scripts (formmail and guestbook written by Matt Wright and a unique
postcard-service written by myself). Everything worked fine at my former
server. Now the perl-scripts work, but no emails can be sent. The path is ok
(my ISP told me that: /bin/sendmail/).
My ISP told me that there has to be a sender defined in my scripts which
exists on my server - otherwise sendmail wouldn't work in order to avoid
unauthoruzed usage of sendmail. How can I add a sender?
How do I have to configure my formmail-script to make it send emails? (I
don't have a telnet account and can't change anything at the server and my
ISP is not willing to change anything - he told me my scripts were wrong -
but they worked fine on two other servers before).

One of the perl-codes i use for sending a message is:


###############################################################
sub send_it
{
open (MAIL, "|$sendmail_prog -t") || die "Can't open $sendmail_prog!\n";

print MAIL "To: $mail\n";
print MAIL "From: $nachricht_absender ($nachricht_abs_name)\n";
print MAIL "Reply-to: $replyto\n";
print MAIL "Subject: Eine Postkarte von $sender!\n\n";

print MAIL "\nHallo $recipient,\n\n";
print MAIL "Eine Postkarte wartet auf Sie!\n";
print MAIL "Der Absender ist: $sender\n(E-Mail: $replyto)\n\n";
print MAIL "Um die Karte abzuholen, gehen Sie bitte mit Ihrem Webbrowser
zu\n\n";
print MAIL "$scripts_url/$get_script?$key \n\n";
print MAIL "Ihre Postkarte liegt $days_to_keep Tage bei dieser Adresse ";
print MAIL "zur Abholung bereit.\n\n";
print MAIL "Mit den besten Empfehlungen\nvom Webmaster bei $site_url/\n\n";
print MAIL
"----------------------------------------------------------------------\n\n"
;
print MAIL "$nachricht_werbung\n\n";
close MAIL;

} # end of &send_it

###############################################################

$nachricht_absender is filled with a working pop-account
(myname@mydomain.com)
$sendmail_prog is filled with '/bin/sendmail'



How can I tell sendmail that I'm authorized to send mails from my virtual
server?
Please Help....


Thankyou

Rainer


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


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

Date: Sat, 17 Oct 1998 11:49:40 GMT
From: ultrabyte@my-dejanews.com
Subject: My perl-scripts can't send emails using sendmail - HELP please - it's urgent...
Message-Id: <70a08k$puc$1@nnrp1.dejanews.com>

Hi!

Another stupid question:
Since i had to switch to another provider and server i have to re-configure my
perl-scripts (formmail and guestbook written by Matt Wright and a unique
postcard-service written by myself). Everything worked fine at my former
server. Now the perl-scripts work, but no emails can be sent. The path is ok
(my ISP told me that: /bin/sendmail/).
My ISP told me that there has to be a sender defined in my scripts which
exists on my server - otherwise sendmail wouldn't work in order to avoid
unauthorized usage of sendmail. How can I add a sender?
How do I have to configure my formmail-script to make it send emails? (I
don't have a telnet account and can't change anything at the server and my
ISP is not willing to change anything - he told me my scripts were wrong -
but they worked fine on two other servers before).

One of the perl-codes i use for sending a message is:


###############################################################
sub send_it
{
open (MAIL, "|$sendmail_prog -t") || die "Can't open $sendmail_prog!\n";

print MAIL "To: $mail\n";
print MAIL "From: $nachricht_absender ($nachricht_abs_name)\n";
print MAIL "Reply-to: $replyto\n";
print MAIL "Subject: Eine Postkarte von $sender!\n\n";

print MAIL "\nHallo $recipient,\n\n";
print MAIL "Eine Postkarte wartet auf Sie!\n";
print MAIL "Der Absender ist: $sender\n(E-Mail: $replyto)\n\n";
print MAIL "Um die Karte abzuholen, gehen Sie bitte mit Ihrem Webbrowser
zu\n\n";
print MAIL "$scripts_url/$get_script?$key \n\n";
print MAIL "Ihre Postkarte liegt $days_to_keep Tage bei dieser Adresse ";
print MAIL "zur Abholung bereit.\n\n";
print MAIL "Mit den besten Empfehlungen\nvom Webmaster bei $site_url/\n\n";
print MAIL
"----------------------------------------------------------------------\n\n"
;
print MAIL "$nachricht_werbung\n\n";
close MAIL;

} # end of &send_it

###############################################################

$nachricht_absender is filled with a working pop-account
(myname@mydomain.com)
$sendmail_prog is filled with '/bin/sendmail'



How can I tell sendmail that I'm authorized to send mails from my virtual
server?
Please Help....


Thankyou

Rainer

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 17 Oct 1998 13:49:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <70a78u$ao5$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    John Porter <jdporter@min.net> writes:
:As it frequently happens that people clamor for a directory
:tree traverser with a better interface than File::Find, 

They do?

:I have
:taken the liberty of object-orientificationalizing File::Find.

Oh boy.  More objects.  :-(

>Rather than passing a sub ref to the find() function, 
>you derive a class which overrides the callback() method.

Oh my!  You aren't kidding, are you? 

Sounds like a good way to render this inaccessible to 
regular programmers.  Whether this is good or bad I'll
let you decide for yourself. :-)

File::Find is perfectly simple.  Why obfuscate it?

--tom
-- 
"Never piss off a bard, for they are not at all subtle and your name scans to
 `Greensleeves'."  ---unknown, quoted by Janet D. Miles in alt.callahans


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

Date: 17 Oct 1998 02:00:12 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: On the untrustworthyness of Benchmark.pm (was: The space deletion woes...)
Message-Id: <708tnc$7e2$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Tk Soh <r28629@email.sps.mot.com> writes:
:#!/usr/local/bin/perl -w
:use Benchmark;
:
:$x = "  Here    goes     nothing one space now\t\fend\nhere";
:
:timethese (50000, {
:  All => sub { $_ = $x;  s/\s+//g },
:  One => sub { $_ = $x;  s/\s+?//g },
:  tr=> sub { $_ = $x; tr/ \t\n\r\f//d},
:} );
:
:Benchmark: timing 50000 iterations of All, One, tr...
:       All:  8 wallclock secs ( 7.11 usr +  0.00 sys =  7.11 CPU)
:       One: 11 wallclock secs (10.67 usr +  0.00 sys = 10.67 CPU)
:        tr:  3 wallclock secs ( 2.81 usr +  0.00 sys =  2.81 CPU)

Like so many others, this example benchmark, I regret, essentially
proves nothing.  You have tried only one data set.  Please examine the
following slightly more comprehensive benchmark results.

What observations can you make reading these results that you could
not make from the lone example of your above?  The important thing
to pay attention to here is not the absolute numbers, but the
rate of change relative to each other and to itself.

--tom

#!/usr/bin/perl
# benchmark-deceptive

use Benchmark;

$mask = "%3d %2s %2s";

for $iter ( 5, 10, 20, 40, 80, 160 ) {
    for $str ( q<xx>, q<xo>, q<oo> ) {
	my $o =  $str x $iter;
	push @pairs, sprintf($mask, $iter, "tr", $str),
		      sub { ($n=$o) =~ y/x//d };
	push @pairs, sprintf($mask, $iter, "s", $str),
		  sub { ($n=$o) =~ s/x//g };
    }
}

print join("\n", @pairs, '');

timethese 100_000 => { @pairs };

__END__

Sample results:

   5  s oo:  1 wallclock secs ( 0.53 usr +  0.00 sys =  0.53 CPU)
   5 tr oo:  1 wallclock secs ( 0.60 usr +  0.00 sys =  0.60 CPU)
   5  s xo:  2 wallclock secs ( 1.67 usr +  0.00 sys =  1.67 CPU)
   5 tr xo:  1 wallclock secs ( 0.59 usr +  0.00 sys =  0.59 CPU)
   5  s xx:  3 wallclock secs ( 2.24 usr +  0.00 sys =  2.24 CPU)
   5 tr xx:  1 wallclock secs ( 0.60 usr +  0.00 sys =  0.60 CPU)

  10  s oo:  0 wallclock secs ( 0.55 usr +  0.00 sys =  0.55 CPU)
  10 tr oo:  1 wallclock secs ( 0.62 usr +  0.00 sys =  0.62 CPU)
  10  s xo:  1 wallclock secs ( 2.49 usr +  0.00 sys =  2.49 CPU)
  10 tr xo:  1 wallclock secs ( 0.62 usr +  0.00 sys =  0.62 CPU)
  10  s xx:  4 wallclock secs ( 3.66 usr +  0.00 sys =  3.66 CPU)
  10 tr xx:  1 wallclock secs ( 0.63 usr +  0.00 sys =  0.63 CPU)

  20  s oo:  1 wallclock secs ( 0.56 usr +  0.00 sys =  0.56 CPU)
  20 tr oo: -1 wallclock secs ( 0.67 usr +  0.00 sys =  0.67 CPU)
  20  s xo:  5 wallclock secs ( 4.09 usr +  0.00 sys =  4.09 CPU)
  20 tr xo: -1 wallclock secs ( 0.68 usr +  0.00 sys =  0.68 CPU)
  20  s xx:  6 wallclock secs ( 6.46 usr +  0.00 sys =  6.46 CPU)
  20 tr xx: -1 wallclock secs ( 0.69 usr +  0.00 sys =  0.69 CPU)

  40  s oo: -1 wallclock secs ( 0.62 usr +  0.00 sys =  0.62 CPU)
  40 tr oo:  0 wallclock secs ( 0.81 usr +  0.00 sys =  0.81 CPU)
  40  s xo:  6 wallclock secs ( 7.25 usr +  0.00 sys =  7.25 CPU)
  40 tr xo:  1 wallclock secs ( 0.83 usr +  0.00 sys =  0.83 CPU)
  40  s xx: 12 wallclock secs (12.08 usr +  0.00 sys = 12.08 CPU)
  40 tr xx:  1 wallclock secs ( 0.83 usr +  0.00 sys =  0.83 CPU)

  80  s oo:  1 wallclock secs ( 0.74 usr +  0.00 sys =  0.74 CPU)
  80 tr oo:  1 wallclock secs ( 1.10 usr +  0.00 sys =  1.10 CPU)
  80  s xo: 14 wallclock secs (13.61 usr +  0.00 sys = 13.61 CPU)
  80 tr xo:  1 wallclock secs ( 1.06 usr +  0.00 sys =  1.06 CPU)
  80  s xx: 24 wallclock secs (23.28 usr +  0.00 sys = 23.28 CPU)
  80 tr xx:  0 wallclock secs ( 1.08 usr +  0.00 sys =  1.08 CPU)

 160  s oo:  1 wallclock secs ( 1.00 usr +  0.00 sys =  1.00 CPU)
 160 tr oo:  2 wallclock secs ( 1.57 usr +  0.00 sys =  1.57 CPU)
 160  s xo: 27 wallclock secs (26.33 usr +  0.00 sys = 26.33 CPU)
 160 tr xo:  2 wallclock secs ( 1.58 usr +  0.00 sys =  1.58 CPU)
 160  s xx: 46 wallclock secs (45.70 usr +  0.00 sys = 45.70 CPU)
 160 tr xx:  2 wallclock secs ( 1.58 usr +  0.00 sys =  1.58 CPU)
-- 
#define SVs_RMG   0x00008000  /* has random magical methods */
    --Larry Wall, from sv.h in the v5.0 perl distribution


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

Date: Sat, 17 Oct 1998 10:51:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Passing Filehandle as parameters to function
Message-Id: <qdea07.5g6.ln@flash.net>

Jules (julius@clara.net) wrote:

: Dear all, newbie question: 


   The great bulk of newbie questions have been answered in
   the Perl FAQ. The Perl FAQ is included in the distribution
   of perl itself, so the answer is likely already on your
   hard disk somewhere...


: how do I pass a filehandle as a parameter to a
: function which can then make use of them? 


Perl FAQ, part 5:

   "How can I make a filehandle local to a subroutine?  
    How do I pass filehandles between subroutines?  
    How do I make an array of filehandles?"


   See?   ;-)


   Use the docs, Luke.


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


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

Date: Sun, 18 Oct 1998 00:26:03 +1000
From: "Andrew Scott" <andrewcs@tig.com.au>
Subject: Re: Perl & window.open
Message-Id: <70a9bs$eek$1@toto.tig.com.au>


Tom Phoenix <rootbeer@teleport.com> wrote in message
Pine.GSO.4.02A.9810151320520.26848-100000@user2.teleport.com...
>On Thu, 15 Oct 1998 tomkrowas@my-dejanews.com wrote:
>
>> What I am wanting to do is to have a new browser window open when the
>> URL is clicked.
>
>That sounds as if you want to ask a browser to do something. The docs,
>FAQs, and newsgroups about browsers should be of help to you. Good luck!

    You are beginning to sound like a broken record.......




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

Date: Sat, 17 Oct 1998 07:26:16 -0500
From: modred@shore.net (Garth Sainio)
Subject: Re: PERL and SQL (Linux)
Message-Id: <modred-1710980726160001@mrlbma-01-230.port.shore.net>

In article <36286299.48D6@edoc.co.za>, info@edoc.co.za wrote:

> Hi,
> 
> I must expand my PERL horizon to SQL.
> 
> I'm Running Linux, and would like to know if there is somewhere a
> FAQ/HowTo or similar?
> 
> Or could somebody give me a good start?
> 
> Thanks
> 
> Nico


If you have to access an existing database then you should looking into
the DBI module (perldoc DBI should get you started).


Garth

-- 
Garth Sainio               "Finishing second just means you were the 
modred@shore.net            first to lose" - anonymous


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

Date: Sat, 17 Oct 1998 11:16:36 -0400
From: Bob Mariotti <bobm@cunix.com>
Subject: Perl Q: wrong output Q's
Message-Id: <3628B4D4.59B94C28@cunix.com>

We are reasonably seasoned perl/cgi programmers but have one we just
can't seem to solve.  Perhaps someone has some suggestions.
Here is the situation:
web page sends form handled by perl 5.005 cgi script.  script generates
single request string and sends needs to communicate with attached host
via tty port.  Because the perl I/O was too slow for host, we use back
ticks to call a C program to do same (ex: $REC=`abc string`;)
$REC will receive multiple lines (ascii records) of response until a
non-zero return code is received.  Returned info is output to dynamic
html delivered via stdout to requesting site.

Now - here is the problem.  Some times, and we CANNOT duplicate it, our
customers are stating that they are receiving data that is not theirs.
We do compare a reference number received on each retrieved record to
assure that it equals the reference number of the requesting page.

My questions are this:
1) is there a better way to communicate with tty ports for string I/O
other than backtics?
2) is there a better method to assure threat consistency other that
validating reference numbers?
3) what happens when the calling web page aborts prior to receiving all
its output?  Is this what may be being delivered to the next person (ie:
it's in limbo in stdout)?
4) any viable suggestions appreciated
5) Don't recommend we hire programmers as we are programmers.  Just some
with an impass as I am sure all of you have been at one time or another.

Thanks in advance.  and please, if possible, email a copy of your
response.

--
+-----------------------+---------------------------+
+ Bob Mariotti          + Financial DataCorp (FDC)  +
+ Executive V.P.        + Credit Union Specialists  +
+ email bobm@cunix.com  + 703 Hebron Avenue         +
+ (860) 657-8983 voice  + Glastonbury, CT 06033 USA +
+ (860) 657-8987 fax    + http://www.cunix.com      +
+---------------------------------------------------+




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

Date: Sat, 17 Oct 1998 09:05:33 -0500
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Perl, SQL & Oracle tutorial sought
Message-Id: <3628A42D.75DC1F12@mediaone.net>

I am about to embark on a long project that will be heavily dependent on
Oracle databases.

I have been programming Perl for several years; but, never had the
opportunity, until now, to extensively interact with external
databases.  I have used SQL in previous incarnations; but, not in a Perl
context.  Nevertheless, I am reasonably versed in RDBMS concepts -- I am
_not_ looking for the RDBMS 101 course.

I have begun looking into the FAQ's, pods and various O'Reilly books in
my library.  I know that I have alot of reading in front of me. 
However, reading, alone, is rarely adequate for me -- I need to start
writing simple scripts quickly -- without which my simple brain rarely
retains new concepts.

Those of you with this expertise, please, point me to the optimal
literature/documentation for putting these ducks in a row.  Initially, I
am interested in querying, measuring RDBMS health, summarizing percent
table capacity, and probably report writing.

All suggestions will be considered.  I am looking to formulate my own
structured crash course and get down to it in short order . . .

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


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

Date: Sat, 17 Oct 1998 12:33:47 GMT
From: dave.vs@writeme.com (David Rummel)
Subject: Please help me - unknown script routine ...
Message-Id: <36288dee.47988741@news.jena.deh.de>

Hello,
I'm a novice in writing scripts in perl
and now I have a problem, I'm sure it exists,
but I haven't found it...

What I mean is the command-sequence to
do "POST" fromin perl-scripts.

I only know the one for "GET", but I
need the one for "POST" - it maybe is
only a little changing?

Again, I don't mean the way to read
the variables into my script, I want
to give variables away from my script
to another by "POST".

Is there someone able to help me???

I'm a little desperate now!!!

Please help me with your hints,
many, many thanks in advance,

David.


mailto:dave.vs@writeme.com


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

Date: Sat, 17 Oct 1998 12:35:03 GMT
From: dave.vs@writeme.com (David Rummel)
Subject: Please help me - unknown script routine ...
Message-Id: <36288ef3.48249470@news.jena.deh.de>

Hello,
I'm a novice in writing scripts in perl
and now I have a problem, I'm sure it exists,
but I haven't found it...

What I mean is the command-sequence to
do "POST" fromin perl-scripts.

I only know the one for "GET", but I
need the one for "POST" - it maybe is
only a little changing?

Again, I don't mean the way to read
the variables into my script, I want
to give variables away from my script
to another by "POST".

Is there someone able to help me???

I'm a little desperate now!!!

Please help me with your hints,
many, many thanks in advance,

David.


mailto:dave.vs@writeme.com


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

Date: 17 Oct 1998 14:21:19 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Please help me - unknown script routine ...
Message-Id: <83lnmf5qgw.fsf@vcpc.univie.ac.at>

Re: Please help me - unknown script routine ..., David
<dave.vs@writeme.com> said:

David> What I mean is the command-sequence to do "POST"
David> fromin perl-scripts.

perldoc LWP::UserAgent
perldoc HTTP::Request

David> Again, I don't mean the way to read the variables
David> into my script, I want to give variables away from my

viz,   use CGI;

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Sat, 17 Oct 1998 16:35:23 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <70ah0b$9hi$1@nnrp1.dejanews.com>

In article <708ecd$ego@panix.com>,
  ziggy@panix.com (Adam Turoff) wrote:

> Roast gecko stays on the menu.  I wouldn't mind armadillos crawling
> around the room or barbequed moose, grilled squid, marinated horseshoe
> crabs, etc.  (I draw the line at any of the Oracle bugs, or the canine/feline
> Windows animals.)

Don't forget the sed and awk "loris kabobs" (not nearly so popular
now that camel, llama, et al, are on the menu ... but they're good
"down home" cooking just the same, and I still love them).

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: 17 Oct 1998 14:29:30 GMT
From: Alexis Huxley <alexis@danae.demon.co.uk>
Subject: Re: Slow Sort?
Message-Id: <f0z6x6.31a@danae.demon.co.uk>

In <707pl6$s40@euphony.tri.sbc.com> monson@tri.sbc.com (Steve Monson) writes:

> All well and good. As it happened, the array contained about 102,000
> elements. The execution time was 40, that's right, 40 *minutes*, that's

Phew! I'm glad I'm not the only person encountering this! I have only
20Mb and have a hash of structures with 27000 elements to sort on key
and it's taking 30 minutes.

> and when I watched the program using "top" it indicated that about

Also using 'top' I watched the process's CPU usage drop from about 80%
to about 5% as the kernel swapper (which in Linux shows as a separate
process) kicked in.

> 28 MB of ram was being used, with 22MB resident. So, I expect that the
> sort was done in memory.

Yes, and obviously the sort is doing constant traversals of the array
and so the kernel never really gets a change to swap the data out.
I was kinda hoping I could say:

	use Sort::Mergesort;

or some other aesthetic way of changing the sort algorithm to something
less memory intensive method, which would therefore be less swap-inducing 
and therefore overall lower run time.

> Now, when I changed my code to use Unix's system sort on a file:

Yes, that worked for me too. I even added options '-l' and '-h' to my
script to cater for this situation. But I'm unhappy about not doing 
everything in Perl - seems unaesthetic! :-)

> Anyone else run into such a symptom?

Yes, me! I appreciate that this is a bit of a 'me too' reply, but in light
of the followups I've seen so far, which all expressed incredulity that
a sort could take so long, I felt it appropriate to follow up.

Alexis
-- 
Alexis Huxley
alexis@danae.demon.co.uk
email key: 549812


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

Date: Sat, 17 Oct 1998 11:11:38 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Sorry
Message-Id: <36305cb5.3718916@news.ping.be>

Lee Brandson wrote:

>As an occasional watcher of this ng and its predecessor for some two years
>now, I would like to ask whether it is strictly necessary to be as rude as
>possible when answering (or not answering, as the case may be) a question?
>Is this what it takes to be "in the club?" 

To be "in the club", you only have to post frequent enough. In that
case, you can get away with just about anything.

That smells like dual standards. I hate that.

	Bart.


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

Date: Sat, 17 Oct 1998 11:11:36 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <36335f13.4322981@news.ping.be>

Ronald J Kimball wrote:

>I just try to stay out of the list of Bottom Ten Posters by OCR.  :-)

Then only ask questions. All original content!

;-)

	Bart.


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

Date: Sat, 17 Oct 1998 18:51:01 +0100
From: "Todd R Koning" <army.tennis@lineone.net>
Subject: sub and return
Message-Id: <5S4W1.8738$K52.131@news-reader.bt.net>

I have been reading a book on learning perl that has exercises at the end of
chapters.  The exercise was to write a program that prompts for an input for
a radius and then outputs the circumference of the cirlce.  I managed this,
but then thought that I would try to add an option to end the program or
input a new radius.  I have tried to use a subroutine for this but got into
a bit of a mess!

1    -    Is the subroutine idea a good way of doing  it?
2    -    How do I make the subroutine work?
3    -    How do I take the return value from the sub and say whether to
re-run the prompt for input or quit the program?

I know this is easy, but I am a beginner - go easy on me please.

Tim

Here is what I ahve done

#!/usr/bin/perl -w

print ("Enter the radius of the circle. ");

$radius = <STDIN>;

chomp ($radius);

$circumference = ((2 * 3.1415)* $radius);

print ("$circumference\n");

print ("Do you want to try again? yes or no? ");

$response = <STDIN>;

chomp ($response);

repeat ()


sub repeat {

if ($response eq "yes")

{ return 1; }

} else {

return 0; }






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

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


Administrivia:

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

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


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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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