[16384] in Perl-Users-Digest
Perl-Users Digest, Issue: 3796 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 25 11:05:39 2000
Date: Tue, 25 Jul 2000 08:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964537515-v9-i3796@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 25 Jul 2000 Volume: 9 Number: 3796
Today's topics:
attach a file to an email using perl. HOW? <zephyrus9@juno.com>
Re: empty line (Bernard El-Hagin)
Re: Error msg for perl using DBI?? <newsposter@cthulhu.demon.nl>
Re: Getting the date I want <tony_curtis32@yahoo.com>
Re: how do you ? question (Tad McClellan)
Re: NetBIOS/nbname ??? <flavell@mail.cern.ch>
Re: NetBIOS/nbname ??? <flavell@mail.cern.ch>
Re: newbie hashes of hashes declartion question <aqumsieh@hyperchip.com>
Re: Newbie needs advice about security (SPAM)
Open File and Change Case (Horse Nuts)
Re: Open File and Change Case (Tad McClellan)
Re: Open File and Change Case (Bernard El-Hagin)
Re: Open File and Change Case <DNess@Home.Com>
Re: Open File and Change Case <DNess@Home.Com>
Re: Open File and Change Case (Anno Siegel)
Re: Open File and Change Case (Horse Nuts)
Re: perl as part of unix distribution <russ_jones@rac.ray.com>
Re: perl as part of unix distribution (Tom Christiansen)
Re: perl as part of unix distribution <flavell@mail.cern.ch>
Re: perl as part of unix distribution (Nobody)
Re: Perl Power Tools Project Asleep? (Tom Christiansen)
Re: Perl Power Tools Project Asleep? (Marcel Grunauer)
Re: Perl Power Tools Project Asleep? (Tom Christiansen)
perl reg. ex. problem joe_madden@my-deja.com
Re: perl reg. ex. problem (Bernard El-Hagin)
Perl sequivallent for tidy (HTML fixup program)? (William Herrera)
Re: perl v. tcl <dacut@kanga.org>
Re: perl v. tcl <steve@digital-smarties.com>
Re: perl v. tcl <ivler@basecamp1.netquest.net>
Re: Perl's BigFloat/BigInt <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Jul 2000 10:54:08 -0400
From: zephyrus9 <zephyrus9@juno.com>
Subject: attach a file to an email using perl. HOW?
Message-Id: <397DAA0F.1740476B@juno.com>
I already have a form mailer, but I would also like to attach a file to
the mail that gets sent out. How might one do that with Perl? Is it
even possible. Please help. Thanks.
~Andy
------------------------------
Date: Tue, 25 Jul 2000 13:50:42 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: empty line
Message-Id: <slrn8nr6gm.61h.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 25 Jul 2000 12:29:35 GMT, melet@my-deja.com <melet@my-deja.com>
wrote:
>hello,
>
>
>how to detect an emtpy line?
If by empty you *really* mean empty you can use:
if ($string =~ m/^$/){
# Do something
}
On the other hand if by empty you mean nothing or only whitespace
(spaces and/or tabs) use:
if ($string =~ m/^\s*$/){
# Do something
}
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: 25 Jul 2000 13:56:06 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Error msg for perl using DBI??
Message-Id: <8lk69m$hhd$2@internal-news.uu.net>
JL <ltlau@yahoo.com> wrote:
> Hi,
> I always get the following error message:
> "DBI::db=HASH(0x817d86c)->disconnect invalidates 2 active statement handles
> (either destroy statement handles or call finish on them before
> disconnecting) at test.pl line 15."
> Can anyone tell me how come it happen?
You don't clean up after yourself and leave statement handles open. The
error message already mentioned how to fix that.
Erik
------------------------------
Date: 25 Jul 2000 09:07:04 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting the date I want
Message-Id: <87d7k2mhh3.fsf@limey.hpcc.uh.edu>
>> On Tue, 25 Jul 2000 20:09:53 +1000,
>> "WENDY GREEN" <wgreen@vtown.com.au> said:
> Hi. I don't know much Perl yet, but I'm trying to hack a
> script to my requirements. Code is:
> $date_command = "/bin/date";
> $date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`;
> chop($date); $shortdate = `$date_command +"%D %T %Z"`;
> chop($shortdate); . . open (GUEST,">$guestbookreal")
> || die "Can't Open $guestbookreal: $!\n"; . . print
> GUEST "$shortdate\n\n";
I guess from context that this operates in a CGI
environment. If so, you'll need to look into file locking
so that concurrent visitors don't trash your guestbook
files when they write over each other's accesses. Consult
the recent history of this group, there have been some
long discussions about how best to lock files
http://www.deja.com/
No need to run a separate process in the shell, perl can
do this for you:
> This gives output as
> 07/25/00 10:05:31 /etc/localtime
> I want the date formatted as dd/mm/yy (Australian), and
> want to lose the "/etc/localtime"
Sounds like something is wrong with your system's notion
of the local timezone.
use POSIX 'strftime';
my $date = strftime('%d/%m/%y %T %Z', localtime);
print "$date\n";
==> 25/07/00 09:05:20 CDT
(%Y gives 2000 instead of 00, which may or may not be
an issue for you)
"perldoc POSIX" and "man strftime" for the C function,
which gives the full documentation for your platform.
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Tue, 25 Jul 2000 07:41:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how do you ? question
Message-Id: <slrn8nqv86.chu.tadmc@magna.metronet.com>
On Tue, 25 Jul 2000 05:42:29 GMT, Jon Bell <jtbell@presby.edu> wrote:
>In article <4rspnscru6fq5berfpvp8ee33causcai6v@4ax.com>,
>Chris <exit72@excite.com> wrote:
>>
>>Please don't bother replying if your help is limited to suggestions of
>>what perldoc I should read.
>
>Does that mean you've already read the appropriate perldoc but don't
>understand it? In that case, tell us what you don't understand about it
>and someone will be happy to clarify it for you.
>
>If, on the other hand, it means you don't want to look at the appropriate
>perldoc if you're pointed there, then you'd better put on your asbestos
>suit... :-/
You don't need an asbestos suit to be widely and silently killfiled.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 25 Jul 2000 14:47:28 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: NetBIOS/nbname ???
Message-Id: <Pine.GHP.4.21.0007251418300.19901-100000@hpplus03.cern.ch>
On 24 Jul 2000, John Stanley wrote:
> >At places like:
> > http://grc.com
> >
> >Steve Gibson gets your name from your computer.
>
> No, not here he doesn't.
Here neither:
Gibson Research Corporation Proudly Announces:
[LINK]
[INLINE]
And introducing our NEW . . .
[INLINE]
[LINK]
Hmmm.
But you're probably talking about the "test my shields" button. Well,
as I'd rather suspected, they reported my address as the address of
the web proxy (a unix system which happens to also run samba), so they
tried probing that. Their probe doesn't seem to have shown up at the
proxy (possibly because of firewalling), but even if it had, I reckon
it would have been rejected.
The technical _point_ that is being made by that site is a good one:
it's just a pity that they wrap it up in such a way - maybe the Win PC
that I'm using really _is_ vulnerable, but they're interrogating the
wrong suspect.
(f'ups directed out of Perl)
------------------------------
Date: Tue, 25 Jul 2000 15:20:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: NetBIOS/nbname ???
Message-Id: <Pine.GHP.4.21.0007251517140.19901-100000@hpplus03.cern.ch>
On Mon, 24 Jul 2000, jason wrote:
> >> $REMOTE_ADDR = $ENV('REMOTE_ADDR');
> >
> >This is likely to be the address of the proxy server that the client
> >uses.
>
> actually it's likely to be a syntax error [perldata]
Oh, that as well. I'm sorry - in the font that I was using at the
time, it's hard to tell round brackets from curly ones, so I didn't
spot that blunder. OTOH I completely missed the other blunder that
you rightly picked up.
all the best (I must remember to score-down the usenaut in
question...)
--
"Mir ist es ein Rätsel wie man mit minimalem Verstand so einen
Unfug fabrizieren kann." - Adrian Knoth
------------------------------
Date: Tue, 25 Jul 2000 14:35:29 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: newbie hashes of hashes declartion question
Message-Id: <7au2degtvw.fsf@merlin.hyperchip.com>
"Jim Kauzlarich" <o1technospam@skyenet.nospam.net> writes:
> #! /usr/bin/perl -w
> use strict;
> my %HoH;
>
> %HoH = {
^
^
Why are you using curlies here? Curlies are used to construct anonymous
hashes. What you want are regular parentheses ().
> flintstones => {
> lead => "fred",
> pal => "barney",
> },
> jetsons => {
> lead => "george",
> wife => "jane",
> "his boy" => "elroy",
> },
> simpsones => {
> lead => "home",
> wife => "marge",
> kid => "bart",
> },
> };
>
> print "$HoH{flintstones}{lead}\n";
>
> When I try to run this code I get the following err:
> Odd number of elements in hash list at cartoon.cgi line 5.
> Use of uninitialized value at cartoon.cgi line 22.
Yes. It is because of your use of curlies which constructs one large
anonymous hash, and then try to assign that as a key to %HoH with no
associated value. So Perl complains.
--Ala
------------------------------
Date: Tue, 25 Jul 2000 15:00:07 GMT
From: "Andy" <andy@andy(SPAM).co.uk>
Subject: Re: Newbie needs advice about security
Message-Id: <XXhf5.941$465.37633@news3.cableinet.net>
"Eric Bohlman" <ebohlman@netcom.com> wrote in message
news:8ljvbp$ksr$10@slb3.atl.mindspring.net...
Eric,
Thanks for your prompt and helpful reply, I was a little worried that I'd
get a beasting... I've seen others get flamed to a crisp here for asking
newbie stuff!
>
> : Here's the code:
> :
> : #!/usr/local/bin/perl -wT
>
> Use strict and declare your variables.
>
I had to look this one up... now implemented.
> :
> : use CGI qw(:all);
> : $|=1;
> :
> : $quote_file = "quotes.txt";
>
> You should either specify an absolute path or chdir() to a known
> directory first, because there's no guarantee what your working directory
> will be when this code runs.
>
ok, that makes perfect sense...
> : # I know file locking isn't strictly necessary for reading, but I did it
as
> : an exercise
> : flock (QUOTE_FILE, 2);
>
> Use constants imported from Fcntl.pm rather than magic numbers.
>
Again, searched the docs and got it working.
Also tidied up the useless quotes!!
> : This code is working just fine, but aside from security concerns, the
> : "randomness" seems a little questionable. I seem to get the same quote
> : twice in a row a little too often. The quote file has 99 quotes in it,
so
> : there are plenty to choose from.
>
> How often is "a little too often"? Most people's expectations of how
> random processes should work don't match reality; in a real random
> process, events *do* tend to "cluster" far more frequently than most
> people expect.
>
Well, typically, it doesn't seem to be giving me "doublers" any more! It
did seem to be returning the same quote twice in a row at least once in ten
executions, but I was obviously being paranoid!
As a side issue, the quote file is about 10.5k in size, and the entire file
is read into an array every time the program executes. There must be a
limit to how big this file can be before my hosting company starts to
notice, are there any "rules of thumb" regarding the size of these kinds of
file? (I surely can't be anywhere near a limit at 10.5k??)
Regards,
Andy.
------------------------------
Date: Tue, 25 Jul 2000 13:23:06 GMT
From: hx_101@hotmail.com (Horse Nuts)
Subject: Open File and Change Case
Message-Id: <397d9483.592642635@news.dal.ca>
Ho would I go about opening a file, and changing the case of all the
letters to lower case??
Thanks
------------------------------
Date: Tue, 25 Jul 2000 09:04:23 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Open File and Change Case
Message-Id: <slrn8nr42n.d4a.tadmc@magna.metronet.com>
On Tue, 25 Jul 2000 13:23:06 GMT, Horse Nuts <hx_101@hotmail.com> wrote:
>Ho would I go about opening a file,
I would think that the open() function might help with opening a file.
perldoc -f open
What problem are you having with that part?
>and changing the case of all the
>letters to lower case??
I would think that the lc() function might help with forcing
characters to lower case.
perldoc -f lc
I would also think that the answer to this Perl FAQ
might help with changing the contents of a file:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
This newsgroup is not a "read the docs to me" service.
Please look around a bit in the standard docs before
bothering thousands of people with your already-answered
questions. Thanks.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 25 Jul 2000 13:55:05 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Open File and Change Case
Message-Id: <slrn8nr6ov.61h.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 25 Jul 2000 13:23:06 GMT, Horse Nuts <hx_101@hotmail.com> wrote:
>Ho would I go about opening a file, and changing the case of all the
>letters to lower case??
Do you mean lower case all of the characters in the file? If so try:
__________________
#!/usr/bin/perl -w
use strict;
open (IN, "< /input/file") or die $!;
while (<IN>){
s/(.*)/\L$1/;
print;
}
__________________
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: Tue, 25 Jul 2000 13:53:56 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Open File and Change Case
Message-Id: <397D9BFB.58E31C30@Home.Com>
Horse Nuts wrote:
>
> Ho would I go about opening a file, and changing the case of all the
> letters to lower case??
>
> Thanks
In Windows (NT)
perl -w -p -e "tr/a-z/A-Z/;" <in >out
seems to do it, converting file `in' into file `out'
------------------------------
Date: Tue, 25 Jul 2000 13:57:13 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Open File and Change Case
Message-Id: <397D9CBF.E63744DA@Home.Com>
David Ness wrote:
>
> Horse Nuts wrote:
> >
> > Ho would I go about opening a file, and changing the case of all the
> > letters to lower case??
> >
> > Thanks
>
> In Windows (NT)
>
> perl -w -p -e "tr/a-z/A-Z/;" <in >out
>
> seems to do it, converting file `in' into file `out'
It must be too early.. I misread `to lower case' as `from lower case'
I obviously should have written...
perl -w -p -e "tr/A-Z/a-z/;" <in >out
------------------------------
Date: 25 Jul 2000 14:16:42 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Open File and Change Case
Message-Id: <8lk7ga$16k$1@lublin.zrz.tu-berlin.de>
David Ness <DNess@Home.Com> wrote in comp.lang.perl.misc:
>David Ness wrote:
>>
>> Horse Nuts wrote:
>> >
>> > Ho would I go about opening a file, and changing the case of all the
>> > letters to lower case??
>> >
>> > Thanks
>>
>> In Windows (NT)
>>
>> perl -w -p -e "tr/a-z/A-Z/;" <in >out
>>
>> seems to do it, converting file `in' into file `out'
>
>It must be too early.. I misread `to lower case' as `from lower case'
>I obviously should have written...
> perl -w -p -e "tr/A-Z/a-z/;" <in >out
Still, lc() is to be preferred over tr/// in this case. For one,
lc() is a simpler, specialized tool that does exactly what is required
here. More importantly, lc() will work on your local alphabet if you
set the locale right.
Anno
------------------------------
Date: Tue, 25 Jul 2000 14:50:45 GMT
From: hx_101@hotmail.com (Horse Nuts)
Subject: Re: Open File and Change Case
Message-Id: <397fa912.597905953@news.dal.ca>
Yes, but how do I replace the lower case names in the same file???
Tks
On Tue, 25 Jul 2000 13:55:05 GMT, bernard.el-hagin@lido-tech.net
(Bernard El-Hagin) wrote:
>On Tue, 25 Jul 2000 13:23:06 GMT, Horse Nuts <hx_101@hotmail.com> wrote:
>>Ho would I go about opening a file, and changing the case of all the
>>letters to lower case??
>
>Do you mean lower case all of the characters in the file? If so try:
>
>__________________
>#!/usr/bin/perl -w
>use strict;
>
>open (IN, "< /input/file") or die $!;
>
>while (<IN>){
> s/(.*)/\L$1/;
> print;
>}
>__________________
>
>Bernard
------------------------------
Date: Tue, 25 Jul 2000 08:00:03 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: perl as part of unix distribution
Message-Id: <397D8F53.D16D3A74@rac.ray.com>
Eric Bohlman wrote:
>
>
> The license agreement for every significant piece of commercial software
> I've ever seen includes a statement releasing the manufacturer from
> liability for consequential damages such as those you mentioned. Whether
> such disclaimers are in fact enforceable has not, AFAIK (though IANAL),
> been tested in court, but I would imagine that if you were to sue for
> multi-million dollar consequential damages, the case would wind up before
> the Supreme court several years and several million dollars later. The
> implied security simply isn't there.
>
I'm not talking about implied security. Many large corporations
(including some I've worked for) make it a condition of purchase that
a vendor's software works.
Also I'm not saying it's right or prudent. I'm just saying that it IS
a reason that I've seen before for not putting share/freeware in
general and Perl in particular on production or mission-critical
systems.
To paraphrase Oscar Madison, it took me thirty minutes to figure out
that IANAL meant "I am not a lawyer."
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
"That's my story, I'm sticking to it."
- Catullus, a really cranky Roman guy
------------------------------
Date: 25 Jul 2000 07:48:27 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: perl as part of unix distribution
Message-Id: <397d9aab@cs.colorado.edu>
In article <8li2a5$2tk$1@nnrp1.deja.com>, <dgallardo@my-deja.com> wrote:
>Is perl part of any standard unix distribution? Are there any moves in
>this direction.
A fairly definitive list of vendors can be found in the index page
of the CPAN ports directory, such as you find at
http://www.perl.com/CPAN-local/ports/
http://www.cpan.org/CPAN/ports/
When last I looked at this very question a few months ago, all of
AIX, BeOS, BSDI, Debian, DG/UX, DYNIX/ptx, FreeBSD, IRIX, LynxOS,
Mac OS X, OpenBSD, OS390, RedHat, SINIX, Slackware, Solaris, SuSE,
and Tru64 shipped with Perl as part of their standard distributions.
I'm sure more have been added since then. (And that doesn't even
count the millions of other Linux operating systems.)
--tom
------------------------------
Date: Tue, 25 Jul 2000 16:10:37 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: perl as part of unix distribution
Message-Id: <Pine.GHP.4.21.0007251607230.19901-100000@hpplus03.cern.ch>
On Tue, 25 Jul 2000, Russ Jones wrote:
> To paraphrase Oscar Madison, it took me thirty minutes to figure out
> that IANAL meant "I am not a lawyer."
If this is meant to be a joke, a Google search took me about 5 seconds
wall-clock time to provide the answer. "Use the Web, Luke".
(This was only a demonstration. I already knew it.)
« Je ne suis pas un avocat...
------------------------------
Date: 25 Jul 2000 13:51:41 GMT
From: nobody@contract.East.Sun.COM (Nobody)
Subject: Re: perl as part of unix distribution
Message-Id: <8lk61d$m4c$1@eastnews1.east.sun.com>
In article <8licgm$arm$1@nnrp1.deja.com>, <dgallardo@my-deja.com> wrote:
>Solaris 8 ships with perl? We're using Solaris 7, which does not...
>
>
Yep. Only I ended up having to install it anyway, since the version
they supply is compiled with their own compiler, which apparently
didn't ship with it (or if it did, I couldn't find it). Some of
the modules and other software I wanted to install preferred gnu c (gcc)
anyway, which was also shipped on a supplemental disk. I found, though, that
everything worked best when I installed everything myself, since I would
know where to find it all afterwards. :-)
Anita
------------------------------
Date: 25 Jul 2000 07:55:55 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Perl Power Tools Project Asleep?
Message-Id: <397d9c6b@cs.colorado.edu>
In article <1cb33308.018bfc9b@usw-ex0106-046.remarq.com>,
quagga <nathan.thompsonNOnaSPAM@respironics.com.invalid> wrote:
>So, is the Perl Power Tools project in low-power shutdown? Is
>it resting? Neglected? Defunct? Waiting ... for Godot?
The code is all intact and at http://doriath.perl.com/ppt/, and you
may grab it from there. Nearly everything is done, save very hard
things like nroff and vi. What happened is that I had an irrecoverable
disk crash from which I was unable to restore the subscribers to
the mailing list. Without the mailing list as a focal point, most
participation dried up.
I need to get this on CPAN, but it's not clear where suites go.
I guess just in my author directory.
--tom
------------------------------
Date: Tue, 25 Jul 2000 14:33:48 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Perl Power Tools Project Asleep?
Message-Id: <slrn8nr9la.32t.marcel@gandalf.local>
On 25 Jul 2000 07:55:55 -0700, Tom Christiansen <tchrist@perl.com> wrote:
>The code is all intact and at http://doriath.perl.com/ppt/, and you
>may grab it from there. Nearly everything is done, save very hard
>things like nroff and vi. What happened is that I had an irrecoverable
>disk crash from which I was unable to restore the subscribers to
>the mailing list. Without the mailing list as a focal point, most
>participation dried up.
I'm probably doing something completely stupid, but after downloading
the ppt and unpacking it, how do I install the programs? In the scripts
directory, there are a few programs that seem to be part of the install
process, but one (mkln) is there only as a fragment. And there is no
Makefile.PL or something like that. I figured the programs would go into
bin/ and the docs would go into html/, but how?
Sorry if I missed something completely obvious. (Sure, I could write
the installer myself, I just wondered whether there wasn't one that
I overlooked.)
Thanks & nice to see you're back, Tom
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: 25 Jul 2000 08:48:19 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Perl Power Tools Project Asleep?
Message-Id: <397da8b3$1@cs.colorado.edu>
In article <slrn8nr9la.32t.marcel@gandalf.local>,
Marcel Grunauer <marcel@codewerk.com> wrote:
>I'm probably doing something completely stupid, but after downloading
>the ppt and unpacking it, how do I install the programs?
Using "cp", probably, or "install". No, there is no installation process
for the suite. It's something that didn't happen.
>Thanks & nice to see you're back, Tom
Thanks. One shall see.
--tom
------------------------------
Date: Tue, 25 Jul 2000 13:40:29 GMT
From: joe_madden@my-deja.com
Subject: perl reg. ex. problem
Message-Id: <8lk5cc$itt$1@nnrp1.deja.com>
What is wrong here. I am trying to remove the last line of an html file
using perl. In this case, the line happens to be: </table><!---end--->
I'm opening the file, reading in the lines and removing all occurences
of this. Does anyone know why this is not working. It runs, but does
not change the file at all. The permissions are correct.
Here is the script:
#!/usr/bin/perl -w
$outfile = "/home/user/user.html";
open(OUT, "$outfile") || die "cannot open";
while(<OUT>){
chomp;
s/<\/table><!---end--->//;
}
close(OUT);
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Jul 2000 14:05:07 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: perl reg. ex. problem
Message-Id: <slrn8nr7bk.61h.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 25 Jul 2000 13:40:29 GMT, joe_madden@my-deja.com
<joe_madden@my-deja.com> wrote:
>What is wrong here. I am trying to remove the last line of an html file
>using perl. In this case, the line happens to be: </table><!---end--->
>
>I'm opening the file, reading in the lines and removing all occurences
>of this. Does anyone know why this is not working. It runs, but does
>not change the file at all. The permissions are correct.
>
>Here is the script:
>
>#!/usr/bin/perl -w
You should "use strict", you know.
>$outfile = "/home/user/user.html";
>
>open(OUT, "$outfile") || die "cannot open";
>while(<OUT>){
> chomp;
> s/<\/table><!---end--->//;
>}
>close(OUT);
Where in this script would you expect something to be written??? You're
neither printing the results of the substitution nor writing them to an
output file. Either add "print;" right after the substitution or open a
file for writing and use "print OUTPUT;".
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: Tue, 25 Jul 2000 14:43:02 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Perl sequivallent for tidy (HTML fixup program)?
Message-Id: <397da662.460115870@news.rmi.net>
Hi, I am currently looking at running some program HTML output (from a text or
MS word to HTML translator) through tidy via system() in a perl program. Is
there a native perl equivalent to the tidy program for cleaning up HTML?
---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.
------------------------------
Date: Tue, 25 Jul 2000 13:05:26 GMT
From: David Cuthbert <dacut@kanga.org>
Subject: Re: perl v. tcl
Message-Id: <397D90E8.3F7BDC60@kanga.org>
Cameron Laird wrote:
> No, Perl's dominance of CGI isn't because it's better.
> It's a result of historic contingencies--in '93-94, Web
> pages were being put up by Unix sysads, and Perl was
> very popular with them because it was like awk and sed,
> and ...
Interestingly, Tcl is entrenched in the EDA (electronic design
automation) market for much the same reason. In fact, this was its
original application (frontend command line language for CAD tools being
developed in Ousterhout's group at Berkeley).
It's not the perfect language, but it worked (and still works) well
enough that many vendors adopted it.
--
David Cuthbert
dacut@kanga.org
------------------------------
Date: 25 Jul 2000 14:07:01 GMT
From: Steve Landers <steve@digital-smarties.com>
Subject: Re: perl v. tcl
Message-Id: <397d9f05$0$27273@echo-01.iinet.net.au>
In comp.lang.tcl Cameron Laird <claird@starbase.neosoft.com> wrote:
> No, Perl's dominance of CGI isn't because it's better.
> It's a result of historic contingencies--in '93-94, Web
> pages were being put up by Unix sysads, and Perl was
> very popular with them because it was like awk and sed,
> and ...
tty noise
Sorry - couldn't resist it ;-)
--
Steve Landers phone: +61 8 9313 6868
Digital Smarties fax: +61 8 9313 6077
Perth, Western Australia e-mail: steve@digital-smarties.com
------------------------------
Date: Tue, 25 Jul 2000 14:14:21 GMT
From: "J.M. Ivler" <ivler@basecamp1.netquest.net>
Subject: Re: perl v. tcl
Message-Id: <1hhf5.9733$G7.240447@news-west.usenetserver.com>
In comp.lang.tcl Morten Skaarup Jensen <morten@nospam.org> wrote:
> Yes. I mean processing forms, retrieving and saving data in databases, or
> possibly managing this data oneself. I would just use pure HTML for static
> web pages.
Buy my book.
or
Buy Web Complete.
While my book is a bit dated, and I choose to show everything with flat
files, the same basic methods can be replaced with calls to oracle,
sybase, mysql, etc.
Additionally, in my book we did everything in both Tcl and Perl so you
could see that THE LANGUAGE DOESN'T MATTER. Use what you are most
comfortable in, what is most maintainable by your organization and what
you feel will best meet your needs.
oh yes, my book...
_CGI Developer's Resource: Web Programming in Tcl and Perl_ Prentice Hall
------------------------------
Date: Tue, 25 Jul 2000 14:39:10 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl's BigFloat/BigInt
Message-Id: <ah9rnsgloe1vh0skdeadaigldi2c6502b9@4ax.com>
Raymond WAN wrote:
> $d = ($a1 / 1000) * ($a2 / 1000);
>
> it doesn't seem to work so I've created $b and $c in hopes that
>the BigFloat division will be used. Does anyone know why this is so?
>Also, does anyone know how to perform an "explicit cast" in Perl so that I
>can be sure it is working?
Are $a1 and $a2 simple scalars, or of class BigFloat? It should be the
latter.
--
Bart.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 3796
**************************************