[6974] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 599 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 11 16:17:29 1997

Date: Wed, 11 Jun 97 13:00:29 -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           Wed, 11 Jun 1997     Volume: 8 Number: 599

Today's topics:
     #ifdef in XS ? <dada@divinf.it>
     Re: 6million lines !! (Bob Apthorpe)
     ??? local(blah blah blah) = @_; <aagha@cis.ohio-state.edu>
     [HELP] Perl on WindowsNT 4.0 Problem... (1h@g:@)
     Re: Anyone know why a VB app called from a perl script  <dada@divinf.it>
     Re: blank lines <dada@divinf.it>
     Breaking out of a while. (William Rozmiarek)
     Re: Breaking out of a while. <dada@divinf.it>
     Re: Does print() buffer output? <zenin@best.com>
     Re: Does print() buffer output? <sibsib@hotmail.com>
     Re: How to call TELNET from within a script? <oboyle@purdue.edu>
     Re: Installation Problem Perl306/PerlIS on NT 4.0 SP3 Pete@painless-computing.com
     Re: multiple white spaces (Tung-chiang Yang)
     Re: multiple white spaces (Tad McClellan)
     Re: multiple white spaces (Kyzer)
     Re: Passwording (on UNIX) (Abigail)
     Re: Perl "crypt" / "decrypt" (Abigail)
     Perl Compiler & Modules (follow-up) psyclone@twd.net
     Perl for NT and Serial Port Communications <gary@vvm.com>
     Re: Perl interpreter for Windows 3.1 or MS-DOS 6.xx? (Andrew M. Langmead)
     Perl script controlling MSDEV? <randyc@csua.berkeley.edu>
     Premature end of script <david@gilmartin.uk.com>
     Problems with SETUID scripts running vi Apache w/ Linux <andy@netadv.co.uk>
     Regular expression with double bytes (Martin Yan)
     Removing a record from an array <marcio@telebyte.nl>
     Re: Simple, but yet hard reg exp problem? (Tad McClellan)
     VA/DC area -- hiring Perl hackers <rob@central.worldweb.net>
     Re: What does "UNIX" stand for.. <nathan.hand@anu.edu.au>
     Re: why won't 'print <<end_print...end_print' work? (Dr. Frank J. Mabry, Jr.)
     Re: WIN32 modules Wanted <wm_n00@tarrcity.demon.co.uk>
     Re: Y2K Compliant? <aas@bergen.sn.no>
     Re: Y2K Compliant? <jhi@alpha.hut.fi>
     Re: Y2K Compliant? <aas@bergen.sn.no>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 11 Jun 1997 12:04:34 +0200
From: Aldo Calpini <dada@divinf.it>
Subject: #ifdef in XS ?
Message-Id: <339E7832.D8F15D9A@divinf.it>

Hello all,

I'm writing an XS extension to Perl and I have one problem with
#ifdef...

I've written:

bool
IsSomething()
CODE:
    #ifdef SOMETHING
        RETVAL = TRUE;
    #else
        RETVAL = FALSE;
    #endif
OUTPUT:
    RETVAL

But the generated .C file looks like:

XS(XS_IsSomething)
{
    ...
    bool RETVAL;
    RETVAL = TRUE;
    RETVAL = FALSE;
    ST(0) = boolSV(RETVAL);
    if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
    XSRETURN(1);
}

Which is not correct at all...

Anyone knows if it's possible to use #ifdef constructs in XS ?
TIA.

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: Wed, 11 Jun 97 03:39:44 GMT
From: arclight@io.com (Bob Apthorpe)
Subject: Re: 6million lines !!
Message-Id: <5nl6m3$k2h@news.jump.net>

In article <01bc75e0$65ed35e0$03d4dec2@sai-baba.demon.co.uk>,
   "Daniel J Pearce" <djp@sai-baba.demon.co.uk> wrote:
>
>I'm searching a LARGE amount of data using Perl, and have a dwindled down
>while statement controlling the flow of the data.
[snip]
>Reports have to be generated using an interactive front end to input the
>search criteria, options include 25 of the 29 elements in the array.
[snip]
>Would storing the data in a Perl DB help speed up the operation, or slow it
>down, keeping in mind that to reduce the time involved in analysing the
>files either requires less source operation on it, or indeed faster I/O.

Are you trying to pick out particular lines from the files (querying) or are 
you generating aggregate information (condensing, reducing, whatever) from the 
files? Is the data essentially static or (like log files) does it change 
frequently and grossly? How many reports get generated on average? How 
long are your users willing to wait? Sorry for all the questions but it's hard 
to determine whether it's better to be I/O- or CPU-limited without knowing 
more about the data and how it's being used.

Either way, you may want to take a look at Lincoln Stein's Boulder.pm package, 
espcially the part about streaming data and indexing.

Hope this helps,

Bob Apthorpe


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

Date: Wed, 11 Jun 1997 03:36:45 +0000
From: "Aurangzeb M. Agha" <aagha@cis.ohio-state.edu>
Subject: ??? local(blah blah blah) = @_;
Message-Id: <339E1D4D.26D@cis.ohio-state.edu>

I have problem I just can't figure out.  I'm calling a procedure in
which I have 5 parameters, 2 of which are arrays.

I call it like:

	$result = pnpoly($numpts, $x, $y, @xp, @yp);

and the procedure accepts:

	sub pnpoly {
    local ($numpts, $x, $y, @xp, @yp) = @_;
	...
	}

If I print out the values before the procedure call, everything
shows up, but when I print *IN* the procedure, everything shows up
except the last array?!  Why?  I've attached the entire code below
(with bug statements).  Any help (sent to: aagha@cis.ohio-state.edu)
would be *EXTREMELY* helpful.

	Thanks in Advance,
	Aurangzeb Agha

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

sub pnpoly {
    local ($numpts, $x, $y, @xp, @yp) = @_;
    local ($i, $j, $c = 0);

    print "\n*** in pnpoly()\n";
    print "*** numpts: $numpts\n";
    print "*** x: $x, y: $y\n";
    print "*** contents of arrays:\n";
    for ($k = 0; $k < 10; $k++) {
        print "x: $xp[$k], y: $yp[$k+10]\n";
    }

    for ($i = 0, $j = $numpts-1; $i < $numpts; $j = $i++) {
        if (((($yp[$i] <= $y) && ($y < $yp[$j])) ||
             (($yp[$j] <= $y) && ($y < $yp[$i]))) &&
            ($x < ($xp[$j] - $xp[$i]) * ($y - $yp[$i]) /
             ($yp[$j] - $yp[$i]) + $xp[$i])) {
            $c = !$c;
        }
    }
    $c;
}

##############################  MAIN  ##############################
for ($i = 0; $i < 20; $i++) {   # initialize the array
    $pts[$i] = 0;
}

# California (test)
$pts[0] = 18; $pts[10] = 87;
$pts[1] = 52; $pts[11] = 97;
$pts[2] = 43; $pts[12] = 133;
$pts[3] = 80; $pts[13] = 189;
$pts[4] = 83; $pts[14] = 200;
$pts[5] = 77; $pts[15] = 217;
$pts[6] = 51; $pts[16] = 214;
$pts[7] = 25; $pts[17] = 182;
$pts[8] = 10; $pts[18] = 104;

# copy points into temp arrays
for ($j = 0; $j < 10; $j++) {
    $xp[$j] = $pts[$j];
    $yp[$j+10] = $pts[$j+10];
}

# define test point and num vertices
$x = 32; $y = 113;
$numpts = 10;

print "*** in main():\n";
print "*** numpts: $numpts\n";
print "*** x: $x, y: $y\n";
print "*** contents of arrays:\n";
for ($k = 0; $k < 10; $k++) {
    print "x: $xp[$k], y: $yp[$k+10]\n";
}

$result = pnpoly($numpts, $x, $y, @xp, @yp);
print "\n*** result: $result\n";

exit 0;


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

Date: Wed, 11 Jun 1997 04:57:31 GMT
From: jbkim@cnt.co.kr (1h@g:@)
Subject: [HELP] Perl on WindowsNT 4.0 Problem...
Message-Id: <339e2fe9.67036863@news.hansol.net>

Hello?

Please Help ME!!! -_-;

I have some problem whit Perl CGI on WindowsNT 4.0.

I have installed Website 1.2 on WindowsNT4.0.

And Perl5 too...

When I execute follwing code on web.. I receive right output...

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

output----------------------------------------------------------
helpme!
----------------------------------------------------------------------



but after is install CGI.pm, and I use that package...


code------------------------------------------------------------
use CGI;

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

output----------------------------------------------------------
500 Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Message: CGI output from C:/WebSite/cgi-shl/test3.pl contained no
blank line separating
header and data

Please contact the server administrator at jbkim@cnt.co.kr and inform
them of the time the error occured, plus
anything you know of that may have caused the error.
----------------------------------------------------------------------

What mistake I have?

Please  Help me!!!!


My Address jbkim@cnt.co.kr

I'm korean.. and here is korea...
I'm sorry My Dumb English....




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

Date: Wed, 11 Jun 1997 12:20:06 +0200
From: Aldo Calpini <dada@divinf.it>
To: Grant <growan@ica.net>
Subject: Re: Anyone know why a VB app called from a perl script would hang the VB app that runs fine solo?
Message-Id: <339E7BD6.BF59A185@divinf.it>

Grant wrote:
> 
> I've created a VB app that simply fullfills my search query through a
> product's API.  When the VB app runs solo, there is no problem.  Call
> it from a perl script and it hangs.  This is with Internet Information
> Server 2 - Netscape doesn't hang the VB app but won't allow a 
> FileLen() call to resolve a UNC reference to a file I need info on 
> (again, VB app works fine when run on it's own).  Is there any reason 
> that having a perl script call a local program would cause these side 
> effects. Run on Windows NT4.0 using perl5 (that uses PerIIS.dll for 
> perl scripts. - I also tried it with a perl.exe for NT)

Hi Grant,
the reason is probably that the IUSR_* user (the user which IIS runs as)
doesn't have access to network resources. Also note that system calls
with PerlIS.dll are actually "not reliable".

Finally, I've written a Win32::API module that maybe can let you access
your product's API without the need for a VB app.
You can download a very early preview release from:
http://www.divinf.it/dada/perl/api/win32api-0.00.zip

FYI: this message pertains to comp.lang.perl.misc only. 
comp.lang.perl : doesn't exists
comp.lang.perl.modules : is about Perl modules
comp.lang.perl.tk : is about Perl's TK module

Avoid crosspostings like this or you'll get flamed :-)

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: Wed, 11 Jun 1997 11:56:14 +0200
From: Aldo Calpini <dada@divinf.it>
To: Tri Duy Tram <trit@olympic.seas.ucla.edu>
Subject: Re: blank lines
Message-Id: <339E763E.4BB0DD96@divinf.it>

Tri Duy Tram wrote:
> 
>         I was wondering how can I do a regular expression that will
> only
> catch blank lines?  I have text like:
> 
> blah blah blah . . . .
> blah blah . . . .
> 
> more blahs blah . . .
> 
> I tried $var !~ /a-z/ || $var !~ /A-Z/ || $var /0-9/
> but that doesn't seem to work.  Any help will be appreciated.

Try: 

$var =~ /^$/;

This will match empty lines.
If you want to match every blank line (eg lines with "blank" characters
too):

$var =~ /^\s*$/;

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: 10 Jun 1997 19:31:52 GMT
From: wdroze@news.dct.com (William Rozmiarek)
Subject: Breaking out of a while.
Message-Id: <5nka38$kll$1@gbol.dct.com>

How do I abort out of a while(){} statement?

I need to do something like this:

while (<S>) # S is an open socket
{
	chop;
	print;
	if ($_ eq ".")
	{
		exit_out_of_this_while_loop;
	}
}

As long as S (an open socket) is open, the while loop won't finish.
I need to come to the end of a block of text (ending with a "."), and continue with the open socket.

The only way I can break this loop is to close S but I'm not going to open and close the socket for each bit of text I'm retrieving.

Any simple way to blast out of a while statement?

Reply to wdroze@online.dct.com

Thanks.

-------------------------
William Rozmiarek
wdroze@online.dct.com
 ...consultant at large...


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

Date: Wed, 11 Jun 1997 11:59:40 +0200
From: Aldo Calpini <dada@divinf.it>
To: William Rozmiarek <wdroze@news.dct.com>
Subject: Re: Breaking out of a while.
Message-Id: <339E770C.7D4B1980@divinf.it>

William Rozmiarek wrote:
> 
> How do I abort out of a while(){} statement?
>

while (<S>) {
    chop;
    print;
    last if $_ eq ".";
}


Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: 11 Jun 1997 10:14:51 GMT
From: Zenin <zenin@best.com>
Subject: Re: Does print() buffer output?
Message-Id: <5nltqr$s58$2@nntp2.ba.best.com>

Anthony J Terlecki <ajt@terlecki.demon.co.uk> wrote:
> When I run the following script I do not get the results I expected. What I
> wanted was the initial message following by a . every second. What I get is
> the initial message and all 9 dots at once 9 seconds after the script begins
> execution.
> Can anyone tell me why this is and how I might get around it?

	man perlvar

	Look for information about the $| variable.

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 11 Jun 1997 15:58:36 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: Does print() buffer output?
Message-Id: <339F036C.9E56E5FC@hotmail.com>

Anthony J Terlecki wrote:
> When I run the following script I do not get the results I expected. What I
> wanted was the initial message following by a . every second. What I get is
> the initial message and all 9 dots at once 9 seconds after the script begins
> execution.
> 
> Can anyone tell me why this is and how I might get around it?

The system is buffering the output of your script.

> #!/usr/bin/perl

$| = 1;               # look it up in the Camel

> print "processing";
> for ($i=1; $i<10; $i++) {
>         print ".";
>         sleep 1; # emulating a process in the loop taking time
> }

Scott

-- 
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net


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

Date: 11 Jun 1997 14:56:35 GMT
From: Todd O'Boyle <oboyle@purdue.edu>
Subject: Re: How to call TELNET from within a script?
Message-Id: <5nmeb3$5lr@ector.cs.purdue.edu>

Huge Cajones Remailer <nobody@huge.cajones.com> contributed:
> Can someone show me (or tell me where to look to find out) how to
> start an interactive telnet session from within a script?  I.e. is
> there anyway for a Perl script to call and hand over control to
> telnet?  FWIW, I'm working in Unix.

## Gimme a host
my $host = $ARGV[0];

## Tell perl where your telnet client is.
my $telnet = "/bin/telnet";         ## Could be "/usr/bin/telnet"?

## Build my command to give to the system.
my $command = "$telnet $host";

## Hand it off.
system($command);

-- 
Todd O'Boyle  		- Programmer, Perl Hacker, BMX Rider, etc. -
URL: <a href="http://www.cs.purdue.edu/homes/oboyle/"> My Homepage! </a>
PGP: finger oboyle@cs.purdue.edu
EMAIL: oboyle@purdue.edu


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

Date: Tue, 10 Jun 1997 23:36:31 -0600
From: Pete@painless-computing.com
Subject: Re: Installation Problem Perl306/PerlIS on NT 4.0 SP3
Message-Id: <866002186.20237@dejanews.com>

Roland:

Are you using any custom libraries (e.g. InterShop) which might have been
compiled for Perl Win32 Build 301, or earlier?

--Pete

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


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

Date: Wed, 11 Jun 1997 07:32:48 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: multiple white spaces
Message-Id: <tcyangEBLoyo.CoC@netcom.com>

Maybe you should try

s/\s\s/ /g;

and that should be easier.  I did not attempt any 'nongreedy' pattern
matching yet, but your s statement at best removes the leading and
lagging spaces, instead of the multiple spaces.

===========================
Tri Duy Tram typed when the mommy tyrannosaurus found him:

: I am wondering how do you change multiple white spaces to just one single
: white space?  Lets suppose I have a string

: $line = "This is a  line  that has multiple  white space";
:  
: to

: $line = "This is a line that has multiple white spaces";

: I tried:
: $_ = $line;
: s/^\s*(.*?)\s*$/$1/;

: but that gives me an error
: /^\s*(.?)\s*$/: nested *?+ in regexp 

: any help will be appreciated.  Thank you.

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Tue, 10 Jun 1997 22:21:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: multiple white spaces
Message-Id: <6j5ln5.he3.ln@localhost>

Tri Duy Tram (trit@olympic.seas.ucla.edu) wrote:

: I am wondering how do you change multiple white spaces to just one single
                                                                 ^^^^^^^^^^
: white space?  Lets suppose I have a string
  ^^^^^^^^^^^

"white space" is any of three characters. Which one do you want?

I'll assume a space character.


: $line = "This is a  line  that has multiple  white space";
:  
: to

: $line = "This is a line that has multiple white spaces";


$line =~ s/\s+/ /g; 


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 11 Jun 1997 19:24:39 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: multiple white spaces
Message-Id: <5nmu1n$r5l@info.abdn.ac.uk>

Hurrah, for 'tis said that Tri Duy Tram did write:
: I am wondering how do you change multiple white spaces to just one single
: white space?
Not _everything_ can be solved with regexps in perl, although most things
can :)

You may like to try print join' ',split/\s+/,$mystring;

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!

-- 
Random sig of the day:
sh: cookie not found


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

Date: Wed, 11 Jun 1997 05:14:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Passwording (on UNIX)
Message-Id: <EBLIKD.8pE@nonexistent.com>

TechMaster Pinyan (jefpin@bergen.org) wrote on 1380 September 1993 in
<URL: news:Pine.SGI.3.96.970610202022.2026B-100000@davinci.bergen.org>:
++ Is there a way to NOT show what characters a user is typing for the
++ purpose of entering passwords?  Thanks in advance, even if no one knows.

Yes. It's in the FAQ. It's in the Camel. And it's in the free
documentation coming with Perl.



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


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

Date: Wed, 11 Jun 1997 05:13:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl "crypt" / "decrypt"
Message-Id: <EBLIHu.8KA@nonexistent.com>

Chris Rurode (Christopher.Rurode@Daytonoh.ncr.com) wrote on 1379
September 1993 in <URL: news:EBKA42.1Mx@falcon.daytonoh.ncr.com>:
++ Currently our organization has Oracle databases on Unix
++ platforms. We use Unix "crypt" and "decrypt" libraries to store
++ and forward a password to Oracle. We are developing new
++ applications on Windows NT with an Oracle database and would
++ like to use Perl for our scripts. Does Perl have "crypt" and
++ "decrypt" routines?

Well, Perl has 'crypt', but it's not supposed to be decryptable.


Psst. Have you noticed there are manuals about Perl out there?
Describing the most gory details and intimite secrets of Perl?
All you need to do is *gasp* install Perl.

perldoc -f crypt


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


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

Date: Wed, 11 Jun 1997 02:51:37 -0600
From: psyclone@twd.net
Subject: Perl Compiler & Modules (follow-up)
Message-Id: <866014990.27363@dejanews.com>

I thought an example of the errors might help.


Here's the code I want to compile :

#!/usr/bin/perl

$host = $ARGV[0];
&usage unless $host;

use Net::Time qw(inet_daytime);
print "\nTime on $host: ";
print inet_daytime($host, 'tcp');
print "\n";

sub usage {
 print "\nUSAGE: get_time <host>\n\n";
 exit;
}


When I run "./get_time" it seems to work ok :

USAGE: get_time <host>


But here's the error I get when I run "./get_time localhost" :

Can't call method "new" in empty package "IO::Socket::INET" at
/usr/lib/perl5/site_perl/Net/Time.pm line 36.


Thanks,

Allen

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


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

Date: Wed, 11 Jun 1997 09:34:42 -0500
From: "Gary Dewrell" <gary@vvm.com>
Subject: Perl for NT and Serial Port Communications
Message-Id: <5nmfcs$gnu$1@newshost.vvm.com>

I need to be able to access a serial port using perl for NT and also send
data in octal and receive data in octal and then decode that data. Can
anyone please point me in the right direction to find this info.

Gary Dewrell




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

Date: Tue, 10 Jun 1997 13:55:11 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl interpreter for Windows 3.1 or MS-DOS 6.xx?
Message-Id: <EBKBzz.Aq0@world.std.com>

Goh Yong Kwang  <s6606555@mercury.np.ac.sg> writes:

>I would like to write Perl scripts on my PC which is running on Win3.1 
>and MS-DOS but I can't find a Perl interpreter for Win3.1 or MS-DOS on the
>Internet. Is there any Perl interpreter for WIn3.1 or MSDOS 6.xx? If so, 
>where can I download them?

Your two choices for MS-DOS are either an old buggy port of 5.001 that
was compiled with the Watcom DOS extender, or the port of 5.004 beta
that uses the EMX or RSX extender. Both are available at
<URL:http://CPAN/ports/msdos/perl5/>.

(The EMX port is often as the OS/2 port.)

-- 
Andrew Langmead


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

Date: 11 Jun 1997 06:54:43 GMT
From: "Randy Chou" <randyc@csua.berkeley.edu>
Subject: Perl script controlling MSDEV?
Message-Id: <01bc7633$af179820$0f02000a@batcave>

Hi,

I'm new to perl/win32/ole so I apologize if this is a stupid
question...But I understand that perl's OLE extensions 
allows perl scripts to send and control applications containing 
an OLE server (like Excel).  Is there anyway to control
MSDEV (Visual C++ 4.2) through a perl script?  I can't
seem to find a file describing MSDEV's OLE interfaces.
Basically, I'd like to be able to write a perl script that
will automatically bring up MSDEV, open a makefile,
and compile or run dependencies.  Is this doable?

Please reply through email.  Thanks.

--
Randy



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

Date: 11 Jun 97 05:32:39 GMT
From: "DAVID GILMARTIN" <david@gilmartin.uk.com>
Subject: Premature end of script
Message-Id: <01badb46$308f47c0$6b053cc3@surgery.powernet.co.uk>

#!/bin/perl
 
@my_name = ("Eric ","C. ","Herrmann");
$myName[0] = "Scott ";
$myName[1] = "E. ";
$myName[2] = "Herrmann";
 
print "content-type: text/html\n\n";

print "<HTML>\n<HEAD>\n";
print "<TITLE>This is a web page</TITLE>\n";
print "</HEAD>\n<BODY>\n";
print "Hello World @my_name wrote this\n";
print "Really @myName wrote this\n";
print "No Kidding $my_name[0] $my_name[1] $my_name[2] wrote this!\n";
print "</BODY>\n</HTML>\n";

but I get the follow message

[Mon Jun  9 14:26:10 1997] access to
/ftp/webs/gilmartin.uk.com/bulletinboardgilmartin/test03.cgi failed for
powerproxy.powernet.co.uk, reason: Premature end of script headers

i am sure it is simple

david
-- 
david@gilmartin.uk.com


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

Date: Wed, 11 Jun 1997 15:09:12 +0100
From: Andy N <andy@netadv.co.uk>
Subject: Problems with SETUID scripts running vi Apache w/ Linux
Message-Id: <339EB188.F502BFA@netadv.co.uk>

I have been writing a set of Web-pages which communicate with some Perl
(5.004) scripts  in our Apache server's /cgi-bin.  What they are
_supposed_ to do is provide a simple interface for adding/removing users
and editing user details, ie, messing about with /etc/passwd.

The problem is that they do not seem to have permission to make the
necessary changes when run from the web-page, although they are
perfectly happy if I run them from the command line.  I have chmod
6755'd them, which as I understand it should ensure that the scripts run
as root, but they clearly aren't when our web-server has finished with
them..

Anybody out there feel like telling me where I'm going wrong?

Andy.



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

Date: 11 Jun 1997 07:41:18 GMT
From: mkyan@cse.cuhk.edu.hk (Martin Yan)
Subject: Regular expression with double bytes
Message-Id: <5nlkqu$879@eng-ser1.erg.cuhk.edu.hk>

Hello all,

	I am trying write to a search engine with the capability to search 
a database blend with signle byte and double bytes characters(such as 
chinese).  But i found that some of the double bytes character are 
composed of some regular expression keywords, such as ^, %,........
	Can someone show me the correct way to tackle this problem??
	Thanx!

--
Name	  : Martin Yan  (:B$e3G)            .     .            .  *          .
MY     URL: http://snow.csc.cuhk.edu.hk/  *    .   *           .       .
LPCUWC URL: http://snow.csc.cuhk.edu.hk/~martin/LPC/      .*
Alumni URL: http://snow.csc.cuhk.edu.hk/y94/ 	     .     .
ICQ	  : 1460650	*         .                .          .   
The Chinese University of Hong Kong   .           .   .    .       .


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

Date: Wed, 11 Jun 1997 09:42:39 +0200
From: "M.L.S. Thiel" <marcio@telebyte.nl>
Subject: Removing a record from an array
Message-Id: <Pine.LNX.3.95.970611093920.3138A-100000@monet.telebyte.nl>

need help for a program who read a file into an array
and then delete delte the record that i send as an argument 
in this case a user(as arg) from the array and save the file.





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

Date: Tue, 10 Jun 1997 21:01:06 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Simple, but yet hard reg exp problem?
Message-Id: <2t0ln5.643.ln@localhost>

Andreas Olsson (cie95aol@lustudat.student.lu.se) wrote:
: Hello!

Hi.

: This problem puzzles me and would really appreciate if someone would help me.

: I have a text that looks like this:

: <eq-1>a^{b}c</eq-1>
: <eq-2>a^{b}c</eq-2>

: Now I want to translate the ^{b} command different depending on if I'm within 
: the <eq-1>...</eq-1> or the <eq-2>...</eq-2> tag. The final result should look 

Since you say "within", I would check for both the start and end tag
in the regex.


: like this:

: <eq-1>a<super>b</super>c</eq-1>
: <eq-2>a<inf>b</inf>c</eq-2>

: I've tried the following but it doesn't work properly:

: s#^{(.*?)}(.*?</eq-1)#<super>$1</super>$2#gs;
: s#^{(.*?)}(.*?</eq-2)#<inf>$1</inf>$2#gs;

: The problem appears when I have this combination of input

: <eq-1>a^{b}c</eq-1>
: <eq-2>a^{b}c</eq-2>
: <eq-1>a^{b}c</eq-1>

: When I find the ^ in the <eq-2> I don't want the first expression to do 
: anything, but it find </eq-1> on the other row and it substitutes incorrect.

Your basic problem is that the first s###  *must* end in </eq-1. So it
matches right on until it finds one. And the first s### gets to do all
of its substitutions first.

You can write one s### to do all of the alternatives:

-------------------
#! /usr/bin/perl -w

$_ =<<ENDSGML;                     # some test data
<eq-1>a^{b}c</eq-1>
<eq-2>a^{b}c</eq-2>
<eq-1>a^{b}c</eq-1>
ENDSGML

$gi[1] = "super";                  # generic identifiers
$gi[2] = "inf";

s!(<eq-([12])>.*?)                 # start tag and some stuff: $1, $2
  \^{([^}]+?)}                     # stuff in curly braces: $3
  (.*?</eq-\2>)                    # some stuff and end tag: $4
 !$1<$gi[$2]>$3</$gi[$2]>$4!gsx;

print;
-------------------


Pretty darn messy but it works.

 ... until you get one like:  "<eq-1>a^{b}c^{d}e</eq-1>" and only the first
superscript gets tagged...

(then you can throw a "1 while" in front of the substitution)


: I feel that this should be simple but can't find a way to solve it, please 
: help me.


Not as simple as I would like. It may be even further complicated if
there are nested <eq-N> elements or nested {curly{braces}}...


: Thanks in advance


Hope this helps!


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Tue, 10 Jun 1997 13:53:27 -0400
From: Rob Heittman <rob@central.worldweb.net>
Subject: VA/DC area -- hiring Perl hackers
Message-Id: <339D9497.C0BE55D@central.worldweb.net>

We are looking for more Perl people to work at our location.  The
official ad from the Washington Post follows . . .

PROGRAMMER-Internet/Unix

DC's most elite, innovative and best-established Internet solutions
company is hiring experienced Unix CGI programmers to help produce
efficient, elegant open Web solutions for high-profile clients. 
Applicants must  be clever and results-oriented, with plenty of hands-on
Unix experience programming C and Perl for the Web.  We offer a relaxed,
friendly team environment, extremely flexible hours, and a great
location.  Positions available 24K-48K + options, benefits, immediate
start.  No fixed education or employment history requirements.  Apply at
http://www.worldweb.net/hiring.


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

Date: Wed, 11 Jun 1997 15:49:51 +1000
From: Nathan Hand <nathan.hand@anu.edu.au>
Subject: Re: What does "UNIX" stand for..
Message-Id: <339E3C7F.31DA1669@anu.edu.au>

av wrote:
> 
> Bill (Gates) Erwin wrote:
> 
> > UNIX started out as "Castrated MULTICS" and was shortened from there.
> > Check out the "UNIX Haters Handbook" for further details.
> 
> I have 4 Intranet servers running. 3 are Linux and one is NT. I keep the
> NT alive just for demo, it runs on the better machine and still has the
> worse performance, and crashes at least twice a week... Really Microsoft
> style.. :-b
> 
> I don't know what the "UNIX Haters Handbook" is, but sounds like
> bullshit...

The UHH is tripe. Waste of money.

--
The idea that an arbitrary naive human should be able to properly use
a given tool without training or understanding is even more wrong for
computing than it is for other tools (eg automobiles, airplanes, guns
or power saws).


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

Date: 10 Jun 97 13:49:43 GMT
From: df6954@eecs1.eecs.usma.edu (Dr. Frank J. Mabry, Jr.)
Subject: Re: why won't 'print <<end_print...end_print' work?
Message-Id: <339D5B77.6A18@eecs1.eecs.usma.edu>

Tad McClellan wrote:
> 
> Bryan Hart (bryan@eai.com) wrote:
> 
> : > Will Sexton wrote:
> : > >
> : > > If I do the following:
> : > >
> : > >         print <<"end_print";
> : > >         some text
> : > >         some text on the next line
> : > >         end_print
> : > >
> 
> : Also, I don't think that you should double-quote the terminator string
> : either...
> 
> Why not?
> 
> An answer without a reason is of significantly reduced value.
> 
> --
>     Tad McClellan                          SGML Consulting
>     Tag And Document Consulting            Perl programming
>     tadmc@flash.net

Double quote and no quotes are essentially the same.
The normal processing of a "here" script is to replace
Perl variable references with their value.

A single foward quote "'" avoids replacement processing.  Using
the back-quote causes the script to print the results of 
passing the "here script" to the command processor to the 
referenced output file (STDOUT in this case).

"Here scripts" represent a very useful way to portray large
blocks of output (which may include HTML markup) and 
use Perl variables.  I often have my students (cadets) develop
a front end form, a database (usually delimited text), and 
a prototype "virtual page" of output when they want to create
some search and/or report engine.  It usually takes only about 
15 to 30 minutes to convert their efforts to a running reporting 
system.  To do this I use "here scripts" and cut and paste.  It
might be viewed as a primitive rapid prototyping system.  I view
it as a survival tool as a teacher and mentor.  The big benefit 
that is really achieved is that I can show them the importance of 
designing and understanding the user interface early in the 
information system design process.

Dr. Frank Mabry
Dept. of EE&CS
U.S. Military Academy
West Point, NY

email df6954@eecs1.eecs.usma.edu


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

Date: Wed, 11 Jun 1997 12:04:54 +0100
From: Wm <wm_n00@tarrcity.demon.co.uk>
Subject: Re: WIN32 modules Wanted
Message-Id: <m4xgegAWZonzEwqH@tarrcity.demon.co.uk>

Wed, 11 Jun 1997 00:07:26 <339debe4.4179780@news.uh.edu>
Spiro Angeli <Spiro@uh.edu> posted...

>I am looking for some win32 module for Perl 5 for NT that will
>allows me to manage the Windows NT Server.
>I have noticed that QUE book explains them and perhaps has them on the
>CD-ROM. Is there any possibility to find them on the NET?

Try CPAN.  Look for Win32 and WinNT in the modules listing.

-- 
Wm ... did you know?  My spell checker wants tarrcity to be atrocity.


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

Date: 11 Jun 1997 10:02:13 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: Y2K Compliant?
Message-Id: <hu3j5efei.fsf@bergen.sn.no>

mike@stok.co.uk (Mike Stok) writes:

> No amount of "year 2000 compliance" in the language will make up for
> programs whose authors though that prepending "19" to the year

Nobody would ever prepend "19" to the year if the year returned by the
language functions was relative to year 0 instead of relative to year
1900.  Returning (year-1900) was and still is a stupid trick.

One more reason to switch to Python :-)

-- 
Gisle Aas <aas@sn.no>


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

Date: 11 Jun 1997 12:11:02 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Y2K Compliant?
Message-Id: <oeeiuzlqzbt.fsf@alpha.hut.fi>


From: Gisle Aas <aas@bergen.sn.no>
: Nobody would ever prepend "19" to the year if the year returned by the
: language functions was relative to year 0 instead of relative to year
: 1900.  Returning (year-1900) was and still is a stupid trick.

A trick that has very little to do with Perl.

: One more reason to switch to Python :-)

So Python is non-ANSI-C and non-POSIX compliant on this?  The struct
tm member tm_year is defined as year-1900.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 11 Jun 1997 13:04:12 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: Y2K Compliant?
Message-Id: <hpvtte6z7.fsf@bergen.sn.no>

Jarkko Hietaniemi <jhi@alpha.hut.fi> writes:

> From: Gisle Aas <aas@bergen.sn.no>
> : Nobody would ever prepend "19" to the year if the year returned by the
> : language functions was relative to year 0 instead of relative to year
> : 1900.  Returning (year-1900) was and still is a stupid trick.
> 
> A trick that has very little to do with Perl.

I disagree.  Perl did not have to do it like this just because the C
library did.  But, there is not much to do about it now.  I have not
had too much problem getting used to always adding 1900 to localtime's
year.  I just think it is silly.

Does anybody know the real reason why tm_year contains year-1900?  Was
this done on purpose or was it an accident?

> : One more reason to switch to Python :-)
> 
> So Python is non-ANSI-C and non-POSIX compliant on this?

Yes, if you think the C library should have anything to do with it.
I would guess it will be compliant to ANSI-Python and POSIX Python
Language Bindings though :-)

-- 
Gisle Aas <aas@sn.no>


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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