[12608] in Perl-Users-Digest
Perl-Users Digest, Issue: 18 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 2 21:00:01 1999
Date: Fri, 2 Jul 1999 17:58:23 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 2 Jul 1999 Volume: 9 Number: 18
Today's topics:
What's wring with "$varA =~ s/<BR>/\n/g;" <daniel.vesma@thewebtree.com>
Re: What's wring with "$varA =~ s/<BR>/\n/g;" (Andreas Fehr)
Re: What's wring with "$varA =~ s/<BR>/\n/g;" <daniel.vesma@thewebtree.com>
where to find Perl.dll <osman@focomedia.de>
Re: where to find Perl.dll <jdsv@hotmailSpAmSuX.com>
Why use perl .. .... tell me please!! bodhyfryd@my-deja.com
Re: Why use perl .. .... tell me please!! (elephant)
Re: Why use perl .. .... tell me please!! <robert@corpus.nl>
Re: Why use perl .. .... tell me please!! <elaine@cts.wustl.edu>
Re: Win32::API <gellyfish@gellyfish.com>
Re: Writing to a terminal from a perl script dougd@shieldsbag.com
Re: Writing to a terminal from a perl script <tchrist@mox.perl.com>
Re: Writing to a terminal from a perl script (Ken Pizzini)
WTB: server-side file viewer <bshair@itds.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 2 Jul 1999 09:59:12 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: What's wring with "$varA =~ s/<BR>/\n/g;"
Message-Id: <7lhv5m$fv2$1@gxsn.com>
I have a variable $varA that is in that contains a line of HTML. I am trying
to send it to a textarea, by printing out...
<P>Text:<BR><TEXTAREA NAME="text" ROWS="15" COLS="50">$varA</TEXTAREA>
To do this I need to replace <BR> tags with line breaks. The code I am
trying to use is
$varA =~ s/<BR>/\n/g;
It doesn't seam to work. It just deletes everything after the first tag
(<P>).
An example of the value of $varA would be
<P><BR>Addition <BR><BR>test.
That after the script has run should read...
Addition
test.
Any ideas?
Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma
------------------------------
Date: Fri, 02 Jul 1999 09:29:48 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: What's wring with "$varA =~ s/<BR>/\n/g;"
Message-Id: <377c863b.14906334@news.uniplus.ch>
On Fri, 2 Jul 1999 09:59:12 +0100, "Daniel Vesma"
<daniel.vesma@thewebtree.com> wrote:
>I have a variable $varA that is in that contains a line of HTML. I am trying
>to send it to a textarea, by printing out...
>
><P>Text:<BR><TEXTAREA NAME="text" ROWS="15" COLS="50">$varA</TEXTAREA>
>
>To do this I need to replace <BR> tags with line breaks. The code I am
>trying to use is
>
>$varA =~ s/<BR>/\n/g;
>
>It doesn't seam to work. It just deletes everything after the first tag
>(<P>).
>
>An example of the value of $varA would be
>
><P><BR>Addition <BR><BR>test.
>
>That after the script has run should read...
>
>
>Addition
>
>test.
>
>Any ideas?
>
this works for me...
my $bla = "<P><BR>Addition <BR><BR>test.";
$bla =~ s/<BR>/\n/g;
print "$bla\n";
prints:
<P>
Addition
test.
Andreas
------------------------------
Date: Fri, 2 Jul 1999 10:41:21 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: What's wring with "$varA =~ s/<BR>/\n/g;"
Message-Id: <7li1fr$ida$1@gxsn.com>
Thanks. I got it working.
Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma
------------------------------
Date: Fri, 2 Jul 1999 19:23:46 +0200
From: "osman durrani" <osman@focomedia.de>
Subject: where to find Perl.dll
Message-Id: <377cf291.0@news.arcor-ip.de>
Hi people,
I tried to run a perl script which uses the Win32 GUI package. The System
said that it couldnt find Perl.dll does any one know where i could download
the mention dll.
Thanx in advance
------------------------------
Date: Fri, 2 Jul 1999 11:16:28 -0600
From: "Jeremy" <jdsv@hotmailSpAmSuX.com>
Subject: Re: where to find Perl.dll
Message-Id: <jv6f3.941$Jl1.190973@news.uswest.net>
I could send you the file but I doubt that would do any good as there
are probably other files you are missing. It should have come with your perl
distribution. If it didn't, get another distribution and save yourself
future missing files. http://www.activestate.com/ActivePerl/
-Jeremy
osman durrani <osman@focomedia.de> wrote in message
news:377cf291.0@news.arcor-ip.de...
> Hi people,
> I tried to run a perl script which uses the Win32 GUI package. The System
> said that it couldnt find Perl.dll does any one know where i could
download
> the mention dll.
>
> Thanx in advance
>
>
------------------------------
Date: Fri, 02 Jul 1999 10:30:42 GMT
From: bodhyfryd@my-deja.com
Subject: Why use perl .. .... tell me please!!
Message-Id: <7li4cj$8eq$1@nnrp1.deja.com>
My ramblings that follow Im sure express the thoughts of all newcomers
to web programming, especially if they come from a programming
background.
My background is one of, for a few yesrs scientfic programming (C,C++,
Java), and very recently I've been involved in the microsoft way of
doing things (ATL COM, ISAPI, XML using IE5's MSXML.DLL on the server
side) . But in my own time Im getting to grips with dedicated web based
programming because its fun etc, and I wan't to make a freelance living
from it (dont we all!). I figure that as Im just starting, I should
jump into the new and latest technologies that are emerging as this
will broaden my opportunities so to speak.
But the research into the new technologies and the many differnet ways
to implement them is beginning to drive me nuts and Im worried about
deciding to go down the wrong path and becoming marketably competent in
the wrong thing. Although I can appreciate that to be successful you'd
probably have to be skillfull in the differnet technologies so that you
can use the one which most efficiently meets the customers
requirements.
I keep looking at the perl option because:
1) of the platform independance.
2) the abundance of robust, free stuff available, particulary for unix
based servers
3) most web sites are hosted by a third party, thus its better to be
equiped to make use of unix/linux based servers (ie use perl)
The following are the questions going round in my head, they're
probably all variations apon the same theme, but Ill write them all
down anyway (as a therapeutic exercise if nothing else). I may even
have answered them myself above, but i just want someone else to tell
me that:
1) Is it a good idea to become competent in perl, cgi, mysql
programming first etc then to branch out into asp etc.
2) Do a lot of bigger than small! sites still, and will for a long time
to come, still use cgi rather than an API approach.
3)are these bigger than small sites happy to use perl, or are they
adopting microsofts way of doing things e.g. ASP or something else. I
just want to be able to make a reasonable living!!
3) It seems to me that perl is the hard way to to it. I ask this
because Im determined to make life as easy as possible after years of
doing the hard stuff, although the programmer in me does keep rearing
its ugly head and wanting to write things from scratch or hack to death
the avilable free stuff!
4) If you go for asp eveything is nice and simple, and XML/XLS is
simple to adopt, so why should i go for perl, why make life more
difficult? The only answer for this that I have is that there just
isn't enough support out there for ASP, unless your dealing with an on
site fully customizable server.
I think Ive said enough, and i feel a lot better now, better out than
in as they say! Any thoughts, suggestions and words of wisdom may help
ease my aching brain and enable me to see the light. And more
importantly get me to stop messing about and to concentrate on a
particular approach ad be happy and confident with it.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 2 Jul 1999 21:26:29 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Why use perl .. .... tell me please!!
Message-Id: <MPG.11e74ce8d729f7cc989ad7@news-server>
bodhyfryd@my-deja.com writes ..
>1) Is it a good idea to become competent in perl, cgi, mysql
>programming first etc then to branch out into asp etc.
ASP is a technology - not a language .. you can plug whatever scripting
engine you like into the ASP interface .. it comes with vbscript and
j(ava)script engines builtin .. but there are already REXX and perlscript
engines .. and probably python (and who knows what else) as well
ie. you can write ASP pages on a Microsoft IIS server using perlscript
re: mysql .. it'll take you 5 minutes reading a man page to work it out
.. very simple
re: cgi .. in perl there's a CGI module which enables similar access to
the cgi environment as you get in Microsoft's ASP object hierarchy ..
again - 5 minutes reading to use it .. to use raw cgi in perl is also a
trivial matter
>2) Do a lot of bigger than small! sites still, and will for a long time
>to come, still use cgi rather than an API approach.
not sure what you mean by "API approach" .. but probably to answer your
question .. there's a fairly healthy (or unhealthy - depending on your
biases) mix of perl and ASP and a whole bunch of others in both the small
and big web marketplace
>3)are these bigger than small sites happy to use perl, or are they
>adopting microsofts way of doing things e.g. ASP or something else. I
>just want to be able to make a reasonable living!!
you seem to think that ASP is faster (or more robust - snicker snicker)
than perl .. learning perl will put you in good stead to earn a living in
the web world .. learning ASP would be a lower priority IMHO .. but I
don't really like ASP (anymore *8^) because of it's mixing of programming
logic with data
>3) It seems to me that perl is the hard way to to it. I ask this
>because Im determined to make life as easy as possible after years of
>doing the hard stuff, although the programmer in me does keep rearing
>its ugly head and wanting to write things from scratch or hack to death
>the avilable free stuff!
with a C background perl will be a piece of piss .. whether you use it in
a standard CGI environment or through ASP .. the same can not be said of
vbscript .. and javascript in ASP can also be frustrating (although
certainly not 'as') for someone looking for a real language
go get some O'Reilly books .. they're a dream
>4) If you go for asp eveything is nice and simple, and XML/XLS is
>simple to adopt, so why should i go for perl, why make life more
>difficult? The only answer for this that I have is that there just
>isn't enough support out there for ASP, unless your dealing with an on
>site fully customizable server.
horses for courses .. some clients want ASP pages to be used because (a)
they love Microsoft and want to be their live-in lover and (b) they think
that ASP == vbscript (which it does by default) which means that they can
leverage off the hordes of VB (so called) programmers that they employed
when it was trendy
to those ex-clients I say .. well .. I don't say anything to ex-clients -
so we'll leave it there
so .. what are you really making a comparison between ? .. if the client
requests ASP .. they usually are also (often unbeknownst to them)
requesting vbscript .. compared to perl ? .. well the main difference
(especially for a C programmer) is that you will not feel compelled to
bathe several times a day
perl is also a lot more fun .. a lot more powerful .. a lot more flexible
.. a lot more modular .. has a lot more freely available code .. the list
is really endless
if .. on the other hand you want a comparison between the ASP way of
doing things (in-page scripting all mixed up with the HTML) and the
standard CGI way of doing things (call a script that can do pretty much
whatever it wants) then I'd definitely vote for the latter .. it's neater
.. safer .. easier to debug .. maintain .. enhance .. modularise ..
encapsulate .. <insert other compelling buzz word here>
how about this ? .. try them both out .. and pick which one you like the
best .. I DARE you to start with vbscript *B^)
--
jason - remove all hyphens for email reply -
------------------------------
Date: Sat, 03 Jul 1999 01:27:49 +0200
From: Robert de Geus <robert@corpus.nl>
Subject: Re: Why use perl .. .... tell me please!!
Message-Id: <377D4AF4.EC16F9F0@corpus.nl>
I am develloping on both platforms. Needless to say, I am amazed by the third
party tools you can get with perl, just lying arround, and they even work, in
fact, it is beyond believe.
If I devellop on NT, it is in my opinion not the ASP which gives the benefit,
perl might even be better (and faster), but, the COM technology. You can
start almost any COM object from an ASP, this means you have your prefered
(Visual) devellopment tool available, and, your database devellopment tools.
For me, though liking the job, Perl is like a step back in time, just having
learned event based programming versus interrupt/threading, and clicking COM
objects together, I had to admit, I have started to like it. Even if you want
to go further, you can link your objects directly with the webserver.
The main reason for using perl on unix, is... the costs, they are much lower
though, server maintenance for a unix is less, you are much better able to
put up your separate "niche", service providers calculate higher cost for
hosting database and web servers on NT systems, NT servers tend to get
problems if you load a lot of different program types/systems.
Robert de Geus
Amsterdam
elephant wrote:
> bodhyfryd@my-deja.com writes ..
> >1) Is it a good idea to become competent in perl, cgi, mysql
> >programming first etc then to branch out into asp etc.
>
> ASP is a technology - not a language .. you can plug whatever scripting
> engine you like into the ASP interface .. it comes with vbscript and
> j(ava)script engines builtin .. but there are already REXX and perlscript
> engines .. and probably python (and who knows what else) as well
>
> ie. you can write ASP pages on a Microsoft IIS server using perlscript
>
> re: mysql .. it'll take you 5 minutes reading a man page to work it out
> .. very simple
>
> re: cgi .. in perl there's a CGI module which enables similar access to
> the cgi environment as you get in Microsoft's ASP object hierarchy ..
> again - 5 minutes reading to use it .. to use raw cgi in perl is also a
> trivial matter
>
> >2) Do a lot of bigger than small! sites still, and will for a long time
> >to come, still use cgi rather than an API approach.
>
> not sure what you mean by "API approach" .. but probably to answer your
> question .. there's a fairly healthy (or unhealthy - depending on your
> biases) mix of perl and ASP and a whole bunch of others in both the small
> and big web marketplace
>
> >3)are these bigger than small sites happy to use perl, or are they
> >adopting microsofts way of doing things e.g. ASP or something else. I
> >just want to be able to make a reasonable living!!
>
> you seem to think that ASP is faster (or more robust - snicker snicker)
> than perl .. learning perl will put you in good stead to earn a living in
> the web world .. learning ASP would be a lower priority IMHO .. but I
> don't really like ASP (anymore *8^) because of it's mixing of programming
> logic with data
>
> >3) It seems to me that perl is the hard way to to it. I ask this
> >because Im determined to make life as easy as possible after years of
> >doing the hard stuff, although the programmer in me does keep rearing
> >its ugly head and wanting to write things from scratch or hack to death
> >the avilable free stuff!
>
> with a C background perl will be a piece of piss .. whether you use it in
> a standard CGI environment or through ASP .. the same can not be said of
> vbscript .. and javascript in ASP can also be frustrating (although
> certainly not 'as') for someone looking for a real language
>
> go get some O'Reilly books .. they're a dream
>
> >4) If you go for asp eveything is nice and simple, and XML/XLS is
> >simple to adopt, so why should i go for perl, why make life more
> >difficult? The only answer for this that I have is that there just
> >isn't enough support out there for ASP, unless your dealing with an on
> >site fully customizable server.
>
> horses for courses .. some clients want ASP pages to be used because (a)
> they love Microsoft and want to be their live-in lover and (b) they think
> that ASP == vbscript (which it does by default) which means that they can
> leverage off the hordes of VB (so called) programmers that they employed
> when it was trendy
>
> to those ex-clients I say .. well .. I don't say anything to ex-clients -
> so we'll leave it there
>
> so .. what are you really making a comparison between ? .. if the client
> requests ASP .. they usually are also (often unbeknownst to them)
> requesting vbscript .. compared to perl ? .. well the main difference
> (especially for a C programmer) is that you will not feel compelled to
> bathe several times a day
>
> perl is also a lot more fun .. a lot more powerful .. a lot more flexible
> .. a lot more modular .. has a lot more freely available code .. the list
> is really endless
>
> if .. on the other hand you want a comparison between the ASP way of
> doing things (in-page scripting all mixed up with the HTML) and the
> standard CGI way of doing things (call a script that can do pretty much
> whatever it wants) then I'd definitely vote for the latter .. it's neater
> .. safer .. easier to debug .. maintain .. enhance .. modularise ..
> encapsulate .. <insert other compelling buzz word here>
>
> how about this ? .. try them both out .. and pick which one you like the
> best .. I DARE you to start with vbscript *B^)
>
> --
> jason - remove all hyphens for email reply -
------------------------------
Date: Fri, 02 Jul 1999 18:52:42 -0500
From: Elaine -HappyFunBall- Ashton <elaine@cts.wustl.edu>
To: bodhyfryd@my-deja.com
Subject: Re: Why use perl .. .... tell me please!!
Message-Id: <377D50C8.6E934458@cts.wustl.edu>
bodhyfryd@my-deja.com wrote:
[...]
> I keep looking at the perl option because:
>
> 1) of the platform independance.
This is not to be underestimated.
> 2) the abundance of robust, free stuff available, particulary for unix
> based servers
don't forget CPAN and all the modules, scripts, etc. Also, better
documentation than any commercial software I've ever seen...well, almost.
> 3) most web sites are hosted by a third party, thus its better to be
> equiped to make use of unix/linux based servers (ie use perl)
Perl is not limited to the Unix boxes of the world and you can run it on
almost anything. The nice thing about Perl is that you don't have to
worry about different clients on every machine. e.g. If you run
storyserver 3.2 on one box and 3.1 on the other, what kinds of problems
are you going to make for yourself? Perl changes, but generally doesn't
hose your code and it doesn't add multiple layers of complexity to the system.
[...]
> 1) Is it a good idea to become competent in perl, cgi, mysql
> programming first etc then to branch out into asp etc.
Depends on what you are doing and if you like Perl. Start with what you
like first.
> 2) Do a lot of bigger than small! sites still, and will for a long time
> to come, still use cgi rather than an API approach.
API approach? Was ist?
> 3)are these bigger than small sites happy to use perl, or are they
> adopting microsofts way of doing things e.g. ASP or something else. I
> just want to be able to make a reasonable living!!
Every site is different and even the biggest clients make dumb choices.
Do what you like, do it well, make cool stuff, people will follow.
> 3) It seems to me that perl is the hard way to to it. I ask this
> because Im determined to make life as easy as possible after years of
> doing the hard stuff, although the programmer in me does keep rearing
> its ugly head and wanting to write things from scratch or hack to death
> the avilable free stuff!
Hmmm. Nothing is free, least of all knowledge. Perl isn't the hard way,
it is the smart way.
> 4) If you go for asp eveything is nice and simple, and XML/XLS is
> simple to adopt, so why should i go for perl, why make life more
> difficult? The only answer for this that I have is that there just
> isn't enough support out there for ASP, unless your dealing with an on
> site fully customizable server.
Why should you go Perl? Because long after ASP, Chilisoft, StoryServer,
etc. are long since abandoned because they are found to be inadequate or
just plain awful, WE WILL STILL BE HERE. Perl isn't going anywhere, but
crappy software is and we shall dine on them with chianti and fava
beans. They just don't know it yet :)
e.
------------------------------
Date: 2 Jul 1999 17:56:21 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win32::API
Message-Id: <7liug5$1do$1@gellyfish.btinternet.com>
On Mon, 28 Jun 1999 17:52:39 -0700 Tim & Barbara Aldrich wrote:
> I have noticed that the Eventlog has a FORMAT_MESSAGE_FROM_STRING. is there
> any way to call this from Win32::API ??
Isnt there a Win32::Eventlog module ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 02 Jul 1999 21:58:21 GMT
From: dougd@shieldsbag.com
Subject: Re: Writing to a terminal from a perl script
Message-Id: <7ljclo$nr2$1@nnrp1.deja.com>
In article
<Pine.BSF.4.05.9906231451060.13773-100000@lister.acm.wwu.edu>,
Shane Fisher <fishers@lister.acm.wwu.edu> wrote:
> Greets,
>
> I am trying to figure out how to write to my terminal from a perl
script
> invoked by another process. For example, a biff-like "new mail"
notice
> when procmail pipes a message to a perl script. I understand that
> whenever procmail executes a script, it invokes it with the same
> environment as the intended recipient. So, I'm wondering if there is
an
> environment variable that the perl script can use to "find" the
terminal
> to write to.
>
> Is this more of a "sockets" question, or interprocess communication?
I've
> read through the docs on termio and termcap, but I don't think those
are
> what I need to accomplish this.
>
> Any help would be greatly appreciated.
>
> Regards,
> Shane
>
>
========================================================================
=
> Shane M. Fisher
> CS Major, Western Washington University
> E-Mail: fishers@acm.wwu.edu, smfisher@gte.net
> Web: http://www.acm.wwu.edu/fishers
>
========================================================================
=
>
>
Shane,
I see you are down the road from me in WA. I too am looking for an
answer to this delema. My application needs a way to 'redirect' all of
the standard i/o to a socket connected to a telnet port server (serial
port device) and then exec to a c program on the server. I affect, I
want the telnet device to be running my character base program, but I
have no device in the '/dev' directory, this is a socket connection. I
have read the code for doing handle redirecting, but I am confused with
using socket, since they use send and recv function call., or can I use
fhopen to get the file descriptor to somehow redirect that? Basically,
after I get throught the 'accept' function showing I'm connected to the
telnet box, I want to redirect, STDIN, STDOUT, STDERR to this handel and
then exec of to my c program. Any help would be greatly appreciated.
Thanks.
--
Doug Dahlke
I.S. Department
Shields Bag & Printing
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 2 Jul 1999 17:20:40 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Writing to a terminal from a perl script
Message-Id: <377d4948@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, dougd@shieldsbag.com writes:
|Basically, after I get throught the 'accept' function showing I'm
|connected to the telnet box, I want to redirect, STDIN, STDOUT, STDERR
|to this handel and then exec of to my c program.
[Answer given in Perl because that's were I read this]
[C answer should be able to be inferred]
socket(Rendevous, ...); # set up server on this socket, then...
$SIG{CHLD} = 'IGNORE'; # if your system autoreaps zombies
$SIG{CHLD} = sub { wait }; # else more generically
while (accept(Client, Rendezvous)) {
if ($pid = fork) {
close Client;
next;
}
die "can't fork: $!" unless defined $pid;
close Rendezvous;
open(STDIN, "<&Client"); # maybe prefer <=&Client
open(STDOUT, ">&Client"); # maybe prefer >=&Client
open(STDERR, ">&Client"); # maybe prefer logfile?
exec($cmdname, @args); # it's an execlp, actually
# log error somewhere on failure, plus make sure to exit...
die "can't exec $cmdname: $!";
}
--
"Debugging is anticipated with distaste, performed with reluctance, and bragged
about forever."
--button at the Boston Computer Museum
------------------------------
Date: 3 Jul 1999 00:18:36 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: Writing to a terminal from a perl script
Message-Id: <slrn7nqjvg.dhu.ken@pulsar.halcyon.com>
On Fri, 02 Jul 1999 21:58:21 GMT, <dougd@shieldsbag.com> wrote:
>In article
><Pine.BSF.4.05.9906231451060.13773-100000@lister.acm.wwu.edu>,
> Shane Fisher <fishers@lister.acm.wwu.edu> wrote:
>> I am trying to figure out how to write to my terminal from a perl script
>> invoked by another process. For example, a biff-like "new mail" notice
>> when procmail pipes a message to a perl script. I understand that
>> whenever procmail executes a script, it invokes it with the same
>> environment as the intended recipient. So, I'm wondering if there is an
>> environment variable that the perl script can use to "find" the terminal
>> to write to.
>>
>> Is this more of a "sockets" question, or interprocess communication?
[I didn't see the original posting of this question, so I'll
offer an answer here...]
For this situation (procmail invoks perl which then notifies user)
you will want to either:
* invoke write(1), and let it do the work of finding the user
* parse the utmp file, search for any instance of the user
being logged in, extract the corresponding tty(s) from the
utmp record(s), and use those as the target(s) of your opens.
> My application needs a way to 'redirect' all of
>the standard i/o to a socket connected to a telnet port server (serial
>port device) and then exec to a c program on the server.
...
> Basically,
>after I get throught the 'accept' function showing I'm connected to the
>telnet box, I want to redirect, STDIN, STDOUT, STDERR to this handel and
>then exec of to my c program. Any help would be greatly appreciated.
In your C program, before the exec call, do:
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
if (fd!=STDIN_FILENO && fd!=STDOUT_FILENO && fd!=STDERR_FILENO)
close(fd);
(N.B.: the STD*_FILENO symbols above come from the <unistd.h>
header file. If you don't have that, or have some other objection
to these symbolic versions, you can almost certainly use the
traditional 0,1,2 for IN,OUT,ERR (respectively).)
--Ken Pizzini
------------------------------
Date: Fri, 02 Jul 1999 17:30:12 GMT
From: Bob Shair <bshair@itds.com>
Subject: WTB: server-side file viewer
Message-Id: <7lisuj$hjm$1@nnrp1.deja.com>
We're looking for a server-side file viewer like this:
* Runs from a web server on HP-UX,
* Displays the contents of large files (currently <2GB)
to users running web browsers on PC's,
* Only transfers a limited number of pages initially,
then allows the user to:
Scroll forward and backward,
Search for text,
cancel a search in progress,
* Interprets a reasonable subset of HP PCL2 formatting,
* Can view files while they're still being written.
We'd prefer to buy a commercial product, but will use
net freeware or will commission someone to program it.
--
Bob Shair
ITDS Intelicom
Champaign, Illinois
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 V9 Issue 18
************************************