[6559] in Perl-Users-Digest
Perl-Users Digest, Issue: 183 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 26 15:37:12 1997
Date: Wed, 26 Mar 97 12:00:34 -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, 26 Mar 1997 Volume: 8 Number: 183
Today's topics:
Can a contained class instance identify its container? <gtk@walsh2.med.harvard.edu>
cant get sdbm_fil to work under win95 <zephyr@wesell.com>
Component scripting (was: ANNOUNCE: OpTcl v1.0b2) (Cameron Laird)
DES implementation (Peter Cox)
Re: Directory Listing in Perl <rootbeer@teleport.com>
Re: Document Contains No Data (Jan Schipmolder)
does exist something better than c2ph or equivalent <francois@sequent.com>
Re: flow control prob??? <rootbeer@teleport.com>
Re: Fork & Memory Allocation Question <rootbeer@teleport.com>
Re: Forward- and Backslashes as Pathname Delimiters rtanikella@rfbd.org
Re: Free web-server (Simon Hyde (aka Jeckyll))
getting year from localtime <amak@ernie.eecs.uic.edu>
Re: getting year from localtime (Jason Lane)
Re: global my() variable used in foreach() loop loses i <rootbeer@teleport.com>
Re: global my() variable used in foreach() loop loses i (Simon Hyde (aka Jeckyll))
Has anyone heard the rumour that Microsoft have bought <jont@uunet.pipex.com>
Re: Has anyone heard the rumour that Microsoft have bou <seay@absyss.fr>
Help with pipe (Yip Hoi Man)
Re: Help with pipe (Tad McClellan)
Re: Help with pipe <sveerara@cisco.com>
Re: How do I delete a line out of a text file <mcampbel@tvmaster.turner.com>
Re: How to display tag-like text in HTML (was PARADOX) (Simon Hyde (aka Jeckyll))
Re: Is there not a market for a fancy debugger? <wkuhn@uconect.net>
Re: Little beginers question (Tad McClellan)
Look for Example (Mark E. Klamerus)
Making Script Execute? mwebster@burke.com
MD5/LWP <zaheed.haque@ein.ericsson.se>
Re: Netscape Navigator 3.x (Simon Hyde (aka Jeckyll))
Re: passing <body bgcolor... in a script?? (Jan Schipmolder)
Re: print "Content type: text/html\n\n"; <rootbeer@teleport.com>
Re: printing associative arrays in order <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Mar 1997 11:17:06 -0500
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: Can a contained class instance identify its container?
Message-Id: <w2wwqu1vct.fsf@walsh2.med.harvard.edu>
I have a container class (a tied hash), containing some objects.
When I change the contents of a contained object by calling a member
object method, I'd like to be able to mark the container as "Dirty".
The only way I can think of doing this is to put a reference to the
container in the contained object, (probably during its constructor).
This seems wasteful of memory. Is there More Than One Way To Do
It?
Thanks,
Greg
--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro" Finger for PGP info
------------------------------
Date: 25 Mar 1997 22:55:27 GMT
From: "john z." <zephyr@wesell.com>
Subject: cant get sdbm_fil to work under win95
Message-Id: <01bc3965$b4a4a360$0ad4b7cc@pciii>
im trying to use sdbm_file on a perl5/ win95 platform. i used the perl
binaries to install
first thing i noticed was that several of the library files are shortened
to fat16. this is
apparently having quite an effect.
ive edited the dynaload.pm and sdbm_fil (the extra characters are dropped
by fat 16
on win95) as best as i could to shorten dynaloader.* and autoloader.*
right now i get an error: cant call method "bootstrap" in empty paackage ..
line 7.
has anyone gotten this to work with a fat16? if so- how.
tks.
john z.
zephyr@wesell.com
------------------------------
Date: 26 Mar 1997 09:17:10 -0600
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Component scripting (was: ANNOUNCE: OpTcl v1.0b2)
Message-Id: <5hbelm$qrp@Starbase.NeoSoft.COM>
This is about component scripting, in the Microsoftian sense.
I'm surprised there's been no reaction in c.l.p.m--at least
none that I can find--to Jon Udell's provocative
Udell, Jon
1997 "Perl's Future", Byte, volume
22, number 4, pages 121-124
(April 1997)
The first point to make is that this is *outstanding* writing;
that is, the prose is serviceable, but it's a cogent explora-
tion of very important (in a nerd-ish sense) and very "live"
topics. Mr. Udell is sufficiently well-informed, imaginative,
*and* disciplined enough that this his piece makes it into the
category of "visionary" for me.
I'll summarize its content briefly, then add a few comments.
My short summary is this: read it yourself. It's worth your
time. Mr. Udell asks and answers the big questions for any tech-
nology--what are its features?, what problems does it solve?,
and what is its future?--with particular attention to posi-
tioning Perl in a world that will be dominated by communication
between distributed "components". He gives most attention to
COM, but mentions that similar considerations apply for CORBA.
He's one of the first in the relatively-mass-market press to
make the point that JavaScript and VBScript do *not* cover the
space they inhabit; there's plenty of room for PerlScript
<http://www.activeware.com> and presumably others (more on
that, below).
This article presents a profound challenge to The Keepers of
Perl and the Perl community at large. It's going to take hard
and occasionally thankless work, but there's the possibility
that we'll still be able to use well-designed- and/or free-ware
even as Microsoft extends the body count of its hegemony.
"Thanks to ActiveX Scripting, Win32 is becoming an equal-op-
portunity environment for embedded script engines."
I know I sound hostile to Microsoft. That's more habit than
anything. My true position is simply that it's *good* when a
thousand flowers bloom, including such ingenious and blossom-
ing hacks as Perl. I'll leave to another time judgment on
Microsoft's net effect in this dimension.
Mr. Udell wrote succinctly, and didn't mention any realistic
possibility beyond {Java,VB,Perl}Script. There are such, though,
and some merit attention. For example, in article
<5h6ubd$pc@non.non.net>, Farzad Pezeshkpour
<f.pezeshkpour@uea.ac.uk> announced:
.
.
.
>OpTcl is a (free:) loadable module for Tcl/Tk that
>enables dynamic binding to such components. Currently,
>the implementation is Windows/OLE based, but I hope to
>provide ports for JavaBeans and if enough people are
>interested, OpenDoc.
>
>OpTcl can create instances of components, discover
>their members and script to them. The syntax is
.
.
.
>The current version of OpTcl (v1.0b2) only controls
>applications (for example, enabling full control of MS
>Excel and InternetExplorer). The final version (due May 97)
>will incorporate several more features including:
.
.
.
Mr. Pezeshkpour's announcement (<URL:http://www.sys.uea.ac.uk
/~fuzz/OpTcl.html>, and also <URL:http://www.xpi.com/tcl/
comp.lang.tcl.announce/0297.html>) includes quite a bit more
context which harmonizes very well with Mr. Udell's article.
I recommend reading them both, together--and, even more
importantly, *using* PerlScript and OpTcl.
A few comments on references: there's apparently some
volatility to HTTP service at East Anglia. If you have
difficulty reaching the URLs there, do let Mr. Pezeskpour
know. Also, Mr. Udell's article will presumably have a
public URL once the May issue of *Byte* appears.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 713 623 8000 #227
+1 713 996 8546 FAX
------------------------------
Date: 26 Mar 1997 17:57:58 GMT
From: pcox@unix2.megsinet.net (Peter Cox)
Subject: DES implementation
Message-Id: <slrn5jiota.f0k.pcox@unix2.megsinet.net>
Hey there;
I'm looking for an implementation of DES in perl5. I need to send
encrypted messages between a client and server process using sockets.
Any pointers would be appreciated.
Cheers,
Peter Cox
------------------------------
Date: Wed, 26 Mar 1997 07:09:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Sriranga R. Veeraraghavan" <sveerara@cisco.com>
Subject: Re: Directory Listing in Perl
Message-Id: <Pine.GSO.3.96.970326070755.5139F-100000@kelly.teleport.com>
On 25 Mar 1997, Sriranga R. Veeraraghavan wrote:
> for($a=0;$a<=$#files;$a++){print "$files[$a]\n";}
Maybe you meant this? :-)
for (@files) { print "$_\n" }
-- 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: 26 Mar 1997 17:36:16 GMT
From: schip@lmsc.lockheed.com (Jan Schipmolder)
Subject: Re: Document Contains No Data
Message-Id: <5hbmqg$gk2@dns.lmms.lmco.com>
Rich (scrich@cris.com) wrote:
: When a script returns a "Document Contains No Data" message, it's
: because the script did not either redirect or print html code. In
Please please pretty please for heaven's sake keep html and www
and cgi stuff out of comp.lang.perl.misc. Go to the right group
for that stuff.
--
--
jan.b.schipmolder@lmco.com
------------------------------
Date: Wed, 26 Mar 1997 16:35:31 +0100
From: francois <francois@sequent.com>
Subject: does exist something better than c2ph or equivalent
Message-Id: <33394243.6204@sequent.com>
c2ph digests a C structure and through a set of perl functions and
arrays allowed to access it.
But you must have gcc or a BSD compiler to obtain the best result and
it is a little bit painfull.
Does exist something more friendly and easiest to use (with any
compiler) ?
------------------------------
Date: Wed, 26 Mar 1997 07:16:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Claudia Ma <maclaudi@cps.msu.edu>
Subject: Re: flow control prob???
Message-Id: <Pine.GSO.3.96.970326071254.5139G-100000@kelly.teleport.com>
On 25 Mar 1997, Claudia Ma wrote:
> $err1 = (Cond1);
> $err2 = (Cond2);
> $err3 = (Cond3);
I assume that by 'Cond1' and company you mean some Boolean condition.
Right?
> if ($err1 || $err2 || $err3) {
> &err_msg;
> }
> No matter what change I made in Cond1/Cond2/Cond3, the script always
> gave me &err_msg. I printed $err2/$err2/$err3, and found that they
> worked fine, either "1" or "".
What about $err1? :-)
> Can someone tell me: In this case, $err1 is a string or not? And why my
> code didn't work?
It doesn't matter if $err1 is a string or not. You'll get &err_msg if any
one of those three variables is true to Perl. They're not true if they are
undef, empty string, 0, or '0'; anything else is true.
If you set all three of those to false values, you won't get &err_msg.
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: Wed, 26 Mar 1997 07:07:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Simon Twigger <simont@post.its.mcw.edu>
Subject: Re: Fork & Memory Allocation Question
Message-Id: <Pine.GSO.3.96.970326065905.5139E-100000@kelly.teleport.com>
On Tue, 25 Mar 1997, Simon Twigger wrote:
> I have a Perl 5 CGI script which creates a sound file from scratch.
> This all works fine, however, it creats rather large files (4Mb) and asI
> dont want these on my server for ever, I fork the script and have the
> child process sleep for 10mins before unlinking the files.
So, if five of us get your script to create sounds for us now, you'll have
five sleeping processes sitting around uselessly for the next ten minutes?
That's not good...
How about this method: Make a simple cron task which deletes any of these
sound files which haven't been accessed for at least ten minutes. Run it
as often as needed, but probably once per hour is plenty.
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: Wed, 26 Mar 1997 09:41:57 -0600
From: rtanikella@rfbd.org
Subject: Re: Forward- and Backslashes as Pathname Delimiters
Message-Id: <859387571.12607@dejanews.com>
On Tue, 25 Mar 1997 Tom Phoenix (rootbeer@teleport.com) wrote:
> Not for those strings, they aren't. Those are the same even if you put
> them in double quotes. (Although I have to assume that you meant to put
> one before arg2.)
Oops, I should've been clearer. I meant to say the arguments I
mentioned in my original post required single quotes, because they
contained both forward-slashes as switch delimiters and backslashes as
path delimiters.
Sorry if I confused anyone.
Reg
------------------------------------------------
Rajanikanth Tanikella Internet: rtanikella@rfbd.org
E-Text Programmer WWW: http://www.rfbd.org
Recording For the Blind and Dyslexic Phone: 609/520.8006
20 Roszel Rd Fax:609/520.7990
Princeton NJ 08540 </sig>
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 26 Mar 1997 19:05:19 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Free web-server
Message-Id: <333f51c1.4022912@news.brad.ac.uk>
On 26 Mar 1997 12:43:29 GMT, oaf@vingmed.no (Ole Asbjorn Fadum) wrote:
>
>--
>
>As a long term perl user on UNIX, I've started the move toward
>Windows. I'm very pleased that perl is available on the PC, and
>I've a project where I'm going to make some CGI programming on
>the PC.
>
>I would like to have a tip of free available web server, which
>run Windows95, and easily could interface to perl CGI.
>
>Any suggestion??
>
I've found fnord (http://shampoo.res.wpi.edu/fnord) to be pretty good.
You might want to try OmniHTTPD
(http://www.fas.harvard.edu/~glau/httpd/) although IMHO this isn't as
good as fnord yet.
---
Yours Sincerely,
,
() o /| | |
/\ _ _ _ __ _ _ |___| __| _
/ \| / |/ |/ | / \_/ |/ | | |\| | / | |/
/(__/|_/ | | |_/\__/ | |_/ | |/ \_/|/\_/|_/|__/
/|
\|
(Simon Hyde)
------------------------------
Date: Wed, 26 Mar 1997 10:30:12 -0600
From: Alex Mak <amak@ernie.eecs.uic.edu>
Subject: getting year from localtime
Message-Id: <Pine.SUN.3.95.970326102713.10017A-100000@ernie.eecs.uic.edu>
Hi folks,
I am interested in getting the year in localtime.
I know I can get the weekday.
$thisday =(Sun,Mon,Tue, Wed, Thu, fri, Sat)[(localtime)[6]];
print $thisday;
from the camel book, p.185
I want to be get the year number from the current datetime.
Any ideas?
Thanks,
Alex Mak
------------------------------
Date: 26 Mar 1997 12:15:54 -0500
From: jlane@pathfinder.com (Jason Lane)
Subject: Re: getting year from localtime
Message-Id: <5hblka$gjf@bilbo.dev.pathfinder.com>
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
note that $year is the number of years since 1900 and $mon and $wday are 0
based.
Hope this helps.
In article <Pine.SUN.3.95.970326102713.10017A-100000@ernie.eecs.uic.edu>,
Alex Mak <amak@ernie.eecs.uic.edu> wrote:
>Hi folks,
>
>I am interested in getting the year in localtime.
>
>I know I can get the weekday.
>
>$thisday =(Sun,Mon,Tue, Wed, Thu, fri, Sat)[(localtime)[6]];
>print $thisday;
>
>from the camel book, p.185
>
>I want to be get the year number from the current datetime.
>Any ideas?
>
>Thanks,
>
>Alex Mak
>
--
--
Jason J. Lane jlane@pathfinder.com
Lead Application Developer 212-522-9613
Time Inc. New Media http://www.pathfinder.com
------------------------------
Date: Wed, 26 Mar 1997 09:35:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Scott Wimer <scottw@earthlink.net>
Subject: Re: global my() variable used in foreach() loop loses its value
Message-Id: <Pine.GSO.3.96.970326093208.5139W-100000@kelly.teleport.com>
On Wed, 26 Mar 1997, Scott Wimer wrote:
> my() variables are not visible to subroutines called from inside the
> block they are in.
Unless, of course, the subroutine is declared within the scope of the my
variable, something like this.
my $foo;
sub bar { print "I can see $foo from here.\n" }
$foo = 'you'; &bar;
(I know, you meant that a my variable is not visible outside of its
scope.) Cheers!
-- 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: Wed, 26 Mar 1997 19:05:18 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: global my() variable used in foreach() loop loses its value
Message-Id: <333a4692.1159734@news.brad.ac.uk>
On 26 Mar 1997 00:23:20 -0500, rnewman@shell1.cybercom.net (Ron
Newman) wrote:
>In article <5h9tst$crr$1@halcyon.com>,
>Brian L. Matthews <blm@halcyon.com> wrote:
>>In article <5h9idg$9o0@shell1.cybercom.net>,
>>Ron Newman <rnewman@shell1.cybercom.net> wrote:
>>|I am using a global variable, declared my() at the top level, as
>>|the loop control variable in a "foreach" loop.
>>|Instead of getting the expected value of the variable, it instead
>>|finds the variable to be empty. Can anyone explain this?
>>
>>Heavy sigh.
>>
>>Yes, I can explain it, as can the perl manual pages, as can any perl
>>book worth reading, as can the FAQ, as can DejaNews (this has only
>>been discussed what, 7 or 8 times in the past month?).
>
>I don't see this discussed in any of these places. Can you
>provide a more specific reference?
even heavier sigh.
The following is copied from the perlsyn manpage:
" If the variable is preceded with the keyword my,
then it is lexically scoped, and is therefore visible only within the
loop. Otherwise, the variable is implicitly local to the loop and
regains its former value upon exiting
the loop. If the variable was previously declared with my, it uses
that variable instead of the global one, but it's still localized to
the loop. (Note that a lexically scoped
variable can cause problems with you have subroutine or format
declarations.) "
---
Yours Sincerely,
,
() o /| | |
/\ _ _ _ __ _ _ |___| __| _
/ \| / |/ |/ | / \_/ |/ | | |\| | / | |/
/(__/|_/ | | |_/\__/ | |_/ | |/ \_/|/\_/|_/|__/
/|
\|
(Simon Hyde)
------------------------------
Date: 26 Mar 1997 16:35:30 GMT
From: "Jonathan Tracey" <jont@uunet.pipex.com>
Subject: Has anyone heard the rumour that Microsoft have bought Perl?
Message-Id: <01bc3a03$d955c100$0600000a@salmon>
I have it on good authority that Microsoft have aquired the rights to
future versions of Perl. If so how long before we get Visual Perl?
Any thoughts.
Jon..................
------------------------------
Date: Thu, 27 Mar 1997 02:44:13 +0000
From: Douglas Seay <seay@absyss.fr>
To: Jonathan Tracey <jont@uunet.pipex.com>
Subject: Re: Has anyone heard the rumour that Microsoft have bought Perl?
Message-Id: <3339DEFD.FA7@absyss.fr>
Jonathan Tracey wrote:
>
> I have it on good authority that Microsoft have aquired the rights to
> future versions of Perl. If so how long before we get Visual Perl?
> Any thoughts.
>
> Jon..................
Troll.
And not even a good one.
------------------------------
Date: 26 Mar 1997 14:49:54 GMT
From: hmyip@cs.ust.hk (Yip Hoi Man)
Subject: Help with pipe
Message-Id: <5hbd2i$9ip@ustsu10.ust.hk>
I would like to create a filehandle pipe the data to a unix process and, at
the same time, pipe the output of the process back to the Perl program.
So I tried the following statements
open(S, "| unixcommand |");
print S "something";
$a = <S>;
But it doesn't produce what I expect. Any suggestion?
Thanks a lot.
--
Johnny
------------------------------
Date: Wed, 26 Mar 1997 10:17:40 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help with pipe
Message-Id: <47ibh5.h32.ln@localhost>
Yip Hoi Man (hmyip@cs.ust.hk) wrote:
: I would like to create a filehandle pipe the data to a unix process and, at
: the same time, pipe the output of the process back to the Perl program.
: So I tried the following statements
: open(S, "| unixcommand |");
: print S "something";
: $a = <S>;
: But it doesn't produce what I expect.
^^^^^^^^^^^^^
You neglected to mention what it was that you _did_ expect...
: Any suggestion?
^^^^^^^^^^^^^^
I would suggest reading the new Perl FAQ (part 8):
------------------------------------------------------------
=head2 How can I open a pipe both to and from a command?
The IPC::Open2 module (part of the standard perl distribution) is an
easy-to-use approach that internally uses pipe(), fork(), and exec()
to do the job. Make sure you read the deadlock warnings in its
documentation, though (see L<IPC::Open2>).
=head2 How can I capture STDERR from an external command?
There are three basic ways of running external commands:
system $cmd; # using system()
$output = `$cmd`; # using backticks (``)
open (PIPE, "cmd |"); # using open()
With system(), both STDOUT and STDERR will go the same place as the
script's versions of these, unless the command redirects them.
Backticks and open() read B<only> the STDOUT of your command.
With any of these, you can change file descriptors before the call:
open(STDOUT, ">logfile");
system("ls");
or you can use Bourne shell file-descriptor redirection:
$output = `$cmd 2>some_file`;
open (PIPE, "cmd 2>some_file |");
You can also use file-descriptor redirection to make STDERR a
duplicate of STDOUT:
$output = `$cmd 2>&1`;
open (PIPE, "cmd 2>&1 |");
Note that you I<cannot> simply open STDERR to be a dup of STDOUT
in your Perl program and avoid calling the shell to do the redirection.
This doesn't work:
open(STDERR, ">&STDOUT");
$alloutput = `cmd args`; # stderr still escapes
This fails because the open() makes STDERR go to where STDOUT was
going at the time of the open(). The backticks then make STDOUT go to
a string, but don't change STDERR (which still goes to the old
STDOUT).
Note that you I<must> use Bourne shell (sh(1)) redirection syntax in
backticks, not csh(1)! Details on why Perl's system() and backtick
and pipe opens all use the Bourne shell are in
http://www.perl.com/CPAN/doc/FMTEYEWTK/versus/csh.whynot .
You may also use the IPC::Open3 module (part of the standard perl
distribution), but be warned that it has a different order of
arguments from IPC::Open2 (see L<IPC::Open3>).
------------------------------------------------------------
: Thanks a lot.
Uh huh.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 26 Mar 1997 10:03:39 -0800
From: Sriranga R. Veeraraghavan <sveerara@cisco.com>
Subject: Re: Help with pipe
Message-Id: <ls3zpvqy1hg.fsf@sveerara-ultra.cisco.com>
In article <5hbd2i$9ip@ustsu10.ust.hk> hmyip@cs.ust.hk (Yip Hoi Man)
writes:
> I would like to create a filehandle pipe the data to a unix process
> and, at the same time, pipe the output of the process back to the
> Perl program. So I tried the following statements
>
> open(S, "| unixcommand |"); print S "something"; $a = <S>;
According to the Camel Book (1992 v1.2?) on page 163 you can't do
this:
"You may not have an open command that pipes both in and out"
But it goes on to say that:
"though it's easy to build one using the pipe and fork commands"
HTH,
----ranga <sveerara@cisco.com>
------------------------------
Date: 26 Mar 1997 12:16:29 -0500
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: How do I delete a line out of a text file
Message-Id: <r5ybbah8uq.fsf@tvmaster.turner.com>
Rob Huffstedtler <rob@netcentral.net.no.spam> writes:
> That's the inefficient way to do it. If you are on a unix platform,
> you can use perl to write an ed script and feed it to ed. Thus you
> can either dearch for particular text ro go to a particular line,
> delete that line then do a qw to quit and write it to disk.
I have my doubts as to your efficiency claim. time? space? CPU?
Some combination thereof?
You may be correct, as I'm no 'ed' expert, but I'd like to know from a
guts point of view how ed actually does this deletion.
------------------------------
Date: Wed, 26 Mar 1997 19:05:20 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: How to display tag-like text in HTML (was PARADOX)
Message-Id: <33405308.4350920@news.brad.ac.uk>
On Tue, 25 Mar 1997 21:52:15 -0800, Devin Ben-Hur <dbenhur@egames.com>
wrote:
>[mail&post]
>Lewis Taylor wrote:
>> I am currently writing a prog which will allow you to edit HTML files
>> from a browser. The following is an except from the program to generate
>> a TEXTBOX containing the file $file_to_edit
>>
>> print "<TEXTAREA NAME=\"text\" ROWS=15 COLS=50>\n\n\n";
>>
>> open(FILE,"$file_to_edit");
>++++ where's your "or die(...)" ???
>> while (<FILE>)
>> {
>> print;
>> }
>> close(FILE);
>>
>> print "\n\n\n</TEXTAREA>\n";
>>
>> This would work fine but for the fact that at the end of $file_to_edit
>> there are two tags </BODY> and </HTML> These are parsed screwing up the
>> generated page completly.
>
>The problem is more than </HTML>, it's *any* tags embedded
>in the text of the file_to_edit. Use HTML character entities
>to make the text look right in the textarea but not actually
>be parsed HTML tags. Add this before your print statement
>in the while loop above above:
> # change sensitive chars to entities
> s/([<>&])/'&#'.ord($1).';'/eg;
>
According to my HTML primer and my memory you the textarea tags
contain ASCII text...so this is likely to mess that up...although i
may be wrong (nothing new if I am :-)
---
Yours Sincerely,
,
() o /| | |
/\ _ _ _ __ _ _ |___| __| _
/ \| / |/ |/ | / \_/ |/ | | |\| | / | |/
/(__/|_/ | | |_/\__/ | |_/ | |/ \_/|/\_/|_/|__/
/|
\|
(Simon Hyde)
------------------------------
Date: Wed, 26 Mar 1997 10:41:39 -0500
From: Bill Kuhn <wkuhn@uconect.net>
Subject: Re: Is there not a market for a fancy debugger?
Message-Id: <333943B3.18C7F662@uconect.net>
There is a reason why languages other than perl provide environments
with fancy debuggers: You will most likely need them to get sometimes
the simplest of programs to execute.
Perhaps I am the exception to the norm, but I almost never use the perl
debugger. Not that it is difficult to use, but I don't see a need to
use it for the types of programs (medium complexity) that I write. I'm
not a perfect programmer, but I can quickly isolate and correct problems
from the error messages or output of my program.
I will go out on a limb and say that only a handfull of people write
programs of the complexity that require an elaborate programming
environment so the market for such a product is rather small.
In addition, a graphical environment quite often is not desirable. For
example, when I am "debugging" a program on a remote unix server via a
telnet window over a 28.8 PPP connection I don't want to export the X
display to my local X server. If I don't have a local X server I can't
debug in a graphical environment without actually copying the program
back to my local machine. Then, parts of the program may not work
because they are reliant on the remote system (unix specific
calls/commands, files, etc.).
In summary, the handful of users that might benefit from such a "perl
programming environment" would make the product out of reach ($$) of
most perl programmers unless, of course, it were free.
If it were made freely available I might be interested. :-)
-Bill
------------------------------
Date: Wed, 26 Mar 1997 09:59:29 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Little beginers question
Message-Id: <15hbh5.gv1.ln@localhost>
Eric Poindexter (eric@nettown.com) wrote:
: Josep Jover wrote:
: >
: > Hello,
: > Just two little questions to help a beginner that doesn't write english
: > very well ;-)
: >
: > How can I retrieve the current directory where I am ('chdir' is only use to
: > change it ?)
: $cwd = `pwd' # if unix
: $cwd = `cd` #if NT
: (note those are BACK ticks, or use
^^^
: $cwd = system ('pwd')
: if you like (see perl moto))
^^^^^^^^^^^
if you like $cwd to get the return value from the system() call
rather than the name of the current directory.
(ie. don't use that one ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Wed, 26 Mar 1997 15:19:35 GMT
From: klamerus@mail.id.net (Mark E. Klamerus)
Subject: Look for Example
Message-Id: <33393dfe.5036648@news.id.net>
Help,
I need to use (want to use) perl to drive a database via the
database's commad line interface. This requires "interacting" with
the database (handling input and outout) in a single session.
I've been using the ksh and co-processes - which works great, but
doesn't have the capabilities of perl. Does anyone have any examples
doing this? I know you can't do OPEN(...) for read/write, but that's
basically what I need.
thanks, especially for e-mail
------------------------------
Date: Wed, 26 Mar 1997 10:33:10 -0600
From: mwebster@burke.com
Subject: Making Script Execute?
Message-Id: <859393344.17136@dejanews.com>
I now have Perl running properly on our NT server, and when I execute the
script from the prompt, it does exactly what it is suppose to do.
However ...
When I try to execute the script using a remote browser, it tries to save
the script instead of execute it.
Any suggestions?
mwebster@burke.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 26 Mar 1997 17:56:17 +0100
From: Zaheed Haque <zaheed.haque@ein.ericsson.se>
Subject: MD5/LWP
Message-Id: <33395531.1A3A@ein.ericsson.se>
Hey,
Sorry for this beginners questions.. I was wondering If anyone
one would be kind enough to tell me where can I download The
following CPAN Perl libraries for Windows NT..
LWP
MD5
and other CPAN Libraries.. for NT
Please help..
Thanks in advance for your help..
Zaheed
------------------------------
Date: Wed, 26 Mar 1997 19:05:17 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Netscape Navigator 3.x
Message-Id: <33394288.125702@news.brad.ac.uk>
On 25 Mar 1997 21:21:26 GMT, Scott Reed <102556.773@CompuServe.COM>
wrote:
>I am currently working on an NT system that uses Perl with
>ActiveWare's Perl for Win32. I can get the script to work
>properly under IE 3.0. When I use Netscape's Navigator, it tries
>to use a helper app to respond to the perl script because it has
>a .pl extension. I tried to remove the references of the .pl
>files in Navigator through a file in the Navigator directory and
>the Win 95 registry. Does anyone know how I can get around this?
> I didn't buy Navigator so I don't have support from Netscape.
>Also, I have to use the .pl extension because it is required from
> Perl for Win32. Help!!
As far as I know the PerlScript add on for Perl for Win32 only works
with microsoft IE and microsoft web servers.
---
Yours Sincerely,
,
() o /| | |
/\ _ _ _ __ _ _ |___| __| _
/ \| / |/ |/ | / \_/ |/ | | |\| | / | |/
/(__/|_/ | | |_/\__/ | |_/ | |/ \_/|/\_/|_/|__/
/|
\|
(Simon Hyde)
------------------------------
Date: 26 Mar 1997 17:46:19 GMT
From: schip@lmsc.lockheed.com (Jan Schipmolder)
Subject: Re: passing <body bgcolor... in a script??
Message-Id: <5hbndb$gk2@dns.lmms.lmco.com>
Richard Morin (qnc496@durhamnews.net) wrote:
:
: Hi folks,
:
: This novice has been working on a script which I copied out of the Linux
: Journal for a cgi quiz. My only trouble seems to be passing extra html
The focus of this newsgroup is perl, not WWW stuff like CGI scripting
and HTML tags and such. The perl language per se has nothing to do
with anything WWW.
Try to post your questions and observations in one of the following
newsgroups:
comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.misc
comp.infosystems.www.authoring.cgi
I'll be thankful if you do. Many others too. Toodeloo.
--
jan.b.schipmolder@lmco.com
------------------------------
Date: Wed, 26 Mar 1997 07:23:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Lorraine <lorraine@ait.nrl.navy.mil>
Subject: Re: print "Content type: text/html\n\n";
Message-Id: <Pine.GSO.3.96.970326072246.5139I-100000@kelly.teleport.com>
On Tue, 25 Mar 1997, Brian Lorraine wrote:
> open(CFILE, $filename) || print "can't open file\n";
> $numero = <CFILE>;
> close(CFILE);
I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
-- 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: Wed, 26 Mar 1997 06:54:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ishwarya Rao <irao1@gaia.umbc.edu>
Subject: Re: printing associative arrays in order
Message-Id: <Pine.GSO.3.96.970326065112.5139C-100000@kelly.teleport.com>
On Tue, 25 Mar 1997, Ishwarya Rao wrote:
> When an associative array is printed, the elements are printed in a
> random order.
> I was wondering if there is a one line command to print the elements
> of an associative array in the order in which it was created, rather
> than in a random order.
Perl normally stores a hash (associative array) in an order which permits
fast access to each element. It intentionally discards the order in which
the elements were created.
Perhaps you want to use a hash tied to a file, which may hold its order.
Or there are other ways, such as using an array instead of a hash, or
using a sort routine to put the elements into the desired order.
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: 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 183
*************************************