[13938] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1348 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 11 12:05:36 1999

Date: Thu, 11 Nov 1999 09:05:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942339917-v9-i1348@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 11 Nov 1999     Volume: 9 Number: 1348

Today's topics:
        Activeperl install fails <hensh@tcimet.net>
        an error occured while processing this directive <investor@airmail.net>
    Re: Batch Program Execution <gellyfish@gellyfish.com>
        Calling cgi from file <madhatter@cableinet.co.uk>
    Re: Calling cgi from file <AgitatorsBand@yahoo.com>
    Re: Calling cgi from file <madhatter@cableinet.co.uk>
        CSV Parsing Revisited (long - 98 lines) (Ken Bandes)
        DBI and max number of connections (john kelly)
        Embedding Questions <a79543@yahoo.com>
    Re: FAQ 4.58: How can I always keep my hash sorted? <klayto@my-deja.com>
        Filehandle Question <david@inxpress.net>
        Freelance programmer wanted. <rob@d-removethis-atasouth.co.uk>
        funny behaviour of Perl <navin@ti.com>
    Re: garbage collection <david@inta.net.uk>
        HELP - Need DBI::Oracle Binaries (?) for Solaris (Eisen Chao)
    Re: Help! <gellyfish@gellyfish.com>
    Re: How do I turn on NUM-LOCK on NT system? (Bart Lateur)
        How to not print Header in my page? <qsun@kitco.com>
    Re: How to not print Header in my page? <rhomberg@ife.ee.ethz.ch>
    Re: How to not print Header in my page? <qsun@kitco.com>
    Re: how to query the hostname? (David Cantrell)
    Re: how to query the hostname? <gellyfish@gellyfish.com>
        I need the current path krun@my-deja.com
    Re: IO-Tty binary package for W95? (Bbirthisel)
    Re: new line break??? (Simon Cozens)
    Re: new line break??? (Matthew Bafford)
        Online OO Perl tutorial? (Brian Simpson)
    Re: Online OO Perl tutorial? <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
    Re: OO question again <jtolley@bellatlantic.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 11 Nov 1999 08:33:46 -0500
From: "Richard Hensh" <hensh@tcimet.net>
Subject: Activeperl install fails
Message-Id: <80egje$88r$1@msunews.cl.msu.edu>

I have just experienced THE InstallShield problem with Activeperl's latest
version (build 522). Now I can not seem to install Perl on my NT machine.
In particular, I get the error message "could not load the perl interpreter"
that others have experienced so it seems that I am not alone. None of the
suggested workarounds were successful.

Is there another way to install this build without using InstallShield?

Has anyone built from source on an NT machine? If so, which compiler was
used?

thanks
ricky




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

Date: Thu, 11 Nov 1999 22:18:53 -0600
From: "R C" <investor@airmail.net>
Subject: an error occured while processing this directive
Message-Id: <FFB8966253F76954.22CC2EBC94CF04FA.A7064F2F9A9B37DF@lp.airnews.net>

The location of the FAQs that are being referenced in this newsgroup is
unknown to me, so I do not know whether this error message is discussed
there.

I installed Random Text Displayer from Matt's Script Archive and configured
it for my virtual host server which uses Apace and Linux. The script is
called from an HTML page with URL
http://www.numeraire.com/quotes/index.shtml , but the only thing that I have
been able to get it to return is an error message as follows: [an error
occurred while processing this directive] .

This error message occurred by accident when the binary HTML file was sent
by FTP as a binary file to the host server and for some reason the carriage
returns were deleted. No error message or random text appears when the
binary file is transferred as a binary file and the carriage returns remain
in place.

The virtual host FAQ about CGI debugging suggests that one try to run the
script directly, but when I open the file in FTP with EXEC I merely get the
same result as opening it with VIEW, and when I copy-and-paste the full-path
URL into my MSIE4.x browser, there is a message about "Internal Server
Error" with no specific diagnostics.

My virtual host requires me to use the ".shtml" file extension, and to place
the script with ".cgi" extension in a sub-directory with my domain-specific
name. The HTML page was created with FrontPage97 on a Wintel PC.

If anyone has a clue to what is going on and how to correct it, please
contact bob@numeraire.com .

Thanks.








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

Date: 11 Nov 1999 10:21:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Batch Program Execution
Message-Id: <80e5c0$j56$1@gellyfish.btinternet.com>

On Wed, 10 Nov 1999 09:15:37 +0100 Vijay N Rao wrote:
>                  I tried Net::FTP but that works only in unix environment.

Have you tried it - I *know* that it works on windows ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 11 Nov 1999 13:46:12 -0000
From: "Madone" <madhatter@cableinet.co.uk>
Subject: Calling cgi from file
Message-Id: <80ehp5$23u$1@supernews.com>

I hope someone can help me here

For my menu, I am using a cgi to call one file via SSI which has the html I
want to appear in.

That HTML has 2 calls for other cgi scripts via SSI as well, but these do
not work.

How do I go about making these other calls work from the first cgi call?

KC




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

Date: Thu, 11 Nov 1999 16:31:37 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Calling cgi from file
Message-Id: <JbCW3.335$wJ6.69187@news.shore.net>

Madone <madhatter@cableinet.co.uk> wrote:
: For my menu, I am using a cgi to call one file via SSI which has the html I
: want to appear in.

: That HTML has 2 calls for other cgi scripts via SSI as well, but these do
: not work.

: How do I go about making these other calls work from the first cgi call?

SSI is not interpolated in the output of CGI scripts. You have to insert
the HTML yourself in your script.

Hope this helps.

--Art


-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Thu, 11 Nov 1999 16:47:13 -0000
From: "Madone" <madhatter@cableinet.co.uk>
Subject: Re: Calling cgi from file
Message-Id: <80esd0$7ht$1@supernews.com>

OK, So the answer would be to edit the original cgi file.

Now  not being a cgi/perl programmer how would I make it activate the other
cgis, one just before the txt file call and one directly after?

Below is the cgi i am using to instert the html from txt file. Basically i
need it to call the other SSI commands e.g <!--#exec
cgi="/cgi-bin/file.cgi"-->

Any help will get themselves a credit on the site.

Below: cgi script calling the txt file containing the html

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

$footer_dir = "/home/username/cgi-bin/";

 if ($ENV{'REQUEST_METHOD'} eq 'GET') {
         $file = $ENV{'QUERY_STRING'};
 }
 else {
         read(STDIN, $file, $ENV{'CONTENT_LENGTH'});
 }


$footer_file = "$footer_dir$file";

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

open(FILE,"<$footer_file") || die "Can't open input file!!!";
$content;
while($content = <FILE>)
 {
   print "$content";
 }

close(FILE);
exit;



Scratchie <AgitatorsBand@yahoo.com> wrote in message
news:JbCW3.335$wJ6.69187@news.shore.net...
> Madone <madhatter@cableinet.co.uk> wrote:
> : For my menu, I am using a cgi to call one file via SSI which has the
html I
> : want to appear in.
>
> : That HTML has 2 calls for other cgi scripts via SSI as well, but these
do
> : not work.
>
> : How do I go about making these other calls work from the first cgi call?
>
> SSI is not interpolated in the output of CGI scripts. You have to insert
> the HTML yourself in your script.
>
> Hope this helps.
>
> --Art
>
>
> --
> --------------------------------------------------------------------------
>                     National Ska & Reggae Calendar
>                   http://www.agitators.com/calendar/
> --------------------------------------------------------------------------




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

Date: Thu, 11 Nov 1999 16:16:16 GMT
From: kbandes@home.com (Ken Bandes)
Subject: CSV Parsing Revisited (long - 98 lines)
Message-Id: <8E7B748A7kbandeshomecom@192.168.123.1>

The question of how to parse CSV files has been answered by a FAQ,
a section of the book "Mastering Regular Expressions," and at least
two CPAN modules.

The problem is that, for a definition of CSV that I'll describe, none 
of these answers is quite right.

CSV is frequently used to describe a format produced and parsed by a 
variety of Windows or DOS based applications, of which the most popular
is Excel.  Strenuous efforts to find a specification for this format 
have utterly failed me, which explains why, simple as it is, it is so 
hard to get right.

The following definition is based on trail and error with several PC 
applications.  I'll use "quote" to mean what's usually called 
double-quote.

- CSV has exactly four special characters: quote (\x22), comma (\x2C), 
  carriage return (\x0D), and linefeed (\x0A).
- A field is either: 
  -- a sequence of zero or more non-special characters,
or
  -- a sequence of characters, enclosed in quotes. To represent a quote
     within the sequence, two consecutive quotes are used.  All 
     other characters are treated literally.
- A record is a sequence of fields separated by commas.  A record is 
  terminated with a linefeed, or a carriage-return/linefeed pair.  A
  CSV file is a sequence of records.

This has several implications:
1.  C-style escapes are not used and have no special meaning.
2.  Within quoted fields, a newline is not special.  A field can span
    multiple lines in a CSV file.  You can't process a CSV file by
    reading a record and then parsing it, because you don't know
    where the record ends until it's parsed.

The FAQ and the book fall afoul of point 1.  Both assume that C-style 
escapes are used, that within a field, quote is \".

The CPAN CSV modules get the bit about two quotes, but don't handle 
multi-line fields.  They assume you can read a record (line) first and 
pass it to a parser.

Of course there are many cases where programmers do follow the 
conventions that these modules and texts assume, but PC applications 
that I've tried (such as Outlook and Excel) seem to follow my 
definition.

The following code will parse a CSV file that has been slurped into a 
scalar, calling a handler function on each record:

sub parse_csv
{
    my($csv, $rec_handler) = @_;
    my @fields;

    while($csv =~ 
      /
      (?:"             # quoted field
       ((?:[^"]*"")*     # non-quotes followed by 2 quotes    
       [^"]*)"           # non-quotes followed by quote
      |([^",\r\n]*))   # or non-quoted field
      (,|\r?\n)        # followed by comma or end of line
      /xg)
    {
        my $field = defined($1) ? $1 : $2;
        my $terminator = $3;

        # un-escape the quotes
        $field =~ s/""/"/g;

        push @fields, $field;

        if($terminator =~ /\n/)
        {
            $rec_handler->(@fields);
            undef @fields;
        }
    }
}

Of course, these files, which often represent database extracts, can be 
quite large, so slurping is not always desirable.  It is not much more 
trouble to write a parser that reads lines until it has a complete 
record, but the parser needs access to the input file handle.  This is 
a different model than the existing CPAN modules provide.

I'm willing to take a stab at rewriting the FAQ, but there are two ways 
I could go:
1. rework the existing FAQ entry,
"How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)"

or
2.  Write a new FAQ specifically for PC-type CSV files.

What do people think is better?

Ken Bandes


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

Date: Thu, 11 Nov 1999 13:22:12 GMT
From: johnt.kelly@worldnet.att.net (john kelly)
Subject: DBI and max number of connections
Message-Id: <382dc0c3.1948421@netnews.worldnet.att.net>

hi,
I am trying to determine what is the max number of connections a
process can have connecting to a Oracle 7.3.4 database using DBI.   I
am doing this because an application that we run (NETSCAPE ENTERPRISE
SERVER) is receiving:
 "ORA-00568  maximum number of interrupt handlers exceeded"
 when they set their DB connection pool from 50 to a higher number.

Does DBI use Oracle's OCI interface?
Also I tried testing the max connections in perl and I am having
problems:
First test was to use the following  code but this appears to use one
scalar handler called $chn, hence I see only one connection in the
database(I have tried other methods ie eval (\$chn) = or \$chn, etc
but keep getting compiler errors) Can someone show me how to do this:
#!/usr/bin/perl
#use strict;
   use DBI;
BEGIN {
 $ENV{ORACLE_HOME} = '/u01/app/oracle/product/7.3.4';
 $ENV{TNS_ADMIN}   = '/u01/app/oracle/product/7.3.4/network/admin' ;
}
$|=1;
for($x=1; $x <5;$x++) {
   $chn='dbh' . $x  ;
   print "connecting with database handler=$chn where x = $x \n";
  $chn = DBI->connect( 'dbi:Oracle:x_x_net',
                           'user',
                           'password',
                         ) || die "Database connection not made:
$DBI::errstr";
   sleep 3;
}

secondly if I do multiple 
 $chn1 = DBI->connect( 'dbi:Oracle:x_x_net',
                           'user',
                           'password',
                         ) || die "Database connection not made:
$DBI::errstr";
 $chn2 = DBI->connect( 'dbi:Oracle:x_x_net',
                           'user',
                           'password',
                         ) || die "Database connection not made:
$DBI::errstr";

etc up to some number, I see  on the database side that  I am only
making some of the connections to the database and generating  no
errors.
Any help in this matter would be greatly appreciated.

	John


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

Date: Thu, 11 Nov 1999 15:35:53 GMT
From: Rob Bertegerer <a79543@yahoo.com>
Subject: Embedding Questions
Message-Id: <aOAqOCGMx3nEH9tQPikqKUq8pplq@4ax.com>

Has anyone had any luck embedding perl in to Microsoft Visual C++
version 6.0.

Specifically using a project approach in the visual environment not
the makefile (nmake) approach.

Any suggestions or examples of a good project file (settings)

When I try to do the example from the Faq I get the following errors
Compiling...
StdAfx.cpp
f:\perl\lib\core\perlhost.h(4) : error C2143: syntax error : missing
';' before '*'
f:\perl\lib\core\perlhost.h(4) : error C2501: 'pPerl' : missing
storage-class or type specifiers
f:\perl\lib\core\perlhost.h(36) : error C2504: 'IPerlDir' : base class
undefined
f:\perl\lib\core\perlhost.h(82) : error C2504: 'IPerlEnv' : base class
undefined
f:\perl\lib\core\perlhost.h(108) : error C2504: 'IPerlSock' : base
class undefined
f:\perl\lib\core\perlhost.h(328) : error C2504: 'IPerlLIO' : base
class undefined
f:\perl\lib\core\perlhost.h(443) : error C2504: 'IPerlMem' : base
class undefined
f:\perl\lib\core\perlhost.h(468) : error C2504: 'IPerlProc' : base
class undefined
f:\perl\lib\core\perlhost.h(621) : error C2504: 'IPerlStdIO' : base
class undefined
f:\perl\lib\core\perlhost.h(888) : error C2629: unexpected 'void ('
Error executing cl.exe.


code example
#include "stdafx.h"
#include <EXTERN.h>
#include <perl.h>

#define NO_XSLOCKS 

#include <XSUB.h>
#include "win32iop.h"
#include <fcntl.h>
#include <perlhost.h>
#include <stdio.h>

   
    // DynaLoader stuff.
    //
    char *staticlinkmodules[] = {
        "DynaLoader",
        NULL,
    };
    
    // More DynaLoader stuff.
    //
    EXTERN_C void boot_DynaLoader _((CV* cv _CPERLarg));
    
    static void
    xs_init(CPERLarg)
    {
        char *file = __FILE__;
        dXSUB_SYS;
        newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
    }
    
    CPerlObj *pPerl;  // The Perl object used by the host.
    
   int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.

		STRLEN n_a;
        CPerlHost host;

        host.PerlCreate();

        // Don't use argv or argc for embedding.  Instead, we'll
pretend that
        // we gave it the arguments "-e 0".
        //
        char *embedding[] = { "", "-e", "0" };
        host.PerlParse(xs_init, 3, embedding, NULL);

        // Define the expo() function.
        //
        perl_eval_pv("sub expo { my($a, $b) = @_; return $a ** $b; }",
TRUE);

        host.PerlRun();

        PerlPower(3, 4);                      /*** Compute 3 ** 4 ***/

       /** Treat $a as an integer **/
       perl_eval_pv("$a = 3; $a **= 2", TRUE);
       printf("a = %d\n", SvIV(perl_get_sv("a", FALSE)));

       /** Treat $a as a float **/
       perl_eval_pv("$a = 3.14; $a **= 2", TRUE);
       printf("a = %f\n", SvNV(perl_get_sv("a", FALSE)));

       /** Treat $a as a string **/
       perl_eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a =
reverse($a);", TRUE);
       printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), n_a));


        host.PerlDestroy();
        return 0;
}



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

Date: Thu, 11 Nov 1999 14:44:14 GMT
From: Klayto <klayto@my-deja.com>
Subject: Re: FAQ 4.58: How can I always keep my hash sorted?
Message-Id: <80eknu$r6q$1@nnrp1.deja.com>


>   How can I always keep my hash sorted?
>
>     You can look into using the DB_File module and tie() using the
>     $DB_BTREE hash bindings

I tried this many times, but now I encountered a problem regarding
different sorting of two or more databases.

Example:
---------------
sub CompareNumerical {
  my ($k1, $k2) = @_ ;
  $k1 < $k2;
}
sub CompareNumericalReverse {
  my ($k1,$k2) = @_;
  $k1 > $k2;
}
my %DBbday; my %DBscore;
$DB_BTREE->{'compare'} = \&CompareNumerical;
tie %DBbday, "DB_File", "birthdate.db", O_RDWR|O_CREAT, 0640, $DB_BTREE
  or die "Cannot open birthdate.db: $!\n" ;
$DB_BTREE->{'compare'} = \&CompareNumericalReverse;
tie %DBscore, "DB_File", "score.db", O_RDWR|O_CREAT, 0640, $DB_BTREE
  or die "Cannot open score.db: $!\n" ;

---------------
Is this the correct way to do different sorting in two hashes that I need
at the same moment? I don't think so...

Any help is greatly appreciated

Martin


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


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

Date: Thu, 11 Nov 1999 09:41:21 -0600
From: David Lloyd <david@inxpress.net>
Subject: Filehandle Question
Message-Id: <382AE3A1.F7AE7702@inxpress.net>

Why don't filehandle variables have a qualifying prefix?
 
For instance, if subs have & why can't filehandles have |, and
directory handles have ^?
 
Is there some complex reason relating to symbol tables and what-not?

-- 
===========================================================
David M. Lloyd                  mailto:david@inxpress.net

Administrator                   Phone: (608) 663-5555
Internet Express, Inc.          http://www.inxpress.net
802 W. Broadway, Suite # 101
Madison, WI. 53713-1866
===========================================================


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

Date: Thu, 11 Nov 1999 11:22:09 -0000
From: "Rob Maynard" <rob@d-removethis-atasouth.co.uk>
Subject: Freelance programmer wanted.
Message-Id: <YHxW3.1974$o23.878217@news.tcp.co.uk>

Help. Does anyone know of a good freelance programmer, that could write a
couple of decent database scripts for me? Please email me if you, or someone
you know may be interested.

Thanks.

Rob
rob@datasouth.co.uk






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

Date: Thu, 11 Nov 1999 10:59:02 -0600
From: Navin Chander <navin@ti.com>
Subject: funny behaviour of Perl
Message-Id: <382AF5D6.BC3FAA4B@ti.com>

If  I try to execute a perl fileby just specifying its name it does not
work.
$prompt> execute_file.pl

but if i say perl before the executable it works

$prompt> perl execute_file.pl

I have the #!/usr/local/bin/perl at the top of my file.

Any Idea why this happens??
thanks in advance
navin

--
****************************************************
                       Navin Chander
                    Design, SEAL_TEAM_1
1394 Host Design                  Ph: (972)480-2430
Texas Instruments, Dallas TX      Fax: (972)480-6400
Email: navin@ti.com         http://www.ti.com/sc/bus
****************************************************





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

Date: Thu, 11 Nov 1999 16:22:49 -0800
From: "David Ashe" <david@inta.net.uk>
Subject: Re: garbage collection
Message-Id: <80eq58$1ve3$1@news2.vas-net.net>

I have reccomend the ``advanced perl programming'' book by o'reilly, it
covers a lot on the internals of perl.

Its made my perl programming 100 times more efficent anyway.

David Ashe,
Systems Developer,
Easypress




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

Date: Thu, 11 Nov 1999 16:33:23 GMT
From: echao@interaccess.com (Eisen Chao)
Subject: HELP - Need DBI::Oracle Binaries (?) for Solaris
Message-Id: <s2lrujqbhsq60@corp.supernews.com>

Hi All:

Because my IT Dept wants to migrate to Micro$oft
(and AWAY from UNIX), they will not further support
anything on our Sun Server boxes, which also covers
the installation of any Oracle client S/W (drivers,
C compiler) that also covers all the tools needed to 
make the DBI drivers for Oracle on a Sun platform.

Something about a business justification and maintaining
the latest standards.

Thus I am asking anyone who has the following:

  1) SunOS 5.4
  2) Oracle Enterprise Edition 8.0.4.3.0
  3) Perl 5.005_02 built for sun4-solaris-thread 
  4) A fully built Perl DBI::Oracle library/module

to be so kind as to tar/zip me their build of DBI::Oracle.
I'd ask my admin instead of you all to do this, except 
we can't because of the intransigence of our M$-centric
IS Dept.

If you require anything in addition to the above info,
let me know.

Files can be sent via e-mail to either:

  echao@home.interaccess.com
  eisen.r.chao@ucm.com


Thank you very much for your attentions,


Eisen Chao
ComEd
Chicago, IL


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

Date: 11 Nov 1999 10:20:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help!
Message-Id: <80e59d$j53$1@gellyfish.btinternet.com>

On Wed, 10 Nov 1999 19:09:01 -0500 Qinqiang Sun wrote:
> Hi, everybody,
> I use perl win 32 building 515 and IIS4.0 on WinNT4.0.
> We run perl scripts using PerlIS.dll and got extra stuff like
> "HTTP/1.0 200 OK Date: Thu, 11 Nov 1999 00:07:10 GMT Server:
> Microsoft-IIS/4.0 ".
> Please help me to fix  so we don't get this header again.

Perhaps you want to ask in:

   comp.infosystems.www.servers.ms-windows

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 11 Nov 1999 13:27:22 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How do I turn on NUM-LOCK on NT system?
Message-Id: <382ac1db.269022@news.skynet.be>

Eric Farr wrote:

>Can someone show me how I would force the number-lock on in Perl code on an
>NT system?

I know how to do it in other languages, like in Visual Basic, using the
API. Let's see if I can succesfully convert it to Perl. :-)

What you ought to do, is read the current keyboard state into a (256
byte) buffer, set the entry for numlock, and write the new keyboard
state back to the keyboard.

So unless the Win32::API module is already part of your installation, go
to ActiveState's website (subdir packages/zips -- FTP?) and get it.
Install it by following the included instructions.

This code works on Win95. Maybe it won't work on NT, if your script
doesn't have the required privileges. I don't know.

  use Win32::API;
  $GetKeyboardState = new Win32::API('user32', 'GetKeyboardState',
    ['P'], 'N');
  $SetKeyboardState = new Win32::API('user32', 'SetKeyboardState',
    ['P'], 'V');
  my $keyboardstate = "\0" x 256;
  $GetKeyboardState->Call($keyboardstate);
  substr($keyboardstate, 0x90, 1) = chr(1);  # VK_NUMLOCK = 0x90
  $SetKeyboardState->Call($keyboardstate);

-- 
	Bart.


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

Date: Thu, 11 Nov 1999 10:47:08 -0500
From: Qinqiang Sun <qsun@kitco.com>
Subject: How to not print Header in my page?
Message-Id: <382AE4FC.395708ED@kitco.com>

Hi,
I use perl5 building 515 and IIS4.0 on our NT4.0 Server. Run perl script
with perlIS.dll. I got the header part I don't want
"HTTP/1.0 200 OK Date: Thu, 11 Nov 1999 15:45:47 GMT Server:
Microsoft-IIS/4.0 Content-type: text/html ". Please help me to not print
this on our page.

Thank you.

Sun



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

Date: Thu, 11 Nov 1999 16:46:32 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: How to not print Header in my page?
Message-Id: <382AE4D8.14A91B5C@ife.ee.ethz.ch>

Qinqiang Sun wrote:
> 
> Hi,
> I use perl5 building 515 and IIS4.0 on our NT4.0 Server. Run perl script
> with perlIS.dll. I got the header part I don't want
> "HTTP/1.0 200 OK Date: Thu, 11 Nov 1999 15:45:47 GMT Server:
> Microsoft-IIS/4.0 Content-type: text/html ". Please help me to not print
> this on our page.

Ask Microsoft Hotline how to configure your IIS correctly
- Alex


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

Date: Thu, 11 Nov 1999 11:18:09 -0500
From: Qinqiang Sun <qsun@kitco.com>
Subject: Re: How to not print Header in my page?
Message-Id: <382AEC41.B3F7A001@kitco.com>

Hi,
I configure two machnes and one is oK, the other does return header.
I have no ideas.
 Thank you.

Alex Rhomberg wrote:

> Qinqiang Sun wrote:
> >
> > Hi,
> > I use perl5 building 515 and IIS4.0 on our NT4.0 Server. Run perl script
> > with perlIS.dll. I got the header part I don't want
> > "HTTP/1.0 200 OK Date: Thu, 11 Nov 1999 15:45:47 GMT Server:
> > Microsoft-IIS/4.0 Content-type: text/html ". Please help me to not print
> > this on our page.
>
> Ask Microsoft Hotline how to configure your IIS correctly
> - Alex



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

Date: Thu, 11 Nov 1999 10:25:29 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: how to query the hostname?
Message-Id: <382a9960.57545536@10.0.0.155>

On Tue, 9 Nov 1999 14:50:33 +0100, "Oreg Dixie" <maistro@swi.hu> said:

>Hi!
>
>I need your help. I'm making a forum and I'd like to store (statistics) the
>people's host
>or dial-up address and the type of browser they are using. How Can I do
>this?

No-one here will know how.  We're perl programmers, and what you want
to do is nothing to do with perl.  However, you will be able to find
all the information you need in your webserver documentation.

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: 11 Nov 1999 10:23:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to query the hostname?
Message-Id: <80e5f8$j59$1@gellyfish.btinternet.com>

On Tue, 9 Nov 1999 14:50:33 +0100 Oreg Dixie wrote:
> Hi!
> 
> I need your help. I'm making a forum and I'd like to store (statistics) the
> people's host
> or dial-up address and the type of browser they are using. How Can I do
> this?
> 

use the information supplied to your program through the CGI :

  <http://hoohoo.ncsa.uiuc.edu/cgi>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 11 Nov 1999 15:58:32 GMT
From: krun@my-deja.com
Subject: I need the current path
Message-Id: <80ep2v$usk$1@nnrp1.deja.com>

Hi all, i'm writing a perl script and this file will be in randomn
directories. I need to know the whole path where this file is.
Example: If my program is in C:\dev\krun\archive, I need this path in a
string.  THe path varies for each user, which is why it can't be
hardcoded. Thanx

Devang


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


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

Date: 11 Nov 1999 15:06:45 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: IO-Tty binary package for W95?
Message-Id: <19991111100645.07209.00000045@ng-cl1.aol.com>

Hi Neil:

>Does anyone have a binary package (or a ppd) for the module IO-Tty?
>I'm trying to get Expect.pm to work and it complains about pty's. Am I
>looking for the right stuff?

Probably not. I started down this path at one time on W95 and
then abandoned the effort and put a subset of Expect.pm into
Win32::SerialPort. Expect.pm really wants to treat processes
and data streams as "virtual users" (hence the ptys) and W95
doesn't really think in those terms. The author of Expect.pm
seems to have come to a similar conclusion (based on the
correspondence I had with him a couple years ago).

If your stream is coming from a serial device, and you need
more than the current subset from Win32::SerialPort, let me
know.

-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: 11 Nov 1999 11:21:39 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: new line break???
Message-Id: <slrn82l9m3.2np.simon@othersideofthe.earth.li>

Seshadri Sriperumbudur (comp.lang.perl.misc):
>Files with "^M" never caused me any trouble and I used the file in scripts as I
>would use the same file without the "^M"s comfortably. 

Fine, but wait until you get one like this:
#!/usr/bin/perl^M

Looks fine when you use `head', but gives a `file not found' error...

-- 
Factorials were someone's attempt to make math LOOK exciting.


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

Date: Thu, 11 Nov 1999 12:00:03 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: new line break???
Message-Id: <slrn82la9t.148.*@dragons.duesouth.net>

On Thu, 11 Nov 1999 00:12:26 -0500, Bob Walton
<bwalton@rochester.rr.com> was attempting to recharge the laptop battery
by typing: 
:      perl -wne 's/\r//g;print'
       perl -wpe 'tr/\r//d;'

: Bob Walton

--Matthew


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

Date: 11 Nov 1999 16:00:36 GMT
From: bsimpson@spam.me.not (Brian Simpson)
Subject: Online OO Perl tutorial?
Message-Id: <80ep74$4ol$1@fcnews.fc.hp.com>

I'm looking for a online crash course in object-oriented Perl
on the Internet.  Does anyone know of any good sites?

Brian Simpson
bsimpson -at- fc -dot- hp -dot- com



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

Date: Thu, 11 Nov 1999 08:23:28 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: Online OO Perl tutorial?
Message-Id: <000b8d9b.30902412@usw-ex0101-008.remarq.com>

In article <80ep74$4ol$1@fcnews.fc.hp.com>, bsimpson@spam.me.not (Brian
Simpson) wrote:
> I'm looking for a online crash course in object-oriented Perl
> on the Internet.  Does anyone know of any good sites?

In the standard documentation - perlref perltoot (Toms Object-Oriented
Tutorial)

Online - Randal's Unix Review Articles
(http://w3.stonehenge.com/merlyn/UnixReview/)

HTH

--

Mark Bluemel


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 11 Nov 1999 17:02:09 GMT
From: James Tolley <jtolley@bellatlantic.net>
Subject: Re: OO question again
Message-Id: <38206A23.48A234A1@bellatlantic.net>

Thomas Schmickl wrote:
> I have now written Get/Set methods instead of direct attribute access.
> But some Tk widgets need references to variables passed in their constructors.
> 
> Before restructuring I had used ... -textvariable=>\$self->{'filename'} ...
> but now I have $self->filename() which returns the value of $self->{'filename'}.
> 
> How can I handle this thing.

If you think you'll be adding features to your
code in the future such that you'll want to change
the way these variables are stored, it's a good
idea to encapsulate them behind get/set methods.
If you think the module will remain essentially
the same forever, then by all means, stay with the
direct access method. However, if you think that
the code may change, you can do two things - I
think.

1) tie the textvariables of the widgets such that
they call methods on your new interface when
they're changed. Just use a utility class to do
the tying. Then you can keep the internals of your
module private (and therefore flexible).

2) If your objects' raison d'etre is intimitely
tied to the use of widgets, you could provide a
method $entry = &set_widget_variable($entry) where
you set the variable from within your object. This
is simple, and you can change the internals of
your objects at will. But it's a bit out-of-place
if this usage is only needed very rarely.

Hope this helps,

James


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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


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


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