[6432] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 57 Volume: 8

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

Date: Wed, 5 Mar 97 14:00:25 -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: 57

Today's topics:
     Re: @ interpolation in string context (Ken Williams)
     Basic $ENV questions (Eddie Babin)
     CGI Help (Chris Cannon)
     Embedding NT Perl in MFC application (Philip K Chung)
     error using system under NT (Paul S. Cutt)
     Re: error using system under NT (Nathan V. Patwardhan)
     Re: Exporter doesn't <tchrist@mox.perl.com>
     Re: Exporter doesn't (Brian L. Matthews)
     flock quandary (James L. McGill)
     Re: How can I use #! w/o knowing where perl lives? <rootbeer@teleport.com>
     Re: How to create 666 file from www perl cgi? (Brian L. Matthews)
     Re: Initializing array contents to all zeros <rootbeer@teleport.com>
     Re: Knowing the pid of a fork()'ed child, really (Brian L. Matthews)
     Re: Making sure 'perl -v' works (Craig Berry)
     Need to Generate Web Pages from Excel!    HELP! (Jeffrey L. Fitzgerald)
     Re: Passing more than one array (Brian L. Matthews)
     Perl -- compiled? C converter? (John Goerzen)
     Re: Perl 5.003, VI, and Toshiba T1000SE ("John Dallman")
     Re: Perl on NT 4.0 - HOW? <aynang@probe.att.com>
     Problem Calling Sendmail From Script (Rand Simberg)
     Re: QUESTION about multilpe filehandles (J.M. Davitt)
     Re: SERVE UP A FILE - What's wrong with my script? <wkuhn@uconect.net>
     Starting other processes (Lynn Wilson)
     Talking to a Fax or Printer <paulo@xilinx.com>
     Time and Date via Win95 Perl? (Jeff Dilcher)
     unprompted listen for <STDIN> snowbd@snowbd.com
     Re: URGENT! Please Help!  I don't wanna get fired! (Brian L. Matthews)
     Where can I find an AIX perl5 binary distribution? <simpson@august.com>
     Re: Where is FAQ? (John Stanley)
     Win32::ODBC INSERT INTO <Access Database> fails,? Read- <ceklof@vt.edu>
     Re: Windows95 (Bill)
     WWWBoard on NT? (Chris Cannon)
     Re: zerodivide errors <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 05 Mar 1997 16:13:34 -0500
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: @ interpolation in string context
Message-Id: <ken-0503971613340001@news.swarthmore.edu>

Thanks for responding to my post.  You and several other people have
helped me understand what the cause of the problem is.


In article <Pine.GSO.3.95q.970305115735.3572R-100000@kelly.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> 
> 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.
> 

I agree, it has helped me quite a bit several times.  My complaint is that
it's not a warning, it's a full-fledged compilation failure.  I mean, I
know Perl has to do some guessing about what's a literal and what's
supposed to be interpolated.  But in this case, it guessed wrong.  Why
must the complaint about "@ requires a backslash now" be so harsh, i.e why
does it have to abort compilation instead of just printing a warning
message?


-Ken Williams
 ken@forum.swarthmore.edu


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

Date: 5 Mar 1997 19:50:05 GMT
From: ebabin@cyberenet.net (Eddie Babin)
Subject: Basic $ENV questions
Message-Id: <5fkipd$6nc@news.cyberenet.net>


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.


#!/usr/bin/perl -w

$mainlog = "mydir";
$shortdate = `date +"%D %T %Z"`; 
chop ($shortdate);
print "Content-type: text/plain\n\n ";
open (MAINLOG, ">>$mainlog");
print MAINLOG "Time: $shortdate\n";
print MAINLOG "User: $ENV{'REMOTE_IDENT'}\n";
print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n";
print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n";
print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n";
print MAINLOG "Page: $ENV{'DOCUMENT_URI'}\n";
print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n";
close (MAINLOG);
exit;

-- 


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

Date: 5 Mar 1997 14:13:37 -0500
From: dome@ziplink.net (Chris Cannon)
Subject: CGI Help
Message-Id: <5fkgl1$frv$1@zip1.ziplink.net>

I am trying to run Perl scripts on out Windows NT4.0 server running Microsoft IIS3.0.  If I place
them in the scripts directory and try to run them on the local machine it works run, but if I try to
run them from my ISP it asks for a username/password.  The File and direcories have Full Control set
for Everyone.  Why is it asking for this?

Any help would be appreciated.

Chris
dome@ziplink.net


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

Date: Wed, 05 Mar 97 21:40:26 GMT
From: pchung@newscorp.com (Philip K Chung)
Subject: Embedding NT Perl in MFC application
Message-Id: <5fkp21$uel$1@klein.nis.newscorp.com>
Keywords: Perl NT embedding MFC

using the implementation of the PERL.EXE (in perlexe.cpp/.h) as a sample, i 
have attempted to "embed" the NT Perl DLL into a small MFC application.  i 
have managed to get some of my simple sample scripts to run okay, but i get 
huge memory leaks when the application shuts down (at least that is what VC++ 
is telling me).  i am using the exact same code that is contained in the 
"perlexe.cpp/.h", but for some reason the CPerlExe::PerlDestroy() method does 
not seem to clean up memory properly.

the only difference i can see here is that the original PERL.EXE is a Win32 
console application as opposed to my sample application being a Windows 
program.  so maybe there is some weirdness going on with different memory 
allocation/deallocation functions.  but i am only guessing...

just wondering if anyone else out there has managed to successfully "embed" 
calls to the NT Perl DLL in a Windows application.  if so, can you please give 
me a shout?  thanks.

phil chung
pchung@newscorp.com


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

Date: Wed, 5 Mar 1997 19:48:52 GMT
From: cutt@netcom.com (Paul S. Cutt)
Subject: error using system under NT
Message-Id: <cuttE6L5pG.B3C@netcom.com>

When I use the system command under NT say system "dir xxx";
the print messages returned give me an error under a web page. Is the a perl
command I can give to avoid this ?

paul


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

Date: 5 Mar 1997 21:30:47 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: error using system under NT
Message-Id: <5fkom7$5b9@fridge-nf0.shore.net>

Paul S. Cutt (cutt@netcom.com) wrote:
: When I use the system command under NT say system "dir xxx";
: the print messages returned give me an error under a web page. Is the a perl
: command I can give to avoid this ?

Yes.  opendir().  :-)

$basedir = 'C:\\';
opendir(DIR, "$basedir") || print("Dir error: $!");
@entries = sort(readdir(DIR));
closedir(DIR);

foreach $entry (@entries) {

   print("Entry: $entry\n");

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


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

Date: 5 Mar 1997 18:21:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Exporter doesn't
Message-Id: <5fkdii$rc4$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    cos@zax.whoville.leftbank.com (Ofer Inbar) writes:
:This is perl, version 5.003 with EMBED
:        built under sunos at Nov 12 1996 11:07:30
:        + suidperl security patch
:
:I've got a perl script that looks sort of like this:

Sort of isn't going to cut it.  We need to see real code.

:#!/usr/bin/perl
:
:use MyModule 0.01;
:
:print "script: $variable\n";
:print "script qualified: $MyModule:variable\n";
:exit;
:----------------------------------------------------------------------
:
:And then I've got MyModule which looks sort of like this:
:package MyModule;
:require Exporter;
:
:@ISA = (Exporter);
:@EXPORT = (variable);
:@EXPORT_OK = (variable);

oops.  Don't you mean 

    @EXPORT = qw( $variable );


:$VERSION = '0.01';
:
:BEGIN { $variable = "goodvalue" }
:
:print "module: $variable\n";
:# runscript
:module: goodvalue
:script:
:script qualified: goodvalue

:So, what happened to the goodvalue of $variable in package main?  Am I
:misunderstanding how Exporter is supposed to work?  This looks just
:like the examples in the Camel.  

Note quite just like, methinks.

:I've tried taking out the EXPORT_OK
:definition, I've tried naming variable directly on the "use" line...

Here's a convenient template you might wish you use when starting
your own module.  Make sure to change the names appropriately.

    package Some::Module;  # assumes Some/Module.pm

    use strict;

    BEGIN { 
	use Exporter   ();
	use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

	# set the version for version checking
	$VERSION     = 1.00;  
	# if using RCS/CVS, this may be preferred
	$VERSION = (qw$Revision: 1.00 $)[1];

	@ISA         = qw(Exporter);
	@EXPORT      = qw(&func1 &func2 &func4);
	%EXPORT_TAGS = ( );  	# eg: TAG => [ qw!name1 name2! ],

	# your exported package globals go here,
	# as well as any optionally exported functions
	@EXPORT_OK   = qw($Var1 %Hashit &func3);
    }
    use vars      @EXPORT_OK;

    # non-exported package globals go here
    use vars      qw( @more $stuff );

    # initalize package globals, first exported ones
    $Var1   = '';
    %Hashit = ();

    # then the others (which are still accessible as $Some::Module::stuff)
    $stuff  = ''
    @more   = ();

    # all file-scoped lexicals must be created before
    # the functions below that use them.
    
    # file-private lexicals go here
    my $priv_var    = '';
    my %secret_hash = ();

    # here's a file-private function as a closure, 
    # callable as &$priv_func;  it cannot be prototyped.
    my $priv_func = sub { 
        # stuff goes here.
    };

    # make all your functions, whether exported or not;
    # remember to put something interesting in the {} stubs
    sub func1      {}	 # no prototype
    sub func2()    {}	 # proto'd void
    sub func3($$)  {}	 # proto'd to 2 scalars
    
    # this one isn't exported, but could be called!
    sub func4(\%)  {}    # proto'd to 1 hash ref

    END { }       # module clean-up code here (global destructor)



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

Eighty percent of air pollution comes from plants and trees.
                --Ronald Reagan, famous movie star


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

Date: 5 Mar 1997 10:24:10 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Exporter doesn't
Message-Id: <5fkdoa$f1i$1@halcyon.com>

In article <5fivts$kt4@zax.whoville.leftbank.com>,
Ofer Inbar <cos@zax.whoville.leftbank.com> wrote:
|I've got a perl script that looks sort of like this:

There are a number of problems with these scripts, although you
wouldn't get the output you get with the problems, so I suspect you
typed in the scripts instead of just reading in the ones you run.

|#!/usr/bin/perl

#!/usr/bin/perl -w

|use MyModule 0.01;

use MyModule;

|print "script: $variable\n";
|print "script qualified: $MyModule:variable\n";

print "script qualified: $MyModule::variable\n";

|exit;

Unnecessary.

|And then I've got MyModule which looks sort of like this:
|package MyModule;
|require Exporter;

use Exporter;

|@ISA = (Exporter);
|@EXPORT = (variable);

@EXPORT = qw($variable);

|@EXPORT_OK = (variable);

Unnecessary.

|$VERSION = '0.01';
|
|BEGIN { $variable = "goodvalue" }

This is already at compile time if the script is used.

|print "module: $variable\n";

Anyway, the crux of your problem is the @EXPORT = (variable) line.
Your module could want to export $variable, @variable, %variable,
*variable, or &variable, so you have to use the proper special
character to let Exporter know which to export. Without any special
character, it exports a subroutine by default. Then you have to
quote name of the thing you want to export, because you want to
(usually, and certainly in this case) export the variable, not its
value.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: 5 Mar 1997 06:49:47 -0600
From: fishbowl@fotd.netcomi.com (James L. McGill)
Subject: flock quandary
Message-Id: <5fjq5b$183@fotd.netcomi.com>

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!

What shall I do.

--
g-r-a-t-e-f-u-l-l-y---[   email:<fishbowl@conservatory.com>   ]---l-i-v-i-n-g
d-e-a-d-i-c-a-t-e-d---[ http://www.conservatory.com/~fishbowl ]-----l-i-g-h-t
The man who raises a fist has run out of ideas.  
		-- H.G. Wells, "Time After Time"


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

Date: Wed, 5 Mar 1997 11:32:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Paul H. Hargrove" <hargrove@sccm.Stanford.EDU>
Subject: Re: How can I use #! w/o knowing where perl lives?
Message-Id: <Pine.GSO.3.95q.970305113059.3572N-100000@kelly.teleport.com>

On Mon, 3 Mar 1997, Paul H. Hargrove wrote:

> Subject: How can I use #! w/o knowing where perl lives?

The sysadmin should, if needed, set up a symlink from /usr/bin/perl to the
real perl binary. In a perfect world, that is. :-) 

-- 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 10:09:22 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: How to create 666 file from www perl cgi?
Message-Id: <5fkcsi$eag$1@halcyon.com>

In article <5fidsl$1p8$1@news3.microserve.net>,
Geoffrey Hebert <soccer@microserve.net> wrote:
|I want to create a file with a perl cgi script that is initiated from
|the web. [...] Seems as though security is stopping me.

Yes, and no one in this group can help you get around the security
set up by your system administrator. I suggest you talk to your
sysadmin and tell him or her what you want to do, and find out how
your web server is configured.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: Wed, 5 Mar 1997 11:44:27 -0800
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Initializing array contents to all zeros
Message-Id: <Pine.GSO.3.95q.970305114121.3572O-100000@kelly.teleport.com>

On 4 Mar 1997 really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email wrote:

> I need to create a lot of arrays and initialize their elements to zero.

> I kept thinking that surely there would be a slicker way of doing this,
> but I can't come up with one.  Any suggestions?

Why not something like this?

    @new_array = (0) x $number_of_elements;

> Please note that my email address is mangled in the header.

Yes, and if you hadn't made it so hard to do so, I'd be sending a courtesy
copy of this by e-mail. 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 10:31:57 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Knowing the pid of a fork()'ed child, really
Message-Id: <5fke6t$fb8$1@halcyon.com>

In article <331D8DCB.43E7@fnal.gov>, Elliott McCrory  <mccrory@fnal.gov> wrote:
|How can I deal with this so that the parent process really knows what
|the pid of the process is that I need?  I have a workaround now that
|when "fork()+1" is not found, it tries "fork()+2", but is still fails if
|the pid goes to "fork()+3".

Yikes. I hope you don't run your script on a busy system.

First, reexamine why you need the pid of the bottom process. The pid
of the shell may be enough in some cases. If you do find you need the
pid of the bottom process, do the redirections yourself and avoid the
shell altogether. For example, instead of:

exec ('prog 2>file');

do

open (STDERR, ">file");
exec ('prog');

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: 5 Mar 1997 19:50:36 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Making sure 'perl -v' works
Message-Id: <5fkiqc$rnq$3@marina.cinenet.net>

Bill (bill@sover.net.no.junkmail) wrote:
:    Look for a binary called "perl5".  I've seen ISP's that encourage the 
: use of Perl 4 but also have Perl 5 available for those that really want it.

Just out of curiosity, what benefit would an ISP gain through doing 
this?  In other words, why encourage use of a 'backlevel', unsupported 
version of Perl?  Presumably they have some good reason.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 5 Mar 1997 15:41:46 -0500
From: jlfitz@axsamer.org (Jeffrey L. Fitzgerald)
Subject: Need to Generate Web Pages from Excel!    HELP!
Message-Id: <MPG.d87a489a3047426989685@news.bawave.com>

	
	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? 

	Anyhelp is welcome. PLease email me directly.



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

Date: 5 Mar 1997 10:05:43 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Passing more than one array
Message-Id: <5fkcln$e3s$1@halcyon.com>

In article <Pine.SOL.3.95.970304142005.12741A-100000@colibri.hq.rnp.br>,
Antonio Paulo Salgado Forster  <forster@hq.rnp.br> wrote:
|I need to pass more than one array to a subroutine, but I'm not sure about
|the best way to do it...

There are three ways:

1. As you've discovered, you can pass the size of the array first:
|&sub ($#array1, $#array2, @array1, @array2);
(although for purely stylistic reasons, I'd do:
&sub ($#array1, @array1, $#array2, @array2);

2. You can pass type globs:
&mysub (*array1, *array2)
sub
mysub
{
    local (*a1, *a2) = @_;
    ...
@a1 and @array1 are now identical, so anything you do to @a1 also
happens to @array1 (and @a2 and @array2).

3. Pass references:
&mysub (\@array1, \@array2)
sub
mysub
{
    local ($a1, $a2) = @_;
    ...
You can now reference elements of @array1 using the $a1->[0] syntax,
similarly for @array2.

If you're using perl5 (and you really should be), 3 is the way to go.
Read perlref for more information on references. If you're using perl4
and the arrays are small, 1 is the way to go, otherwise 2.

If you want to return multiple arrays, you have the same choices.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: Tue, 4 Mar 1997 16:50:56 -0600
From: jgoerzen@happy.cs.twsu.edu (John Goerzen)
Subject: Perl -- compiled? C converter?
Message-Id: <slrn5home9.j38.jgoerzen@happy.cs.twsu.edu>

Hello,

On page XII of the preface in Wall's "camel book" (Programming Perl, 2nd
ed.), he mentions that "[Perl] passes off the intermediate code to the
interpreter to execute (or optionally to any of several modular back ends
that can emit C or bytecode.)"

I am not sure what this "bytecode" is (is it executable?)

In any case, I am very interested in the C code.  I checked the PERL FAQ at
www.perl.com and it stated that there was no way to make C code from Perl.
Yet Wall's book seems to indicate that just that thing is possible.  I would
obviously tend to believe the book over the FAQ :-)

So...where can I find this sort of thing?

Thanks!

John Goerzen

(making the transition from C to Perl....)


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

Date: Wed, 5 Mar 1997 20:07:20 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Perl 5.003, VI, and Toshiba T1000SE
Message-Id: <E6L6K8.LCK@cix.compulink.co.uk>

"Jack L. Owens" <jlowens@ptconnect.infi.net> wrote:

> Someone gave me a Toshiba T1000SE along with all of the manuals and
> documentation. I have been able to avoid laptops to this point but FREE
> is FREE. Admittedly, this is a very limited machine, but should be
> suitable for taking along on short two or three day trips. Does anyone
> one know what and where compact DOS 3.30 programs for PERL or VI might
> be obtained? 

That's an 8086 machine with 64K0b, isn't it? I don't think that there is 
a Perl 5 that will run on a 16-bit-only machine, and creating one might 
not be possible. There are Perl 4 versions in CPAN that will run on it, 
but the best one - BigPerl - won't. Of course, if you have a 386+ and at 
least 4Mb, things get easier.

You might find a vi for it though - I'm not much on vi, but try searching 
for 'elvis', a vi-alike for DOS.

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: Wed, 05 Mar 1997 16:47:11 -0500
From: Aynang Yang <aynang@probe.att.com>
Subject: Re: Perl on NT 4.0 - HOW?
Message-Id: <331DE9DF.7D8B@probe.att.com>

I had the same problem. I just got an email from Ravi Pina (Thanks!!)
( falcon@webmrkt.com ) who pointed me to

http://www.microsoft.com/kb/articles/q150/6/29.htm

and that solved the problem.

Aynang Yang
aynang@probe.att.com

Jim wrote:
> 
> I have just loaded perl 5 on my NT server.  I seems as if I can run perl
> scripts from the dos prompt, but I cannot run them from the web browser.
> Does anyone have any insight on how to get perl working properly on NT 4.
> 
> Thank You,
> 
> Jim@pbs1.com


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

Date: Wed, 05 Mar 1997 20:18:08 GMT
From: simberg@interglobal.org (Rand Simberg)
Subject: Problem Calling Sendmail From Script
Message-Id: <331dd34a.71664398@nntp.ix.netcom.com>

I'm not sure if this is a Perl or a server problem, but when I try to
execute the following line, the script dies.

open(MAIL,"|/usr/sbin/sendmail -t") || die "Can't open sendmail";

I've tried running a similar script from the command line as "nobody",
and it runs OK, but when I try it with a CGI script it crashes.  Any
ideas?

************************************************************************
simberg@interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1391 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."


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

Date: 5 Mar 1997 18:06:43 GMT
From: jdavitt@ripco.com (J.M. Davitt)
Subject: Re: QUESTION about multilpe filehandles
Message-Id: <5fkcnj$f7h$1@gail.ripco.com>

Tad McClellan (tadmc@flash.net) wrote:
: admin www(-intern)/proxy/news (WWWAdmin@amc.uva.nl) wrote:

: : Does anyone know how to open an INPUT and OUTPUT filehandle/pipe at the

: If you grepped for 'pipe' in the fine Perl FAQ, then _you_ would know
: how to do this (and you would also know that you probably do not
: _really_ want to do this...)

: 5.14) How do I open a pipe both to and from a command?
:     In general, this is a dangerous move because you can find yourself in a
:     deadlock situation.  It's better to put one end of the pipe to a file.
: : same time to the same application?

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

Tad, presuming that you don't want to read and write on the same
pipe  -- that is, you ment to say "open an INPUT and open an
OUTPUT filehandle/pipe" -- there most certainly are occasions
when one would want to do this.  It's done all the time on unix
platforms.  Typically one does a pipe to get a pair of fds, a
fork for a new process, a couple of dups to associate input and
output with the fds returned by the call to pipe, and an exec to
replace the new process with the image of the command with which
you want to communicate.

There are perl analogs for each of these steps.  And it is a
different situation than perl's OPEN where the filename can
contain a pipe.  Don't you really wish you could do something
like `OPEN COMMAND, "| command |"; ?'

Before going any further: are you running unix?  Or do we have to
consider a different se of tools?


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

Date: Wed, 05 Mar 1997 13:24:09 -0500
From: Bill Kuhn <wkuhn@uconect.net>
To: stevek@unidial.com
Subject: Re: SERVE UP A FILE - What's wrong with my script?
Message-Id: <331DBA49.107F58A4@uconect.net>

This newsgroup is for perl questions in general, not CGI questions in
particular.  You'll generally get more help by posting to the
appropriate newsgroup.

As for your problem, you might try sending the content-length header to
ensure that the server sends the correct number of bytes.

$content_length = (stat($filename))[7] ;
print "Content-length: $content_length\n" ;

-Bill
-- 
Bill Kuhn
Chief Developer
Wired Markets, Inc.
http://www.buyersindex.com


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

Date: 5 Mar 1997 20:34:33 GMT
From: lynn@swcp.com (Lynn Wilson)
Subject: Starting other processes
Message-Id: <5fklcp$29e@sloth.swcp.com>

I have a system where my perl program starts up a large number
of other processes that DO NOT terminate.  In other words these
other processes persist forever or until killed by a shutdown
script.

My problems is how to launch these processes without hanging or
forking many copies of my perl script.

If I use  $result = system( "$taskpath $arglist &" );
It all works but a 'ps' indicates that I've forked (as expected).
8724 p4 S     0:00 /usr/local/bin/perl5 -w ./em043 -i prod

I've got dozens of these processes and would like to avoid the fork.

If I use  $result = `$taskroot $arglist &`;  it never returns which
I find to be odd.

All of the examples in both camel books deal with processes that terminate.

Do any of you know how to launch non-terminating processes without
forking dozens of copies of myself?  Shell scripts seem to know how
to do this....

Thanks.

Lynn@swcp.com




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

Date: Tue, 04 Mar 1997 22:49:26 -0800
From: Paulo Dutra <paulo@xilinx.com>
Subject: Talking to a Fax or Printer
Message-Id: <331D1776.5919@xilinx.com>

Are there any modules to facilitate talking to a Fax or Printer
that are located on Unix system?
-- 
/ 7\'7 Paulo Dutra (paulo@xilinx.com)
\ \ `  Xilinx                              hotline@xilinx.com
/ /    2100 Logic Drive                    (800) 255-7778
\_\/.\ San Jose, California 95124-3450 USA (408) 879-6797


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

Date: Wed, 05 Mar 1997 19:12:08 GMT
From: dilcher@mindspring.com (Jeff Dilcher)
Subject: Time and Date via Win95 Perl?
Message-Id: <331ec503.9084663@news.mindspring.com>

On Unix, I used to get date and time information by calls to the
system:

$time1 = `TZ=EST5EDT;export TZ;/bin/date '+%A %B %d, %Y.'`;
$time2 = `TZ=EST5EDT;export TZ;/bin/date '+%H:%M %p EST.'`;

However, with my Perl now running on a Windows box, I am unsure
how to easily acquire the date and time.  Seems like it should be
simple, but I am stumped.

Anyone give me a clue?
Thanks!

Jeff Dilcher



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

Date: 5 Mar 1997 17:50:38 GMT
From: snowbd@snowbd.com
Subject: unprompted listen for <STDIN>
Message-Id: <5fkbpe$cui$1@news.electrotex.com>


 I need to break out of a subroutine in which I do not prompt for input. 
Basically, I need something to work like

sub foo
{
until (<STDIN>) 
{
BLAH;
BLAH;
do a lot of stuff w/out asking for input;
}
}
 
but this still waits for input because of the reference to STDIN.

Thanx,
Nathan Morris


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

Date: 5 Mar 1997 10:26:35 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: URGENT! Please Help!  I don't wanna get fired!
Message-Id: <5fkdsr$f61$1@halcyon.com>

In article <331D817D.2B06@unidial.com>, Steve Karr  <stevek@unidial.com> wrote:
|SOLUTION: to be able to click on a file and have a browser pop up
|dialog to save it locally (no matter the file type) for the user to
|download it with out having to right click save as.

This can be done by configuring your server correctly. Read the docs
on your server, and if you still can't do it, ask in one of the
comp.infosystems.www.servers.* newsgroups.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: Wed, 05 Mar 1997 11:28:21 -0600
From: Dennis Simpson <simpson@august.com>
Subject: Where can I find an AIX perl5 binary distribution?
Message-Id: <331DAD35.7915@august.com>

Thanks.


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

Date: 5 Mar 1997 20:24:31 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Where is FAQ?
Message-Id: <5fkkpv$aci@news.orst.edu>

In article <5fikqf$3h0$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, 
>    stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>:On a related note, the last time I saw the Meta-FAQ come through the
>:group was July 6, 1995. I can't find a copy using either altavista or
>:dejanews. 
>
>Gnat's provided that twice weekly, I believe.

I am referring to Neil Bower's Meta-FAQ, which is a simple listing of
where to get the FAQ and Perl itself, along with books and the reference
guide. 

Gnat's mini-FAQ is nice, but it is also web-specific. If you don't have
web access, it won't help you get Perl. The people I am trying to
keep the information for apparently don't have regular USENET access, so
assuming they do have Web access is a bit optimistic.

If, however, it is the official replacement for the Meta-FAQ, I will
include it in the archive and mailserver here.



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

Date: Wed, 05 Mar 1997 01:13:13 -0400
From: Carl <ceklof@vt.edu>
Subject: Win32::ODBC INSERT INTO <Access Database> fails,? Read-Only?
Message-Id: <331D00E9.475C@vt.edu>

I have an M$ Access database that I have been having a good time
querying through the Win32::ODBC library, quite successfully.

It now comes time to append records to the table. Has ANYONE been
successful in doing this?

I doing the following SQL statement:
<code>
INSERT INTO [MyTable] ( [Date Listed], [Last Name], [First name] )
SELECT '15-Jan-1997', "Eklof", "Carl";
</code>
I have also tried:
<code>
INSERT INTO [MyTable] ( [Date Listed], [Last Name], [First name] )
VALUES ('15-Jan-1997', "Eklof", "Carl")';
</code>

I have typed these statements into an Access Query and they worked! So,
these lines should be free of typoes, such as [First name] vs. [First
Name]. Now, I need them to work from my perl script.

Is there something special that I should be doing because I am modifying
the table? I am using the same open routines that I used to issue the
query SQL statment. I only changed the statement to be an INSERT
operation.

Any Ideas?

Any help would be GREATLY appreciated!

Thanks in advance,

-Carl


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

Date: 5 Mar 1997 16:51:22 GMT
From: bill@sover.net.no.junkmail (Bill)
Subject: Re: Windows95
Message-Id: <slrn5hr94a.h91.bill@granite.sover.net>

In article <5f2g6d$sak@neocad.xilinx.com>, Jeff Stampes wrote:
>
>there is no perl for DOS...
>

   Actually I've had good luck with Laszlo Molnar's djgpp port, even 
though it is an alpha.  It can be found at

   ftp://ftp.delorie.com/pub/djgpp/alpha as p5003*.zip

   The only two things I've noticed so far is that perl -v doesn't seem 
to work on my system, and that the DynaLoader stuff doesn't work as of 
yet.  Other than that it's been great being able to whip out a quick Perl 
script in Dos rather than having to revert to Perl 4 to do anything.

						Bill
-- 
Sending me unsolicited email through mass emailing about a product or
service your company sells ensures that I will never buy or recommend your
product or service.



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

Date: 5 Mar 1997 14:15:01 -0500
From: dome@ziplink.net (Chris Cannon)
Subject: WWWBoard on NT?
Message-Id: <5fkgnl$qah$1@zip1.ziplink.net>

Has anyone got WWWboard2.0 to run on windows nt4.0? if so could you tell me how to do it or send me
a copy of the script? 

Thanks,
Chris Cannon
UMass Lowell - CyberEd    
http://cybered.uml.edu



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

Date: Wed, 5 Mar 1997 11:48:18 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: mackey@cse.ucsc.edu
Subject: Re: zerodivide errors
Message-Id: <Pine.GSO.3.95q.970305114715.3572P-100000@kelly.teleport.com>

On 4 Mar 1997 mackey@cse.ucsc.edu wrote:

> Is there any way of making Perl follow the standard IEEE-754
> rules and generate NaN on zerodivide for 0/0 and +-Infinity
> when a finite number is divided by zero?

You might be able to use Overload on '/' to accomplish that. Good luck!

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

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