[12473] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6073 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 21 05:47:13 1999

Date: Mon, 21 Jun 99 02:00:22 -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           Mon, 21 Jun 1999     Volume: 8 Number: 6073

Today's topics:
    Re: 'Perl core' or 'perl core'? <dgris@moiraine.dimensional.com>
    Re: 'Perl core' or 'perl core'? (David H. Adler)
    Re: 'Perl core' or 'perl core'? (Ilya Zakharevich)
        ANN: XML::Dumper 0.4 eisen@pobox.com
        cannot use |- multiple times (Dave Meyer)
    Re: Cure for document deficiency <dave@dave.org.uk>
    Re: Cure for document deficiency (Ilya Zakharevich)
    Re: Cure for document deficiency (Andrew Johnson)
    Re: Cure for document deficiency <gellyfish@gellyfish.com>
    Re: Cure for document deficiency <gellyfish@gellyfish.com>
    Re: File modification time question... <portboy@home.com>
    Re: File modification time question... <wyzelli@yahoo.com>
    Re: Graphing tools for use with Perl <spillemw@se.bel.alcatel.be>
    Re: How send a file using perl on a win nt box to an em (Thomas Eichmann)
    Re: How send a file using perl on a win nt box to an em (Rainer Matzke)
    Re: Interpreting MS-ASCII - anyone have a filter? (Larry Rosler)
    Re: Interpreting MS-ASCII - anyone have a filter? (Larry Rosler)
        is there any perlscript for client-side scripting? smnayeem@my-deja.com
    Re: Language choice for high-volume Oracle CGI interfac <firstsql@ix.netcom.com>
    Re: localtime function using Activestates perl on NT4 (Markus Laker)
        Need help with a perl/cgi workaround esalmon@packet.net
    Re: newbie question... <dave@dave.org.uk>
    Re: Perl scripts slows down servers? <matt.sergeant@ericsson.com>
    Re: Perl scripts slows down servers? <matt.sergeant@ericsson.com>
    Re: printing multiple lines <spillemw@se.bel.alcatel.be>
    Re: Problems with MacPerl and modules <mjohnson@h2net.net>
    Re: Regular expresions as parameters <derek@realware.com.au>
    Re: Signature removal regex? (I.J. Garlick)
    Re: virtualave.net (Darrell Stec)
    Re: Win32 OLE - Access is Denied <matt.sergeant@ericsson.com>
    Re: Win32::odbc problem with output <f.geiger@vol.at>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 21 Jun 1999 00:09:48 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <m3emj6ulsj.fsf@moiraine.dimensional.com>

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

> The default sort runs entirely in C code in the 
> [Pp]erl core, but any sortsub must execute Perl code.
<snip>
> So, which should it be, 'Perl core' or 'perl core'?

Perl 6 won't be written in C;  the above fragment
is correct only if it reads `perl core'.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 21 Jun 1999 07:05:31 GMT
From: dha@panix7.panix.com (David H. Adler)
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <slrn7mrp1r.5ac.dha@panix7.panix.com>

In article <ebohlmanFDn3x9.1tw@netcom.com>, Eric Bohlman wrote:
>Larry Rosler (lr@hpl.hp.com) wrote:
>: "Even the simplest custom sort in Perl will be less efficient than using 
>: the default comparison. The default sort runs entirely in C code in the 
>: [Pp]erl core, but any sortsub must execute Perl code. A well-known 
>: optimization is to minimize the amount of Perl code executing and to try 
>: to stay inside the [Pp]erl core as much as possible. Later we will show 
>: various optimization techniques for Perl sorts that will reduce the 
>: amount of Perl code executed."
>: 
>: So, which should it be, 'Perl core' or 'perl core'?
>
>My vote is for "perl core."  The core of the interpreter ("perl") is indeed 
>made up of C code (OK, *compiled* C code), but the core of the language 
>("Perl") doesn't consist of C statements.

Agreement on that from this corner.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
The Inferno video is really in colour.


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

Date: 21 Jun 1999 08:13:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <7kks7u$bkt$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.11d62948512f8fc989c02@nntp.hpl.hp.com>:
> "Even the simplest custom sort in Perl will be less efficient than using 
> the default comparison. The default sort runs entirely in C code in the 
> [Pp]erl core, but any sortsub must execute Perl code. A well-known 
> optimization is to minimize the amount of Perl code executing and to try 
> to stay inside the [Pp]erl core as much as possible. Later we will show 
> various optimization techniques for Perl sorts that will reduce the 
> amount of Perl code executed."
> 
> So, which should it be, 'Perl core' or 'perl core'?

"Perl core" is the API documented in perlguts and friends.  "perl
core" is what implements Perl core and other parts of the Perl
interpreter.  Obviously, you mean perl core.

Ilya


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

Date: 21 Jun 99 06:29:42 GMT
From: eisen@pobox.com
Subject: ANN: XML::Dumper 0.4
Message-Id: <376DDBD6.39DBED31@pobox.com>

This release is a bug fix to balanced nested hashes.
It will be available at your local CPAN mirror or from
http://www.perlxml.com/modules/XML-Dumper-0.4.tar.gz

NAME
XML::Dumper Version 0.4

DESCRIPTION
XML::Dumper dumps Perl data to a structured XML format.
XML::Dumper can also read XML data that was previously dumped
by the module and convert it back to Perl.

This might be useful for dumping Perl objects to files
using an XML format that can be reloaded or accessed by
other programs. Maybe even other languages.

Feel free to contact me at eisen@pobox.com if you have
problems and/or suggestions.

REQUIREMENTS
This module requires version 2.16 or greater of the XML::Parser module.
The latest version is available at any CPAN archive.



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)




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

Date: Mon, 21 Jun 1999 07:26:56 GMT
From: dmeyer@virtc.com (Dave Meyer)
Subject: cannot use |- multiple times
Message-Id: <7kkpb1$gut$1@jhereg.dmeyer.org>

I'm trying to use the |- argument to open() to fork several child
processes which the parent can communicate with.  If I try this with
one child, I get the behavior I expect; if I try this with two (or
more) children, my program blocks trying to write to the second child.

If anyone could suggest what I'm doing wrong, I would really
appreciate it.  I'm appending a test program and the output I get.
I'm using perl5.005_03 on a linux system.

- output for one child case:
jhereg|dmeyer|~/dl> ./testchild.pl 1
parent: self=17157,child=17158
child 0 (17158): listening
sending to 17158
child 0 (17158): got SEND 17158
child 0 (17158): exiting
success

- output for two child case
jhereg|dmeyer|~/dl> ./testchild.pl 2
parent: self=17159,child=17160
parent: self=17159,child=17161
child 0 (17160): listening
child 1 (17161): listening
sending to 17160
child 0 (17160): got SEND 17160
[ the program just blocks at this point ]

- my test program:
#!/usr/bin/perl
use strict;
use Symbol;

my $num_children=$ARGV[0];
select(STDOUT); $|=1;

my @kids=();
for (my $i=0; $i<$num_children; ++$i) {
  my $fh=gensym();
  my $pid=open($fh,"|-");
  die "Problem forking" unless defined($pid);
  if ($pid == 0) {
    # child
    print "child $i ($$): listening\n";
    while (<STDIN>) {
      print "child $i ($$): got $_";
    }
    print "child $i ($$): exiting\n";
    exit(0);
  }
  # parent
  print "parent: self=$$,child=$pid\n";
  push(@kids, {
	       'pid' => $pid,
	       'fh'  => $fh,
	       }
       );
}

# the sleep here is so that the output of the parent and
# children isn't too horribly out of order
sleep 1;

my $ctr=0;
foreach (@kids) {
  my $pid=$_->{'pid'};
  my $fh=$_->{'fh'};
  print "sending to $pid\n";
  print $fh "SEND $pid\n";
  close($fh);
}

foreach (@kids) {
  waitpid($_->{'pid'},0);
}
print "success\n";
exit(0);

-- 
David M. Meyer
meyer@virtc.com


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

Date: Mon, 21 Jun 1999 09:01:12 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Cure for document deficiency
Message-Id: <376DF148.3FB0C85A@dave.org.uk>

David Cassell wrote:
> 
> Dave Cross wrote:
> > [big snip]
> > Also it's difficult to read the online docs in the bath or on the
> > train.
> 
> Hey, that's brilliant!  We suggest that people try taking their
> 20" monitor with them into the bath to read the docs on their
> computer, and.. presto.  A large percentage of clueless posters
> cease to.. umm, post.  Dave, you're a genius.  The Kevorkian
> of Perlites.

I think I prefer to see it as more Darwinian. Survival of the fittest
and all that :-)

Perhaps we could get perldoc to print out something like 'These docs are
best read in the bath' and see who's still posting in a week's time.

Oh... wait. The people we're trying to er... 'remove' don't read
perldoc, so that won't work :-(

Dave...


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

Date: 21 Jun 1999 08:16:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Cure for document deficiency
Message-Id: <7kkscp$bm7$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dave Cross 
<dave@dave.org.uk>],
who wrote in article <376DF148.3FB0C85A@dave.org.uk>:
> Perhaps we could get perldoc to print out something like 'These docs are
> best read in the bath' and see who's still posting in a week's time.
> 
> Oh... wait. The people we're trying to er... 'remove' don't read
> perldoc, so that won't work :-(

How much would it run us to run an MTV ad with

    "Quiz question one: can you take Perl docs with you in the bath?"

Ilya


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

Date: Mon, 21 Jun 1999 08:29:04 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Cure for document deficiency
Message-Id: <kJmb3.5406$36.99368@news2.rdc1.on.home.com>

In article <7kkscp$bm7$1@mathserv.mps.ohio-state.edu>,
 Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
! [A complimentary Cc of this posting was sent to Dave Cross 
! <dave@dave.org.uk>],
! who wrote in article <376DF148.3FB0C85A@dave.org.uk>:
! > Perhaps we could get perldoc to print out something like 'These docs are
! > best read in the bath' and see who's still posting in a week's time.
! > 
! > Oh... wait. The people we're trying to er... 'remove' don't read
! > perldoc, so that won't work :-(
! 
! How much would it run us to run an MTV ad with
! 
!     "Quiz question one: can you take Perl docs with you in the bath?"

well, it could get expensive ... given that many of the 
people we're trying to er ... 'help', do not seem very 
inclined towards empiricism we would also have to
run a second, more encouraging MTV ad with the standard answer:

    "Quiz answer one: What happened when you tried it?"

andrew


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

Date: 21 Jun 1999 09:55:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cure for document deficiency
Message-Id: <376dfe1f@newsread3.dircon.co.uk>

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was sent to Dave Cross 
> <dave@dave.org.uk>],
> who wrote in article <376DF148.3FB0C85A@dave.org.uk>:
>> Perhaps we could get perldoc to print out something like 'These docs are
>> best read in the bath' and see who's still posting in a week's time.
>> 
>> Oh... wait. The people we're trying to er... 'remove' don't read
>> perldoc, so that won't work :-(
> 
> How much would it run us to run an MTV ad with
> 
>     "Quiz question one: can you take Perl docs with you in the bath?"


Perhaps a little expensive - but  how about a single posting in alt.perl ?

/J\
-- 
"Killing myself is the last thing I'd ever do" - Homer Simpson


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

Date: 21 Jun 1999 09:58:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cure for document deficiency
Message-Id: <376dfead@newsread3.dircon.co.uk>

Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "B" == Bill  <moseley@best.com> writes:
> 
>   B> I'm waiting for the docs to come out on Audio tape.  Perfect for those 
>   B> long family vacations in the car.
> 
> i am sure that will put your kids to sleep for the duration of the
> trip. hmmm, sounds like a neat thing to market! sleeping aids for
> children: tom c. reciting the perl docs on tape or cd.
> 

I dont know - how about William Burroughs ?

-- 
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton


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

Date: Mon, 21 Jun 1999 06:58:08 GMT
From: Mitch <portboy@home.com>
Subject: Re: File modification time question...
Message-Id: <376DE273.64CC5B41@home.com>



William Herrera wrote:

> On Mon, 21 Jun 1999 01:26:28 GMT, Mitch <portboy@home.com> wrote:
>
> > However, how can I continually poll this directory - in
> >the background (meaning other stuff in the script can continue
> >executing) until I see that the modification time has changed since I
> >last checked, and then go and do some command (if the /foo) has been
> >modified?
>
> Direct solutiuon: use the beta threaded perl. But having never used it
> myself, better you get input from thise who have.

Ooh, I don't know if I want to go there since I'm sort of new to Perl and programming in general.

> Another good solution in current Perl practice
> system("detach perl -w mynewprocess.pl");
> or system("start perl -w  mynewprocess.pl")
> or use fork()

hmmmm, not exactly sure how to do this?

> OTOH, as long as the other processing is not time critical, why not
> just put the "other stuff" in a loop which includes a sleep() call and
> the file check?
>
> while(1) {
>     dostuff();
>     do_other_stuff() if( target file was smodified ) ;
>     sleep(60);
> }
>

Unfortunately, the other stuff is time critical.  The "other stuff" I would like to do is execute
commands that are available to the user from my "prompt".  So, I can have them waiting a minute or even
a second between each subsequent polling of the file.  Ultimately what I need to do, is notify the user
sitting at the "prompt" that the /foo directory has been modified near the time (within a second or so)
it has been modified.  I'm still utterly stumped on  how to do this....anyone else have advice,

 .mitch




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

Date: Mon, 21 Jun 1999 16:53:01 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: File modification time question...
Message-Id: <hLlb3.229$E4.61070@vic.nntp.telstra.net>

Mitch <portboy@home.com> wrote in message news:376DE273.64CC5B41@home.com...
>
> > while(1) {
> >     dostuff();
> >     do_other_stuff() if( target file was smodified ) ;
> >     sleep(60);
> > }
> >
> Unfortunately, the other stuff is time critical.  The "other stuff" I
would like to do is execute
> commands that are available to the user from my "prompt".  So, I can have
them waiting a minute or even
> a second between each subsequent polling of the file.  Ultimately what I
need to do, is notify the user
> sitting at the "prompt" that the /foo directory has been modified near the
time (within a second or so)
> it has been modified.  I'm still utterly stumped on  how to do
this....anyone else have advice,
>

Here is a similar one that I use to check the mod date of a file and then
perform actions if the file has been modified.

By running the check at the start of the subroutine, I know I will catch any
mods, regardless of how long the sub takes.

The only compromise I made (and it is OK in my case) is that I perform the
sub regardless of the checkdate the first time I start the program... b4 the
endless loop starts.

Wyzelli

#!/usr/local/bin/perl -w
use Fcntl ':flock';

#bunch of file definitions go here normally
$filename = 'c:\file.txt'; #or whatever suits

&fcopy; #call the sub that does stuff and sets the check date (time)

while (1){
 # get current time and date
 @Filestats = stat ($filename);
 $Moddate = $Filestats[9];
 if ($Moddate > $Modcheck) {
  print "Copying Files!\n"; # or whatever...
  &fcopy; # call the sub to do stuff if the file has been modified since
last time...
 }
 ($sec, $min, $hr, $dom, $mon, $yr, $wkd, $doy, $isd) = localtime(time);
$mon++;$yr=$yr+1900;
 print "Program Running $dom/$mon/$yr $hr:$min:$sec\nCtrl-C to exit\n";
 sleep (10);# or whatever
}

sub fcopy {
 $Modcheck = time;
#stuff gets done - in my case the copying of files...
return 1;
}




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

Date: Mon, 21 Jun 1999 09:21:17 +0200
From: Wilfried Spillemaeckers <spillemw@se.bel.alcatel.be>
To: T Horse <tanaks@yahoo.com>
Subject: Re: Graphing tools for use with Perl
Message-Id: <376DE7ED.CA018D85@se.bel.alcatel.be>

I'm very happy with the perl gifgraph package.


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

Date: Mon, 21 Jun 1999 06:53:11 GMT
From: th.eichmann@gmx.net (Thomas Eichmann)
Subject: Re: How send a file using perl on a win nt box to an email addr.
Message-Id: <376de0fc.4840056@news.eunet.ch>

Look at Mail::Sender
perldoc Mail::Sender

perhaps search on CPAN for it!

Gruss
Thomas

On Sun, 20 Jun 1999 21:11:43 GMT, "Dariush" <Dariush@sympatico.ca>
wrote:
>Hi Every one;
>
>How can I email a file automatically with perl on a Windows NT (4.0). to an
>email address?
>
>Can you help please?
>
>



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

Date: Mon, 21 Jun 1999 07:08:54 GMT
From: Rainer.Matzke@gmx.net (Rainer Matzke)
Subject: Re: How send a file using perl on a win nt box to an email addr.
Message-Id: <376de44b.574797455@businessnews.de.uu.net>

On Sun, 20 Jun 1999 21:11:43 GMT, "Dariush" <Dariush@sympatico.ca>
wrote:

>Hi Every one;
>
>How can I email a file automatically with perl on a Windows NT (4.0). to an
>email address?
>
>Can you help please?
>
>

---------------------
The easiest way is to use package Net::SMTP:


use Net::SMTP;

sub send($$$$$)
{
	my $sender = shift;
	my $mailhost = shift;
	my $recipient = shift;
	my $subject   = shift;
	my $text      = shift;

	$smtp = Net::SMTP->new($mailhost);
	$smtp->mail($sender);
	$smtp->to($recipient);

	$smtp->data();
	$smtp->datasend("To: $recipient\n");
	$smtp->datasend("Subject: $subject\n\n");
	$smtp->datasend($text);
	$smtp->dataend();
	$smtp->quit();
}



hope this will help you
---------------------
Rainer Matzke
Rainer.Matzke@gmx.net
---------------------


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

Date: Sun, 20 Jun 1999 23:12:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Interpreting MS-ASCII - anyone have a filter?
Message-Id: <MPG.11d777b5aa261fb7989c0b@nntp.hpl.hp.com>

In article <x7ogia8ec7.fsf@home.sysarch.com> on 20 Jun 1999 22:41:44 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
 ...
>   LR>   s/([\x80-\x9F])/defined $t{$1} && $t{$1}/eg;
> 
> i think s/defined/exists/ would look better. if someone mapped a hex
> code to undef yours would fail but that is a stupid thing to do.
> 
>   LR> Maybe someone should name this idiom after me.  No one else seems
>   LR> to use it!  :-)
> 
> i dub this the rosler substitution!

That's a lot better than the RoslerIAN Substitution :-|
 
> (but only if it uses exists)

Sure.  'exists' is one character shorter than 'defined'.

On a slightly more serious note:

That construction is analogous in some way to this one:

my $x = $y || $z; # Use TRUE value or default value.

But it is harder to describe:

my $x = $y && $z; # Replace TRUE value by specified value.

So I prefer the Rosler Replacement -- which Rocks!

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


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

Date: Mon, 21 Jun 1999 00:28:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Interpreting MS-ASCII - anyone have a filter?
Message-Id: <MPG.11d789711f9a444f989c0c@nntp.hpl.hp.com>

In article <7kkk61$1cv$1@nnrp02.primenet.com> on 21 Jun 1999 05:56:17 
GMT, Jim Monty <monty@primenet.com> says...
 ...
> I continue to struggle to learn Perl and its countless popular
> "idioms." What, pray tell, is wrong with this?
> 
>     s/([\x80-\x9F])/exists $t{$1} ? $t{$1} : ''/eg;

      s/([\x80-\x9F])/exists $t{$1} && $t{$1}/eg;

is four characters shorter.  Other than that, they are functionally 
identical.  Which (for me) makes the choice between them easy.  :-)

As a small matter of style, I prefer "" to '' because the four hen-
scratches can't be mistaken for one double-quote, as the two hen-
scratches might be.  No one would be confused by the secondary 
implication of interpolation between double-quotes.

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


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

Date: Mon, 21 Jun 1999 06:43:16 GMT
From: smnayeem@my-deja.com
Subject: is there any perlscript for client-side scripting?
Message-Id: <7kkmu2$29k$1@nnrp1.deja.com>

Does anyone know where i can find some documentation on perlscripts, is
it going to be a good scripting language for doing client side
scripting? so that i wont have to wait about javascript or vbscript, and
not to mention be restricted to their limited vocabulary :(
thanks

smnayeem
smnayeem@agni.com
Programmer
Agni Systems Ltd.


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


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

Date: Mon, 21 Jun 1999 00:22:24 -0700
From: Lee Fesperman <firstsql@ix.netcom.com>
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <376DE830.2708@ix.netcom.com>

Randal L. Schwartz wrote:
> 
> >>>>> "Lee" == Lee Fesperman <firstsql@ix.netcom.com> writes:
> 
> Lee> Add to your list of portable CGI languages - Jive
> Lee> (http://www.firstsql.com/jive/), the only one on the list
> Lee> specifically for CGI programming with database.
> 
> Huh?  Do you use the word "only" in a different sense than most of the
> speakers of the language do?
> 
> Why isn't "Perl" on "the list"?

Perl was on the list ... to quote the original poster -- "We're debating what language 
to use for the CGI programming.  C++, Java, Perl, ...?"

I was using 'only' in the usual sense. Perl was not designed and is not used 
"specifically for CGI programming with database."

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)


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

Date: Sun, 20 Jun 1999 22:34:05 GMT
From: lakerDeleteThisBit@tcp.co.uk (Markus Laker)
Subject: Re: localtime function using Activestates perl on NT4
Message-Id: <376d6a06.38531695@news.tcp.co.uk>

"Richard Huxton" <rich@mwynhau.demon.co.uk> wrote:

> This might be a unix/Windows issue. I've noticed somthing similar on my
> dual-booting linux/95 system. Unix seems to assume the BIOS clock is left
> running on GMT and adjusts it in the OS. I've got a feeling Windows adjusts
> the BIOS clock by an hour when you flip into summer-time.

Yes, Windows NT and 95 both do that, but only if you turn on the
relevant check box in 'Control Panel: Date/Time: Time Zone'.

Garth, your Perl code produces the correct time on my NT4 box.  I'm
using the latest and greatest ActiveState release, Build 517; the check
box I mentioned is enabled, and we're currently in British Summer Time,
which is one hour ahead of GMT (UTC).  There is no TZ environment
variable.  If I replace 'gmtime' with 'localtime', the reported time
goes back by one hour, so Perl clearly knows which timezone we're in
without the need for an environment variable.

My suggestions are:

1. Upgrade to the most recent build of Perl.

2. Go into Control Panel and check that your timezone is set correctly.

3. If necessary, turn on the 'adjust clock for daylight saving changes'
check box and see if that makes any difference.

Markus

-- 
Delete the 'delete this bit' bit of my address to reply


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

Date: Sun, 20 Jun 1999 21:41:31 -0400
From: esalmon@packet.net
Subject: Need help with a perl/cgi workaround
Message-Id: <376D984B.2FAF@packet.net>

I am trying to put together a simple proxy CGI submit script that
submits a POST, not a GET, CGI form submit. Following, is a script that
submits a form through GET and it works fine. How would I change this
script to do a post instead? If the CGI data pairs are not sent on the
request line for POST, like it is for GET, what would need to be changed
and/or added to the following script. I know it is sent through STDIN
but how do I implement that, in Perl, from here?

Thanks in advance!

	Eric R. Salmon

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

BODY: {
    @Headers		=	("User-Agent", "http-get/0.1");
    $url		=
"/isp/somewhere/gateway.cgi?password=aD5YtE81&submit=Submit";
    $document		=	Http_Get('www.somewhere.com', 80, $url);
}
#######################################################################


sub Http_Get {
# =====================================================================
> Unpack arguments passed to this routine
    my (				$server,
					$port,
					$document		) = @_;
    # -----------------------------------------------------------------
>
    if (				$server =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) {
	@addrs 			=	pack('C4', split(/\./,$server));
    # -----------------------------------------------------------------
>
    } else {
	($dummy,
	$dummy,
	$dummy,
	$dummy,
	@addrs)			=	gethostbyname($server);
    }
    # -----------------------------------------------------------------
>
    $remote			=	pack("S n a4 x8", &AF_INET, $port, $addrs[0]);
    socket (				S, &PF_INET, &SOCK_STREAM, &TCP) || die "socket: $!";
    connect (				S, $remote) || die "connect: $!";
    select (				S);
    $|				=	1;
    select (				STDOUT);
    $|				=	1;
    $request			=	"GET $document HTTP/1.0\r\n";
    # -----------------------------------------------------------------
>
    while (				$#Headers > 0) {
	$request		=	$request . "$Headers[0]: $Headers[1]\r\n";
	shift (				@Headers);
	shift (				@Headers);
    }
    # -----------------------------------------------------------------
>
    $request			=	$request . "\r\n";
    print			S	"$request";
    $big			=	1024*1024;
    $build			=	"";
    # -----------------------------------------------------------------
>
    while (				$len = sysread(S, $data, $big)) { # $out =
syswrite(STDOUT, $data, $len);
	$build			=	$build . $data;
    }
    # -----------------------------------------------------------------
>
    close (				S) || die "close: $!";
    return				$build;
}
#########################################################################
sub TCP {
    return				join("", getprotobyname('tcp'));
}
#######################################################################
sub SOCK_STREAM {
    return				1;
}
#######################################################################
sub AF_INET {
    return				2;
}
#######################################################################
sub PF_INET {
    return				&AF_INET;
}
#######################################################################


  -----------== 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, 21 Jun 1999 09:09:46 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: newbie question...
Message-Id: <376DF34A.961ACCFD@dave.org.uk>

morrisTHIS@cogent.net wrote:
> 
> Given a code fragment:
> 
>  opendir THEDIR, "$basepath$ARGV[0]" || die "Unable to open directory:
> $!";
>  @allfiles = readdir THEDIR;
>  closedir THEDIR;
> print "<p>allfiles=\"@allfiles\"</p>\n";
> 
> and on the web page it lookslike this:
> allfiles=". .. 930606818.dat 930606861.dat"
> 
> I've been beating my head agains the wall all day trying to come up with
> 
> a simple, robust way to hack the top two items off the array so that
> I could add a line or two ofter the print statement, then repeat the
> print statement and have it produce:
> 
> allfiles="930606818.dat 930606861.dat"
> 
> Thanks a lot in advance.  I'm learning perl by the deep immersion
> method, trying to hack an existing script to produce something
> totally different than what was intended.  I've succeeded 95%
> of the way, this problem is one of the few that remain.

You should look up 'shift' and 'splice' in the standard documentation
that came with your copy of Perl.

> Mike Morris
> Sorry, the return address is munged to prevent spam,
> remove THIS to send email.

1/ If you post a message here, you should expect to read the answer
here.
2/ Address munging is not a very helpful way to attack spam.
3/ If you insist on munging your address, you should munge the server
name not yuor name.

hth,

Dave...


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

Date: Mon, 21 Jun 1999 09:42:05 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Perl scripts slows down servers?
Message-Id: <376DFADD.D2175D32@ericsson.com>

David Cassell wrote:
> 
> Matt Sergeant wrote:
> >
> > Marcel Grunauer wrote:
> > >
> > > Perl is faster than Java,
> >
> > What evidence do you have to back that up? Just curious (I prefer Perl,
> > but I'm aware that Java is faster now for some situations/solutions, and
> 
> Is it?  The examples I have been shown are the artificial
> optimized-Java-situation vs Perl-with-no-optimization-and-no-
> mod_perl kind of cases.  You can always slow Perl down if you
> try.. or if you use scripts from Matt Wright.  :-)

The recent example I'm thinking of are the perl vs Java vs Python for
XML parsing tests done on xml.com. Java was about 10-20% faster.

Matt.


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

Date: Mon, 21 Jun 1999 09:45:25 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Perl scripts slows down servers?
Message-Id: <376DFBA5.78DA6C8A@ericsson.com>

Larry Rosler wrote:
> 
> In article <376A59E1.20B9E614@ericsson.com> on Fri, 18 Jun 1999 15:38:25
> +0100, Matt Sergeant <matt.sergeant@ericsson.com> says...
> > Marcel Grunauer wrote:
> > > Perl is faster than Java,
> >
> > What evidence do you have to back that up? Just curious (I prefer Perl,
> > but I'm aware that Java is faster now for some situations/solutions, and
> > that's OK with me :))
> 
> Kernighan & Pike, The Practice of Programming (1999), p. 81, has a
> comparative performance and code-size chart for a particular program.
> Here are excerpts:

[snip]

But isn't that a single algorithm being tested? One that is _very_
unlikely to be running on a web server? I'm really looking for something
more concrete than that. Although this lightened my day - posted to the
mod_perl list:


__BEGIN__
I love Java.  I've found it to be the most elegant "normal" programming
language I've encountered.  I've spent the last 2+ years working almost
exclusively in Java, both on the client side, and for the last 15
months,
I've been managing a team writing a suite of Java Servlets.

The servlets were relatively complicated beasts.  We were running inside
of
Netscape Enterprise Server 3.6 (because that was mandated) and were
using
JRun as a servlet engine (because Netscape's wasn't very good).

But...

The performance we ended up with was, to say the least, not good. The
team
is currently attempting to do a lot of performance analysis, and I have
confidence that we will be able to salvage the performance, however it's
going to take a fair amount of work.  I could go into gory details on
the
highs and lows of developing servlets, but that would take a while.

I am now in the process of exploring mod_perl and Embperl as an
environment
in which to build web-based applications.  So far I really like what I
see.
While I'm not "in love with Perl" (I find some of the syntax difficult
to
read) I have been impressed so far with it's power.

If I were given a choice to do the servlet project over again, I would
not
choose Java as my platform for building web-based applications.  I don't
know that I'd choose mod_perl (I haven't explored enough yet), but so
far,
so good.
__END__

Again, really just anecdotal, but interesting nonetheless...

Matt.


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

Date: Mon, 21 Jun 1999 09:19:58 +0200
From: Wilfried Spillemaeckers <spillemw@se.bel.alcatel.be>
To: ted fiedler <tfiedler@ptd.net>
Subject: Re: printing multiple lines
Message-Id: <376DE79E.C6F7BBEF@se.bel.alcatel.be>

Set the input record separator to $/=""; and you'll be in paragraph mode
(camel book p.38).  To print everything behind 015 (excluding 015) you
could do 
if (/015(.*)/) {print $1;}


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

Date: Mon, 21 Jun 1999 00:29:17 -0600
From: Mark Johnson <mjohnson@h2net.net>
Subject: Re: Problems with MacPerl and modules
Message-Id: <376DDB3D.5F26E5B6@h2net.net>



"Paul J. Schinder" wrote:

> In <376B1110.63FF87B7@h2net.net> Mark Johnson <mjohnson@h2net.net> writes:
>
> >OK, maybe
> >it's not included, so I tried downloading the latest LWP package and its
>
> >prerequisites from CPAN.  I installed them where I thought they needed
> >to
> >go (lib folder), but the best I did was get an error saying that LWP
> >failed to return
> >a true value. (?)
>
> Because you put Unix text files in your lib folder.  MacPerl can
> *only* use Perl in Mac text format.  Just like any other 5.004 Perl,
> which wants scripts in the native text format.  Scripts on CPAN are
> usually stored in Unix format.
>
>

I never noticed a difference, but that was probably due to the fact that I was
using BBEdit to open the script files, and it handles Unix files as transparently
as native Mac format ones...

>
> Do yourself a *big* favor.  Go to Chris Nandor's web site,
> <http://pudge.net/macperl>, and get his cpan-mac package.  After that,
> don't use any other way of installing modules other than the CPAN
> module or the installme script.  (Since CPAN needs about 30 Mb free
> RAM, you may not be able to run it on older Macs.  But installeme
> should run.)  The scripts do all the things that are necessary to
> properly install modules under MacPerl, like text conversion and
> autosplitting.
>
>

I had tried previously to get this, but it never worked because Netscape was
complaining about the archive being corrupt.  I switched to Fetch and it
downloaded fine.  It installed and worked flawlessly!

>
> --
> Paul J. Schinder
> NASA Goddard Space Flight Center
> schinder@leprss.gsfc.nasa.gov

Thank you, thank you, thank you!   I still have hair left on my head, and some
sense of logic has returned to the universe...

--
Mark A. Johnson            \ "In the future, employees will either be super-
Denver, CO                  \  stars or perspiration wipers. Those who aren't
mjohnson@h2net.net           \  qualified to do either will become managers."
mark.z.johnson@lmco.com       \      - Prediction #35, The Dilbert Future
_______________________________\_____________________________________________
=====-----       http://www.h2net.net/p/mjohnson/index.html        -----=====




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

Date: Mon, 21 Jun 1999 16:11:43 +1000
From: Derek Lavine <derek@realware.com.au>
Subject: Re: Regular expresions as parameters
Message-Id: <376DD79E.7F92A01A@realware.com.au>

Thanks for all your help

derek



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

Date: Mon, 21 Jun 1999 08:29:08 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Signature removal regex?
Message-Id: <FDo4wK.8ED@csc.liv.ac.uk>

In article <1dtm6mi.g7q4px1il3b05N@roxboro0-0010.dyn.interpath.net>,
planb@newsreaders.com (J. Moreno) writes:
> I.J. Garlick <ijg@csc.liv.ac.uk> wrote:
> 
> 
> Complain to the newsreaders authors -- I do.

I would if we were talking news readers here. Unfortunately this is email
and we are vastly outnumbered by M$ sheep who don't have the first clue
about proper signature form. I can forgive them this as they don't know
any better, but even worse are the programmers of mail clients who
perpetuate the problem by not taking what the sheep do and sticking a '-- '
on a single line before their 24 line sig.

>  
> Huh?  I don't seem to be understanding you -- that should remove the
> last sig in a message and nothing else.  If you've got two, or three or
> more shouldn't make a difference:

I knew I hadn't explained that right. :-( I agree with you totally John but
as I said things are nowhere near as simple as I first thought.

> 
> I'm still not clear on what you're looking for, what kind of failure modes
> do you forsee for that regex?

Ok suppose they want to reply to a message that has someone else's quoted
rfc legal signature in it eg.

>> some quoted message to reply to
>>
>> -- 
>> there sig

They enter some text and then decide to suspend editing and save till later.
Now if their sig is appended when they save I want to strip it out when they
re-edit or at least detect it's there so I don't add another. Easy your regex
works fine.

But what if they didn't save their sig? Not sure but yours may catch that
quoted one. Doesn't matter though as it should be trivial to detect the
quoted sig and not remove it. NOT. If everyone quoted the same great but
they don't (see Abigail's posts) so this isn't as easy as it sounds.

The potentially worse scenario is if they try to forward a message of theirs
to someone else. The sig stripping could then potentially strip the sig from
this forwarded message if they save it then re-edit and the saved version
only has the forwarded messages version of their signature.

God this gets worse. I think I am begging to see why Tom C's answer was so
complicated. It will probably take some form of semi-intelligent script to
accomplish what I want. Me thinks a re-think is in order.

>                                And just what kind of information are you
> going to have on this "sig"?

I know they're sig exactly to the character at the time of re-editing, the
script can read their sig file gauranteed. Only problem is they could have
changed it in between the save and re-edit, so it don't help me much.

Thanks for answering John, I probably mislead you with my original post
and appologise if so. I was under the impression that this would be easy
too but I didn't think it through properly. Ah well I seem to do a lot of
that in this news group.

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

Just because you're paranoid doesn't mean they AREN'T after you.



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

Date: 21 Jun 1999 06:38:13 GMT
From: darstec@aol.com (Darrell Stec)
Subject: Re: virtualave.net
Message-Id: <19990621023813.06753.00000779@ngol06.aol.com>

In article <376D698D.E9C1DEC4@chatbase.com>, TRG Software : Tim Greer
<webmaster@chatbase.com> writes:

>Leonid Goltser wrote:
>> 
>> Somebody suggested me to upload my scripts on virtualave.net. I did but my
>> scripts do not work (although, they work perfectly on my machine). Browser
>> can't open them. If somebody use virtualave.net, can you help me? Probably
>> something wrong with configuration or something else. If you run your
>> scripts on that server, please, give me a piece of your code what works
>> there. I'll use it as an example.
>
>Isn't it logical to actually go to virtualave.net's web site and take a
>look at *their* site's help and support pages? This isn't a perl
>question, you realize that much, don't you? With that said, please don't
>post such off-topic questions here.
>-- 
>Regards,
>Tim Greer: chatmaster@chatbase.com / software@linkworm.com
>Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
>TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
>Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
>Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
>
>

Actually it really IS a Perl question, and on-topic.  The performance of the
coding had nothing to do with Virtual Avenue at all, Leonid simply made that
assumption.  There are a few basics missing from the coding, if what I got in
Email was the complete program.

Later,
Darrell Stec                               E-Mail: DarStec@aol.com

Webpage Sorcery
http://webpagesorcery.com
We Put the Magic in Your Webpages




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

Date: Mon, 21 Jun 1999 09:53:48 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Win32 OLE - Access is Denied
Message-Id: <376DFD9C.1FCB430B@ericsson.com>

Paul O'Driscoll wrote:
> 
[snip]
>     Win32::OLE::LastError
> 
> This is helpful in that it returns an error 'Access is Denied'.
> 
> My question is .. how can I find out what cannot be accessed ?

It's probably the registry - the bane of every NT admin's life...

Turn on full security auditing - done via User Manager (good user
friendly place to put the option I think :-? ).

Matt.


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

Date: Mon, 21 Jun 1999 08:24:20 +0200
From: "Franz GEIGER" <f.geiger@vol.at>
Subject: Re: Win32::odbc problem with output
Message-Id: <7kklpi$8qq$1@pollux.ip-plus.net>

Hi Bob,

despite the fact that I'm pretty new to CGI programming I'd miss the line

    print "Content type: text/html\n\n";

Regards
Franz


Bob Stickel wrote in message <7kjjra$e7v$1@news2.ee.net>...
>I have a good dsn and table and the routine runs to the error point in the
>browser and stops with:
>
>CGI Error
>The specified CGI application misbehaved by not returning a complete set of
>HTTP headers. The headers it did return are:
>
>my routine is quite simple (it's the sample script from Roth.net page):
>
>use Win32::ODBC;
>$DSN = "northwind";
>if (!($db = new Win32::ODBC($DSN))){
>    print "Error connecting to $DSN\n";
>    print "Error: " . Win32::ODBC::Error() . "\n";
>    exit;
>}
>$SqlStatement = "SELECT * FROM employees";
>if ($db->Sql($SqlStatement)){
>    print "SQL failed.\n";
>    print "Error: " . $db->Error() . "\n";
>    $db->Close();
>    exit;
>}
>while($db->FetchRow()){
>    undef %Data;
>    %Data = $db->DataHash();
>}
>$db->Close();
>
>can someone point me in the right direction to get the output displayed?
>
>Thanks
>
>Bob
>
>
>
>




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

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


Administrivia:

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

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

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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