[6433] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 58 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 5 20:37:18 1997

Date: Wed, 5 Mar 97 17:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 5 Mar 1997     Volume: 8 Number: 58

Today's topics:
     5.000 --> 5.002 <kspence@pike.modes.tc.faa.gov>
     Re: @ interpolation in string context <rootbeer@teleport.com>
     Re: Basic $ENV questions (Nathan V. Patwardhan)
     Re: can $_ be dissociated from its contents? <dbenhur@egames.com>
     Re: cgi file upload utility <tchrist@mox.perl.com>
     check process memory in Sparc & HP-UX samlo@cdac.com
     Re: Creating a new empty file from within Perl.. (Aegir)
     DBD/DBI Oracle <mshannon@lds.com>
     Re: Deamons (or Services)  on WinNT--Anyone written any ("John Dallman")
     Filehandles and subroutines (Tom Harrington)
     Re: flock quandary <guenther@lunen.gac.edu>
     Re: Grabbing text of web pages using perl <merlyn@stonehenge.com>
     HELP  - Problem with Perl 4 on HP-UX (Leonard I Goodman)
     Re: How to make perl scripts appear locally on the brow <merlyn@stonehenge.com>
     Linux SOCK_PACKET sockets from w/i perl <btr@iol.unh.edu>
     Re: mathematically correct? <dbenhur@egames.com>
     Re: Need to Generate Web Pages from Excel!    HELP! (Nathan V. Patwardhan)
     Re: Newbie question: perl, OS/2, and #! (Joel Earl)
     Re: passing hidden input from cgi to perl script <aynang@probe.att.com>
     PERL --> C translator? <kspence@pike.modes.tc.faa.gov>
     Re: perl tcp server for mac to unix (Peter Mulderry)
     Re: Perl timing questions: <tmh@possibility.com>
     Re: putting a text comment space <dbenhur@egames.com>
     Redirect compilation messages? (Efigenio Ataide)
     Re: Subroutine Source? <rootbeer@teleport.com>
     Using the print-command with colors (Mikael Hallendal)
     Re: Which one is the best (pattern matching) <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 05 Mar 1997 13:24:02 -0500
From: Kimberly Spence <kspence@pike.modes.tc.faa.gov>
Subject: 5.000 --> 5.002
Message-Id: <331DBA42.5112@pike.modes.tc.faa.gov>

As it turns out I have 5.000 on
my workstation.  How do I get to
5.002?  Is it just a patch or
do I reinstall everything?

I didn't install 5.0....

Thanks,

Kim Spence

-- 


***********************************************************************
           Spend your life for something that outlasts it.
***********************************************************************


This is my personal opinion and not that of my employer !!!


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

Date: Wed, 5 Mar 1997 12:09:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ken Williams <ken@forum.swarthmore.edu>
Subject: Re: @ interpolation in string context
Message-Id: <Pine.GSO.3.95q.970305115735.3572R-100000@kelly.teleport.com>

On Tue, 4 Mar 1997, Ken Williams wrote:

> I found myself kind of upset when this compiled:
> 
>  %hash = &subr;
>  @POSTED = ('hiya', 'friya');
>  print("POSTED: @POSTED\n");
> 
>  sub subr {
>     return (One => 1);
>  }
> 
> But this didn't:
> 
>  %hash = &subr;
>  print("POSTED: @POSTED\n");
> 
>  sub subr {
>     @POSTED = ('hiya', 'friya');
>     return (One => 1);
>  }
> 
> It gave me this error message:
> 
>  Literal @POSTED now requires backslash at arrays.pl line 4, within string

This is a result of Perl first compiling, then running. During the compile
phase, Perl wants to turn this string

    "POSTED: @POSTED\n"

into code something like this.

    'POSTED: ' . join( $" , @POSTED ) . "\n"

If Perl hasn't seen that you're using @POSTED by the time it needs to
compile that string, it generates that warning. This is generally a Good
Thing.

There are many ways to avoid the warning; you found one of them. Another
is to declare your variables with 'use strict' and 'use vars', which I
recommend for any program over about ten lines. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/




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

Date: 5 Mar 1997 20:54:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Basic $ENV questions
Message-Id: <5fkmj1$2pn@fridge-nf0.shore.net>

Eddie Babin (ebabin@cyberenet.net) wrote:

: I don't know why I can't get all ( or any) of the enviroment
: settings written to a file.  The only fields written are the
: date and the REMOTE_ADDR.  I've accessed the page through
: several different servers with the same result.  Any help
: would be appreciated.

Is this what you were looking for?

$envfile = '/path/myenv.txt'; ### make sure file and directory have
			      ### the correct permissions

open(OUTFILE, ">>$envfile") || print("File error: $!"); ### open a/c
foreach $key (sort keys %ENV) {
   print OUTFILE $ENV{$key},"\n";
}
close(OUTFILE);

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: Wed, 05 Mar 1997 11:16:38 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: aeb@saltfarm.bt.co.uk
Subject: Re: can $_ be dissociated from its contents?
Message-Id: <331DC696.E5B@egames.com>

[courtesy reply emailed]
Tony Bass wrote:
> From article <3319F35C.6545@egames.com>, by Devin Ben-Hur <dbenhur@egames.com>:
> > Looks like we need a anonymous scalar construct
> > anologous to the anonymous array [...] and hash {...}
> > construct.
> 
> I noticed this slight asymmetry myself recently, but think it is the
> sort of thing that one could define for oneself if desired, on the lines
> of
>    sub anonscalar {
>     my ($var) = @_;
>     return \$var;
>    }
> taking the initial value as parameter.

Well this subroutine serves the purpose of anonymizing a scalar
value, but doesn't address Rahul's original problem: how to get a 
reference to a scalar *value* without copying the value to some 
new storage location.  The solution others came up with was to
put each new value in a new location (the end of an ever growing
array rather than $_).

With a real anonymous-scalar construct, one might be able to say 
something like:
   $ref = \$[ $_ ];  # I just made up this notation
and get a reference to the current contents of $_ without
having to copy them. On the other hand this ability would 
likely grossly complicate how just a simple \$var works
(internally) and I doubt we'ld see much enthousiasm for
such a specialized need.
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks"  O-
    -- Sonia Orin Lyris




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

Date: 6 Mar 1997 00:07:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: cgi file upload utility
Message-Id: <5fl1sl$5ht$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    cbusch@member.com writes:
:Has anyone written an upload file cgi utility that can support both
:binary and text files?
:
:I am working on one in Perl, but it adds an anyone CR/LF at the
:beginning and end of some files.

Normally we just use Apache on Unix and the problem evaporates.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

MAGIC*  xmg_magic;  /* linked list of magicalness */
    --Larry Wall, from sv.h in the v5.0 perl distribution


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

Date: Wed, 05 Mar 1997 17:11:48 -0600
From: samlo@cdac.com
Subject: check process memory in Sparc & HP-UX
Message-Id: <857603158.29073@dejanews.com>

Hi,

  I'm writing a script to read process memory for Solaris, Sparc 10, &
  HP-UX platforms.

  In Solaris, I can use: "ps -o vsz -p <process_no>"

  But in Sparc 10 & HP-UX, I have a hard time to look for a command
  to do this job.

  I try "top | grep <process_id>".  It works but it is troublesome to
  get the memory data by regular expression.

  Is there any other quick ways to get process memory by Unix commad
  in Sparc 10 & HP-UX?  Or by perl?

  Thanks.

Sam

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


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

Date: 5 Mar 1997 22:47:18 GMT
From: ByeBye@www.dma.be (Aegir)
Subject: Re: Creating a new empty file from within Perl..
Message-Id: <ByeBye-ya02408000R0503972346450001@news.ping.be>

>I'm writing a little CGI in perl (works perfectly..). But one of the things I 
>need is to create a none existing new file (a new one for each new 
>user).

Thanks to all for replying..It worked..Now I'm a bit smarter..
And maybe ...;)

Greetings,

-- 
Wondering where and how it started...
Bugs !....

Warning ! Return Email address is changed to fool junk mail: return
through mail at Aegir@mail.dma.be


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

Date: Wed, 05 Mar 1997 16:16:49 -0500
From: Michael Shannon <mshannon@lds.com>
Subject: DBD/DBI Oracle
Message-Id: <331DE2C1.2D61@lds.com>

Hi,


This is my senario. I have a Unix web server that has Oracle 7.2
loaded(Including SqlNet). From a client PC, I am accessing a Perl script
located on the Unix machine via posts from an HTML file. This Perl
script needs to connect to the Oracle database, run a stored
procedure(or insert a row into table, but preferably run the stord
procedure) and return the results to the client as an HTML file. To do
this I have been told that I need DBD/DBI and that I can get it from 
http://www.hermetica.com/. From this site, I retrieved a GNEW zip file
which contains *.pm, *.pl, *.h, *.c, and *.xs files. The problem is I
have no idea what I have or how to use what I have or what I don't have
and still need to acquire. Do I have DBB? Do I have DBI? Can't I just
use a reference module(PM?) or library and use the functions to access
the database? 

Any and all help will be greatly appreciated,

Mike


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

Date: Wed, 5 Mar 1997 20:57:07 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Deamons (or Services)  on WinNT--Anyone written any?
Message-Id: <E6L8v7.96s@cix.compulink.co.uk>

Diana Duncan <dduncan@realogic.com> wrote:

> I've written several daemons in Perl on Unix, but I am unsure how to go
> about writing one on NT (and, unfortunately, I need to.  Woe is me).  I
> was wondering if anyone had any examples of how to "daemonize" the
> program?

There is a tool in the NT Resource Kit that lets programs run as 
services. I've never actually used it, and can't say how well it works, 
but it's there.

John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked: 
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, BigPerl 
for MS-DOS can be found in CPAN via http://www.perl.com, Perl for NT/Win 
95 can be found at http://www.activeware.com, with an excellent FAQ file 
at http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html and 
no, I don't have the slightest idea what's wrong with your CGI script.


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

Date: 5 Mar 1997 22:12:25 GMT
From: tph@longhorn.uucp (Tom Harrington)
Subject: Filehandles and subroutines
Message-Id: <5fkr49$ev31@eccws1.dearborn.ford.com>


How can I return a filehandle from a subroutine?

I have a subroutine which does this:

	open(LOGFILE,">$logfile_name");

I want to be able to use the subroutine like this (or something similar):

	$filehandle = &openlog(.....);

So that $filehandle will be an indirect file handle, which would
allow me to have statements like this in the calling function:

	print $filehandle "Log timestamp: ",$date,"\n";

I've tried just returning the filehandle that open() creates, but it
doesn't work, and I'm not sure why:

	return LOGFILE;

With this and a few other semi-random things I've tried, perl -w
tells me that the filehandle was never opened when I try to print
from the calling function.

--
Tom Harrington ------- tph@rmii.com ------- http://rainbow.rmii.com/~tph
  "Boy, you look tough in your black leather jacket! Bring your head 
           closer, I'll be the first to smack it!" -Fishbone
-> Fractal Kit:  http://rainbow.rmii.com/~tph/fractalkit/fractal.html <-


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

Date: 05 Mar 1997 18:30:48 -0600
From: Philip Guenther <guenther@lunen.gac.edu>
Subject: Re: flock quandary
Message-Id: <e694tepx3nq.fsf@lunen.gac.edu>

fishbowl@fotd.netcomi.com (James L. McGill) writes:

> I need to open a file for ">" overwriting
> but only if I can get an exclusive lock on it.
> 
> Here's the dilemma though.  If I open it so that I 
> can pass the filehandle to flock(), the file is 
> destroyed anyway.  If I open it for reading,
> lock it, then close and reopen it for writing, the 
> lock is gone!

Open the file for update then use truncate() to shorten it:

sub LOCK_EX { 2 }
sub LOCK_UN { 8 }

open(FOO, "+</some/file")	or die "$0: Unable to open /some/file: $!";
flock(FOO, LOCK_EX)		or die "$0: Unable to lock: $!";
truncate(FOO, 0)		or die "$0: Unable to truncate: $!";
print FOO "blah blah blah\n"	or die "$0: Unable to write: $!";
close(FOO)			or die "$0: Unable to close: $!";


Philip Guenther

---------------------------------------------------------------- 
Philip Guenther			UNIX Systems and Network Administrator
Internet: guenther@gac.edu	Voicenet: (507) 933-7596
Gustavus Adolphus College       St. Peter, MN 56082-1498


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

Date: 05 Mar 1997 15:22:29 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: glee@glee.com (gbones)
Subject: Re: Grabbing text of web pages using perl
Message-Id: <8c67z6nfmi.fsf@gadget.cscaper.com>

>>>>> "gbones" == gbones  <glee@glee.com> writes:

gbones> I just spent the last week fiddling with various scripts/socket calls, and
gbones> i finally found a script here :

gbones> http://www-step.ucsd.edu:80/step/s96/perl/sockets/

I just visited this link, and most of the stuff there merely re-invents
stuff that is either in the 5.004 release or the CPAN modules such
as LWP.  Hmm.  Wasted effort.  How sad.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 544 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 5 Mar 1997 18:38:24 GMT
From: lig@world.std.com (Leonard I Goodman)
Subject: HELP  - Problem with Perl 4 on HP-UX
Message-Id: <E6L2G1.HxG@world.std.com>

We have just installed Perl 4.036 onto an HP-712, 
running HP-UX 10.2.  We tried running the test
suite which is part of the Perl delivery and ran
into a problem with the test t/comp/cpp.t

This test has the following source:

#!./perl -P

open(CONFIG,"../config.sh") || die;
while (<CONFIG>) {
    if (/^cppstdin/) {
	if (/^cppstdin='(.*cppstdin)'/ && ! -e $1) {
	    print "1..0\n";
	    exit; 		# Can't test till after install, alas.
	}
	last;
    }
}
close CONFIG;

print "1..3\n";

#this is a comment
#define MESS "ok 1\n"
print MESS;

#If you capitalize, it's a comment.
#ifdef MESS
	print "ok 2\n";
#else
	print "not ok 2\n";
#endif

open(TRY,">Comp.cpp.tmp") || die "Can't open temp perl file.";

($prog = <<'END') =~ s/X//g;
X$ok = "not ok 3\n";
X#include "Comp.cpp.inc"
X#ifdef OK
X$ok = OK;
X#endif
Xprint $ok;
END
print TRY $prog;
close TRY;

open(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
print TRY '#define OK "ok 3\n"' . "\n";
close TRY;

$pwd=`pwd`;
$pwd =~ s/\n//;
$x = `./perl -P Comp.cpp.tmp`;
print $x;
unlink "Comp.cpp.tmp", "Comp.cpp.inc";

*******  end of listing   ******

There are syntax errors reported at the line

  print TRY $prog;

(message is "syntax error, next token 'print ' ") 
and at the line

  $x = `./perl -P Comp.cpp.tmp`;

(message is "syntax error, next token '$x' ")

When running this test on a Sun Sparc with 
Solaris 2.5, these is no problem.  We will be
updating to Perl 5.xx, but we are using Perl 4.
for now.  Any help would be appreciated.

Len


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

Date: 05 Mar 1997 15:28:22 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jgm@dynamicweb.com
Subject: Re: How to make perl scripts appear locally on the browser
Message-Id: <8c209unfcp.fsf@gadget.cscaper.com>

>>>>> "JG" == JG Motolanez <jgm@dynamicweb.com> writes:

JG> Here's an old subroutine I use:

JG> sub show_source
JG> {                                                               
JG>    open(SOURCE, "$0") || die 'Cannot open file
JG> "$0"';                           
JG>    print "<HR>Here is the
JG> Source.<HR><PRE>";                                    
JG>    while ($line = <SOURCE>){ # need to escape &lt and
JG> &gt                       
JG>       ($foo = $line) =~ s/</&lt/g;#2nd &lt is escape sequence & l t (no
JG> spaces) 
JG>       ($bar = $foo ) =~ s/>/&gt/g;#2nd &gt is escape sequence & g t (no
JG> spaces) 
JG>       print
JG> $bar;                                                               
  
JG> }                                                                            
JG>    print
JG> "</PRE>";                                                              
  
JG> close(SOURCE);                                                               

Ouch!  You forgot the semicolon after &lt; and &gt;, and you aren't coding
&amp;!

Here's what I've been using lately:

	$html =~ s/[\x00-\x20"<&>"\x80-\xff]/&\#@{[ord$&]}\;/g;

Pretty robust.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 544 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 5 Mar 1997 16:32:59 -0500
From: "Bradford T. Ritchie" <btr@iol.unh.edu>
Subject: Linux SOCK_PACKET sockets from w/i perl
Message-Id: <Pine.SUN.3.95.970305162209.24461E-100000@sun4.iol.unh.edu>


Hi,

Does anyone know if there is a way to use a SOCK_PACKET type socket from
within perl on a Linux system.  Under Linux, opening a socket like this:
	struct sockaddr sa;
	int sd = socket( AF_INET, SOCK_PACKET, ETH_P_ALL );
	sa.sa_family = AF_INET;
	strcpy( sa.sa_data, "eth0" );
	sendto( sd, buf, buf_len, 0, &sa, sizeof(sa));

gives you direct access to a network interface card allowing you to write
arbitrary frames to the network and/or sniff the network. 

This should work under perl except for the fact that perl only seems to
offer support of "struct sockaddr_in" and not a generic "struct sockaddr".
Has anyone addressed this issue?  If I were going to try and add support
for it myself, how would I go about it?  Specifically, which
documentation/man pages will get me started?

I've thought about the possibility of figuring out the hex
equivalent of "eth0" and trying to force those values into the
sockaddr_in, but since there's no way (to my knowledge) of setting the
sa_data field of the "struct sockaddr_in" from within perl, I would be
limited to 6 bytes (sin_port and sin_addr) for the interface name.

Any help or info would be appreciated.

Thanks!

-- Brad




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

Date: Wed, 05 Mar 1997 14:33:36 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: "Thomas A. Loser" <tloser@valdemar.microserve.com>
Subject: Re: mathematically correct?
Message-Id: <331DF4C0.4705@egames.com>

Thomas A. Loser wrote:
>   rand($.) < 1 && ($it = $_) while <>;
>   I'm no math genius but if I assume just 3 lines it appears that line
> 2 will replace line 1 once every other time (1 out of 2) and line 3
> will replace 1 *or* 2 every third time (1 out of 3) leaving line 1 as
> the selected line just 1 out of every six times. (1/2 + 1/3 = 5/6
> chance of line 1 being replaced). Is my logic faulty or does this
> routine heavily favor lines later in the file? I'm attracted to its
> simplicity but not if it's way skewed.

I believe your logic is faulty.  

line 1: 100% chance of being $it
line 2: 50% chance of being $it, so #1 has 50% chance (100-50).
line 3: 33% chance of becoming $it, so 67% (100-33) chance of
         line 1 or 2 being $it. each line has 1/3 chance of being $it.
line 4: 25% chance, 75% it's one of the first 3, each line has 25%
chance.
  etc...

Line 1 doesn't have (1/2 + 1/3) chance of being replaced, because
if it was replaced on the first pass, it has no chance of being 
replaced on the later pass(es). If you extended your calculation to 
the fourth line, the chance of it being replaced is (1/2 + 1/3 + 1/4)
which is greater than certainty and clearly not true if you actually
run the algorithm.

The calculation of its chance of being replaced looks more like:
   chance that it was already replaced earlier +
   (chance that the new line will be selected *
    chance that it hasn't been already replaced)
eg:
line 2: 1/2
line 3: 1/2 + (1/3 * (1-1/2)) = 1/2 + 1/6 = 4/6 = 2/3
line 4: 2/3 + (1/4 * (1-2/3)) = 2/3 + 1/12 = 9/12 = 3/4
line 5: 3/4 + (1/5 * (1-3/4)) = 3/4 + 1/20 = 16/20 = 4/5
 ...
just as you would want

--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks"  O-
    -- Sonia Orin Lyris




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

Date: 5 Mar 1997 21:33:11 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Need to Generate Web Pages from Excel!    HELP!
Message-Id: <5fkoqn$5b9@fridge-nf0.shore.net>

Jeffrey L. Fitzgerald (jlfitz@axsamer.org) wrote:

: 	I am new to perl and need to generate tv schedules from a tab 
: delimited database file. Does anyone have any perl scripts already done 
: that could do this? 

You might check out the examples that were included with the NTPerl
distribution... rather helpful.  I think the files are called excel1.pl
and excel2.pl.

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: 05 Mar 1997 19:51:32 GMT
From: earl@shadowfax.rchland.ibm.com (Joel Earl)
Subject: Re: Newbie question: perl, OS/2, and #!
Message-Id: <EARL.97Mar5135132@shadowfax.rchland.ibm.com>

In article <3317C460.23F5@trader.com> Webmaster <NPHS@trader.com> writes:

> Thanks to a "proprietary hardware" stipulation in an Internet connection 
> grant my school received, we now have an OS/2 server that I am 
> attempting to run perl on.  I keep gettin Error 500 Internal CGI-BIN 
> Error: execve() of c:/www/cgi-bin/test.cgi failed.  Error=37 messages 
> when I try to run a test script.  I believe that my #!perl line is 
> wrong, or that this doesn't work in OS/2 (like the similar problem in 
> DOS), but I've made numerous attempts to fix it, ending in my going bald 
> at the age of 17.  I've got the Perl 5.002 for OS/2 port by Raymond 
> Chen, Kai Uwe Rommel, and Andreas Kaieser in my c:\www\bin directory.  
> How should the #!perl line be set up (assuming that this works in OS/2)?  
> Also, what should I write scripts in?  Can I use just a plain text 
> editor (OS/2's system editor)?
> 
> Kyle Adams
> Webmaster, New Palestine High School
>

If you can't run UNIX, then OS/2 is actually a pretty nice platform for
perl. You'll preserve your remaining hair by switching to Ilya Zakharevich's
port at:

//www.perl.com/CPAN/modules/by-module/OS2/ILYAZ/os2/perl.500301.os2.bin.zip

#!perl doesn't work under OS/2. Instead, name the file whatever.cmd, so that
OS/2 thinks it's a batch file, and put this incantation on the first line:

extproc perl -x -s

You can use any editor, or even word processor as long as it doesn't stick
funny characters into the file. I like EPM better than the system
editor. Also, don't miss this news flash posted by Ilya about three weeks ago:

 If you did not install your pdksh's sh.exe in f:/bin, check that you
 have PERL_SH_DIR set in Config.sys, and it uses / (not \) - this is a
 bug in the automatic installer - it sets a meaningless PERL_SHPATH
 instead!

--
   Joel Earl, earl@vnet.ibm.com   <- going bald at 33
   Logic Analysis and Optimization
   IBM Rochester, Minnesota
   (507) 253-2304


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

Date: Wed, 05 Mar 1997 16:24:40 -0500
From: Aynang Yang <aynang@probe.att.com>
Subject: Re: passing hidden input from cgi to perl script
Message-Id: <331DE498.29C9@probe.att.com>

The way it didn't work was the fact that perl treats single quote
and double quote differently.

Try
	print "$today";
and
	print '$today';

to see the difference.

It has nothing to do with your HTML.

Aynang Yang
aynang@probe.att.com

John Cervini wrote:
> 
> I want to pass the date to a perl script.  I thought about doing it like
> this:
> (html cgi form)
> <input type="hidden" name="date" value="$today">
> 
> Of course I would declare the variable $today=`/bin/date +%m/%d/%Y`
> in the perl.  This does not work.  I get the literal "$today" as a
> result.
> What is the proper way to do this using the 'hidden' input.


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

Date: Wed, 05 Mar 1997 13:20:58 -0500
From: Kimberly Spence <kspence@pike.modes.tc.faa.gov>
Subject: PERL --> C translator?
Message-Id: <331DB98A.698B@pike.modes.tc.faa.gov>

Hi All,

I have a perl script that I want to
convert to C.  I have just downloaded
CPAN (although the directory created
was "B").  I am waiting for the PERL
on my system to be updated to 5.002.

In the meantime, does anyone have any
suggestions?

Thanks,

Kim Spence



-- 


***********************************************************************
           Spend your life for something that outlasts it.
***********************************************************************


This is my personal opinion and not that of my employer !!!


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

Date: Wed, 05 Mar 1997 21:09:32 +0000
From: pterm@karsh.demon.co.uk (Peter Mulderry)
Subject: Re: perl tcp server for mac to unix
Message-Id: <AF43918C966851C1B@karsh.demon.co.uk>

In article <331C7DC8.4A64@qmail.newbridge.com>,
Chris Eltervoog <christopher_eltervoog@qmail.newbridge.com> wrote:

> I am looking for a perl script or piece of software that can be used 
> in unix to trigger applications on a mac.  Does anyone have any ideas 
> about where I can find some information about this?

If you mean you want to open a TCP connection from a UNIX host onto a
Mac so that the incoming connection will activate a daemon application
on the Mac that then carries out some task, then yes, this can certainly
be done. 

You could use a perl or shell script to open the connection using
telnet. A simple Mac daemon could be built using AppleScript or
HyperCard and the various TCP XCMD/OSAX that are available.





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

Date: Wed, 05 Mar 1997 16:17:48 -0800
From: Todd Hoff <tmh@possibility.com>
Subject: Re: Perl timing questions:
Message-Id: <331E0D2C.7CF6@possibility.com>

Innuendo wrote:
> 
> Can anyone clue me in as to a way to time operations in perl witha
> granularity of less than 1 sec?
> 
> I'm writing some socket based code to send packets around the internet
> and i'd liek to be able to measure packet response time in milliseconds;
> however the time module only supports increments as fine as 1 second.
> 
> Is it neccessary to somehow use syome type of system event of interupt
> to count in milliseconds??
> 
> I'm at a loss here for the moment and i'd appreciate any pointers 

You need to use interval timers. Search on itimer in the
man page. Perl doesn't support them natively so you
have to add them in to perl.

---------------------------------------------------------------------
tmh@possibility.com        | I have no interest in any ship that does
http://www.possibility.com | not sail fast, for I plan to go in 
                           | harm's way. -- J.P. Jones


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

Date: Wed, 05 Mar 1997 14:42:12 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: James <hydrotmp@tcac.com>
Subject: Re: putting a text comment space
Message-Id: <331DF6C4.7F88@egames.com>

James wrote:
> How would I go about putting in a textarea for a comment section at the
> bottom of this form.  I would like it to have four or five lines
> available.
> I have tried but all has failed.
> This is my .html

The name of this newsgroup is comp.lang.perl.misc.
Which part of this name doesn't make sense to you?

Try: comp.infosystems.www.authoring.html
or:  comp.infosystems.www.authoring.cgi

--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks"  O-
    -- Sonia Orin Lyris



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

Date: Thu, 06 Mar 1997 00:41:25 GMT
From: ataide@planetarium.com.br (Efigenio Ataide)
Subject: Redirect compilation messages?
Message-Id: <331e11c8.750752@newsfeed.pnl.gov>

How do I redirect compilation messages to a file?

Thanks,
ataide@planetarium.com.br


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

Date: Wed, 5 Mar 1997 12:12:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jason Red <jreed@itis.com>
Subject: Re: Subroutine Source?
Message-Id: <Pine.GSO.3.95q.970305121132.3572S-100000@kelly.teleport.com>

On Tue, 4 Mar 1997, Jason Red wrote:

> Is there any way, in the middle a script, to see the perl code associated
> with a subroutine? (particularly if the sub was defined in the middle of
> an eval?)

As far as I know, Perl doesn't save the source once it's compiled it. Of
course, there's no reason you can't save it yourself before the eval. Hope
this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 5 Mar 1997 22:32:28 GMT
From: micke@cel95mhl.campus.mdh.se (Mikael Hallendal)
Subject: Using the print-command with colors
Message-Id: <5fks9s$g11@aragorn.mdh.se>

I got a little problem.
I want to use different colors in my output ..
how to do?

/Micke

-- 
-----------------------------------------------------------
E-mail                 : <cel95mhl@mds.mdh.se>
                       : <micke@cel95mhl.campus.mdh.se>
HomePage               : <http://mds.mdh.se/~cel95mhl>
PGP-Key available from : <http://www.mds.mdh.se/~cel95mhl>
                         or finger cel95mhl@legolas.mdh.se
-----------------------------------------------------------


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

Date: Wed, 5 Mar 1997 14:41:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dylan Northrup <northrup@chem.ufl.edu>
Subject: Re: Which one is the best (pattern matching)
Message-Id: <Pine.GSO.3.95q.970305144043.21785L-100000@kelly.teleport.com>

On 4 Mar 1997, Dylan Northrup wrote:

> alt.religion.perl anyone?

    bless $you;

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

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 58
************************************

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