[13488] in Perl-Users-Digest
Perl-Users Digest, Issue: 898 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 24 09:08:08 1999
Date: Fri, 24 Sep 1999 06:05:14 -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: <938178314-v9-i898@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 24 Sep 1999 Volume: 9 Number: 898
Today's topics:
[ANNOUNCE] New Unix System Log(s) scanner <bill@fccj.org>
ANNOUNCE: HTML::Template 0.06 <sam@tregar.com>
ANNOUNCE: Tie::Syslog <bseib@jade.cc.purdue.edu>
ANNOUNCEMENT: NEW MODULE: HTML::Pager 0.01 <sam@tregar.com>
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.05 <sam@tregar.com>
Re: Calling Mac 'ToolBox' Function via MacPerl (Samuel)
Re: Calling Mac 'ToolBox' Function via MacPerl (Chris Nandor)
capitalisation? <daniel@vesma.co.uk>
Re: capitalisation? (Sam Holden)
Re: capitalisation? <rhomberg@ife.ee.ethz.ch>
Re: cc: bad bug in your cal(ender) script on perl ppt - <mark@artdigital.co.uk>
Re: CGI sending email with attachment (I.J. Garlick)
Re: CGI sending email with attachment <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com>
Re: Difference between do and require.... <csaba.raduly@sophos.com>
Re: Getting the first occurence of a string <t.dillerNOvtSPAM@xpres.com>
Re: How can I "undo" a require ? <csaba.raduly@sophos.com>
Re: How can I "undo" a require ? <csaba.raduly@sophos.com>
Re: HTML to ASCII (Bernhard Muenzer)
Re: HTML to ASCII <mike@crusaders.no>
Re: match using scalar <rhomberg@ife.ee.ethz.ch>
Re: match using scalar (Randal L. Schwartz)
Re: Method=Post & frames <maen@packet-technologies.com>
Opening a Netscape Composer window from a script <savigny@informatik.uni-hamburg.de>
Re: Opening a Netscape Composer window from a script <gellyfish@gellyfish.com>
Pod::Tree 1.00 released (Steven W McDougall)
Re: Printing a list from the bottome to the top verses <rhomberg@ife.ee.ethz.ch>
Re: Printing a list from the bottome to the top verses <mattking@techie.com>
Strict? amerar@ci.chi.il.us
using System function to run other programs <chyaron@netvision.net.il>
Re: You should be admired fty@utk.edu
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Sep 1999 12:37:25 GMT
From: "Bill Jones" <bill@fccj.org>
Subject: [ANNOUNCE] New Unix System Log(s) scanner
Message-Id: <7sfra5$s1r$1@play.inetarena.com>
[ANNOUNCE] msg_log.perl -
On CPAN, I have posted an updated version of a simple Unix 'syslog /
messages / sulog' scanner. A very simple-minded script, really, but one
which may help people just starting out using Perl for SysAdmin work get
other ideas they may have off the design board and into practice.
Please see http://www.cpan.org/authors/id/S/SN/SNEEX/msg_log.perl for the
source code. If you have any questions do not hesitate to contact me at
sneex@usa.net - I try to write scripts that are more understandable rather
than using some obscure or 'neat-o' Perl syntax feature.
Other URLs which may be of interest:
http://jacksonville.pm.org
http://www.cpan.org/authors/id/S/SN/SNEEX/
http://web.fccj.org/~wcjones/
Thx,
-Sneex- :]
_________________________________________________________________________
Bill Jones | Data Security Specialist | http://www.fccj.org/cgi/mail?dss
FCCJ | 501 W State St | Jacksonville, FL 32202 | 1 (904) 632-3089
$_="Jacksonville Perl Mongers";while(/([Jacksonville Perl Mongers])/g){
print join(" ",map{defined $_ ? $_ : ""}$`,$&,$',$+),"\n";}
------------------------------
Date: 24 Sep 1999 12:36:32 GMT
From: Sam Tregar <sam@tregar.com>
Subject: ANNOUNCE: HTML::Template 0.06
Message-Id: <7sfr8g$rut$1@play.inetarena.com>
ANNOUNCE: HTML::Template 0.06
CHANGES
0.06
- added associate parameter to new() and obsoleted
associate_CGI() (still supported for now)
- added support for HTML_TEMPLATE_ROOT environment variable
- small performance improvements using typeglobs
- added a performance testing script: time_trial.pl
AVAILABILITY
http://www.cpan.org/authors/id/S/SA/SAMTREGAR/
DESCRIPTION
This module attempts to make using HTML templates simple and natural.
It extends standard HTML with a few new tags - <TMPL_VAR>, <TMPL_LOOP>
and <TMPL_INCLUDE>. The file written with HTML and these new tags is
called a template. It is usually saved separate from your script -
possibly even created by someone else! Using this module you fill in
the values for the variables and loops declared in the template. This
allows you to seperate design - the HTML - from the data, which you
generate in the Perl script.
This module is licenced under the GPL. See the documentation for more
details.
MOTIVATION
It is true that there are a number of packages out there to do HTML
templates. On the one hand you have things like HTML::Embperl which
allows you freely mix Perl with HTML. On the other hand lie
home-grown variable substitution solutions. Hopefully the module can
find a place between the two.
One advantage of this module over a full HTML::Embperl-esque solution
is that it enforces an important divide - design and programming. By
limiting the programmer to just using simple variables and loops in
the HTML, the template remains accessible to designers and other
non-perl people. The use of HTML-esque syntax goes further to make
the format understandable to others. In the future this similarity
could be used to extend existing HTML editors/analyzers to support
this syntax.
An advantage of this module over home-grown tag-replacement schemes is
the support for loops. In my work I am often called on to produce
tables of data in html. Producing them using simplistic HTML
templates results in CGIs containing lots of HTML since the HTML
itself could not represent loops. The introduction of loop statements
in the HTML simplifies this situation considerably. The designer can
layout a single row and the programmer can fill it in as many times as
necessary - all they must agree on is the parameter names.
For all that, I think the best thing about this module is that it does
just one thing and it does it quickly and carefully. It doesn't try
to replace Perl and HTML, it just augments them to interact a little
better. And it's pretty fast.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 24 Sep 1999 12:35:28 GMT
From: Broc Seib <bseib@jade.cc.purdue.edu>
Subject: ANNOUNCE: Tie::Syslog
Message-Id: <7sfr6g$ruj$1@play.inetarena.com>
Keywords: tie syslog error capture logging perl CGI
The module Tie::Syslog version 1.03 should soon be available on a CPAN
server near you. It is immediately available at http://vyking.com/CPAN.
Full documentation: http://vyking.com/CPAN/Tie-Syslog.html
-b
Tie::Syslog
===========
Copyright (C) 1999 Broc Seib. All rights reserved. This program
is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
Broc Seib, bseib@vyking.com
SYNOPSIS
========
use Tie::Syslog;
tie *MYLOG, 'Tie::Syslog', 'local0.error', 'my_program', 'pid';
print MYLOG "I made an error."; ## this will be syslogged
printf MYLOG "Error %d", 42; ## syslog as "Error 42"
untie *MYLOG;
DESCRIPTION
===========
This module allows you to tie a filehandle (output only) to
syslog. This becomes useful in general when you want to
capture any activity that happens on STDERR and see that it
is syslogged for later perusal. You can also create an arbitrary
filehandle, say LOG, and send stuff to syslog by printing to
this filehandle. This module depends on the Sys::Syslog module
to actually get info to syslog.
When used with STDERR, combined with the good habit of using
the perl -w switch, this module happens to be useful in
catching unexpected errors in any of your code, or team's
code. Tie::Syslog is pretty brain-dead. However, it can
become quite flexible if you investigate your options with
the actual syslog daemon. Syslog has a variety of options
available, including notifying console, logging to other
machines running syslog, or email support in the event of
Bad Things. Consult your syslog documentation to get
/etc/syslog.conf setup by your sysadmin and use Tie::Syslog
to get information into those channels.
------------------------------
Date: 24 Sep 1999 12:35:54 GMT
From: Sam Tregar <sam@tregar.com>
Subject: ANNOUNCEMENT: NEW MODULE: HTML::Pager 0.01
Message-Id: <7sfr7a$rul$1@play.inetarena.com>
ANNOUNCEMENT: NEW MODULE: HTML::Pager 0.01
NAME
HTML::Pager - Perl module to handle CGI HTML paging of arbitary data
DESCRIPTION
This module handles the paging of data coming from an arbitrary source
and being displayed using HTML::Template and CGI.pm. It
provides an interface to pages of data similar to many well-known
sites, like altavista.digital.com or www.google.com.
DOCUMENTATION
Please see the perldocs for documentation. It's much more up-to-date
and informative than this README!
AVAILABILITY
The module is available on CPAN. You can get it using CPAN.pm or go
to:
http://www.cpan.org/authors/id/S/SA/SAMTREGAR/
CONTACT INFO
This module was written by Sam Tregar (sam@tregar.com) for Vanguard
Media (http://www.vm.com).
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 24 Sep 1999 12:35:37 GMT
From: Sam Tregar <sam@tregar.com>
Subject: ANNOUNCEMENT: NEW VERSION: HTML::Template 0.05
Message-Id: <7sfr6p$ruk$1@play.inetarena.com>
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.05
NAME
HTML::Template - a Perl module to use HTML Templates
CHANGES
0.05
- Added <TMPL_INCLUDE> functionality!
- Added associate_CGI() method - donated by Richard Dice
- Cleaned up internal access to new() options.
- more bug fixes from such notables as Kevin Puetz, and Steve
Reppucci.
DESCRIPTION
This module attempts to make using HTML templates simple and natural.
It extends standard HTML with a few new tags - <TMPL_VAR> and
<TMPL_LOOP>. The file written with HTML and these new tags is called
a template. It is usually saved separate from your script - possibly
even created by someone else! Using this module you fill in the
values for the variables and loops declared in the template. This
allows you to seperate design - the HTML - from the data, which you
generate in the Perl script.
This module is licenced under the GPL. See the LICENCE section of the
README.
AVAILABILITY
The module is available on CPAN. You can get it using CPAN.pm or go
to:
http://www.cpan.org/authors/id/S/SA/SAMTREGAR/
MOTIVATION
It is true that there are a number of packages out there to do HTML
templates. On the one hand you have things like HTML::Embperl which
allows you to freely mix Perl with HTML. On the other hand lie
home-grown variable substitution solutions. Hopefully the module can
find a place between the two.
One advantage of this module over a full HTML::Embperl-esque solution
is that it enforces an important divide - design and programming. By
limiting the programmer to just using simple variables and loops in
the HTML, the template remains accessible to designers and other
non-perl people. The use of HTML-esque syntax goes further to make
the format understandable to others. In the future this similarity
could be used to extend existing HTML editors/analyzers to support
this syntax.
An advantage of this module over home-grown tag-replacement schemes is
the support for loops. In my work I am often called on to produce
tables of data in html. Producing them using simplistic HTML
templates results in CGIs containing lots of HTML since the HTML
itself could not represent loops. The introduction of loop statements
in the HTML simplifies this situation considerably. The designer can
layout a single row and the programmer can fill it in as many times as
necessary - all they must agree on is the parameter names.
For all that, I think the best thing about this module is that it does
just one thing and it does it quickly and carefully. It doesn't try
to replace Perl and HTML, it just augments them to interact a little
better. And it's pretty fast.
DOCUMENTATION
The documentation is in Template.pm in the form of POD format
perldocs. Even the above text might be out of date, so be sure to
check the perldocs for the straight truth.
CONTACT INFO
This module was written by Sam Tregar (sam@tregar.com) for Vanguard
Media (http://www.vm.com).
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 24 Sep 1999 07:29:25 -0400
From: sleidy_keinSpam_@_bitte_voicencet.com (Samuel)
Subject: Re: Calling Mac 'ToolBox' Function via MacPerl
Message-Id: <1dymikc.aa62ky10py2pcN@dialup0338-pri.voicenet.com>
Thank you, I will.
Samuel
------------------------------
Date: Fri, 24 Sep 1999 13:01:09 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Calling Mac 'ToolBox' Function via MacPerl
Message-Id: <pudge-2409990901140001@192.168.0.77>
In article <1dylzh1.17l0fy845bswN@dialup0722-pri.voicenet.com>,
sleidy_keinSpam_@_bitte_voicencet.com (Samuel) wrote:
# Computer: Mac IIci
# MacOS: 7.6.1
# Perl: MacPerl 5.2.0r4
# If I add 'use Mac::Files' as per the 'MacPerl Power and Ease'
# Publication I receive this Error Message:
#
# --- Error Message starts here -----
#
# # Can't find loadable object for module Mac::Files in @INC
# (HDD_03:Programming_[Compilers]:MacPerl:lib:Mac HDD_03:MacPerl:lib
# Dev:Pseudo)
# File 'Dev:Pseudo'; Line 22
# # BEGIN failed--compilation aborted.
# File 'HDD_02:*Programming
# Files:Perl:Sams:Dilbert_Cleaner:Dilbert_Cleaner_02.pl'; Line 22
#
# --- Error Message ends here -----
As noted, you should check out the MacPerl mailing lists (though the
proper link is http://www.macperl.org/, not .com). However, the problem
can be solved with a proper installation. According to the directions in
the book, you need to install the CFM68K version (page 41) you need to
install the CFM68K version of MacPerl. You are already most of the way
there, having installed the regular installer. Just run the cfm68k
installer to get the correct binary and shared libraries.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Fri, 24 Sep 1999 11:39:10 +0100
From: "Daniel Vesma" <daniel@vesma.co.uk>
Subject: capitalisation?
Message-Id: <7sfk4s$av4$1@gxsn.com>
Hi,
In an app I am writing, I use...
if($foo =~ /$blah/)
{
print "YAY";
}
Is it possible to make ignore case? e.g. if $foo were "jeff", it would print
"YAY" when $blah was Jeff, jeff, JefF...
Thanks
Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma
------------------------------
Date: 24 Sep 1999 10:40:53 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: capitalisation?
Message-Id: <slrn7uml9l.cfd.sholden@pgrad.cs.usyd.edu.au>
On Fri, 24 Sep 1999 11:39:10 +0100, Daniel Vesma <daniel@vesma.co.uk> wrote:
>Hi,
>
>In an app I am writing, I use...
>
> if($foo =~ /$blah/)
> {
> print "YAY";
> }
>
>Is it possible to make ignore case? e.g. if $foo were "jeff", it would print
>"YAY" when $blah was Jeff, jeff, JefF...
Have you thought of reading the documentation about the thing you are using...
The first page of the perlre documentation gives you the answer.
The first page of the /PATTERN/ documentation in perlop gives you the answer.
Learn how to read... it'll help you to program.
--
Sam
Anyway, the other successor to C gobbled up two letters instead of one.
Which is why many Perl scripts have the extension, ``.pl'', finishing
off BCPL. --Larry Wall
------------------------------
Date: Fri, 24 Sep 1999 12:49:45 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: capitalisation?
Message-Id: <37EB5749.D0E775DC@ife.ee.ethz.ch>
Daniel Vesma wrote:
[snip]
> Is it possible to make [the match] ignore case? e.g. if $foo were "jeff", it would print
> "YAY" when $blah was Jeff, jeff, JefF...
Yes. See perldoc perlop, search for m/, read.
- Alex
------------------------------
Date: Fri, 24 Sep 1999 12:23:18 +0100
From: "Mark Hamlin" <mark@artdigital.co.uk>
Subject: Re: cc: bad bug in your cal(ender) script on perl ppt - 2004
Message-Id: <7sfmvm$gnh$1@pheidippides.axion.bt.co.uk>
The following are two further messages to the 'cc: bad bug in your
cal(ender) script on perl ppt - 2004' which I have sent previously but do
not seem to have appeared, so here goes again
Trying it on Linux system and it seems to work - what the......
Still testing
Mark
----
I've got some sort of environment problem but what. Solaris system based in
UK could be using BST rather than GMT. Linux server is big 'change root
virtual server system' based in America - AIT.
Its not a show stopper for me now, just a worry for the future.
Mark
Mark Hamlin <mark@artdigital.co.uk> wrote in message
news:7saqa9$lhi$1@pheidippides.axion.bt.co.uk...
> http://language.perl.com/ppt/src/cal/cal.hudson.html
>
> I'm pretty sure of this, I can't see how I could be mistaken - but thats
> usually the case. Being a tester by profession, and because I was about
to
> spend several days developing an app using your script as the basis, I
> thought I'd run a few simple tests. Turned out to be a good move, didn't
> take long to find a problem - '2004'. Running on a Sun Solaris server
your
> 1st October 2004 is a Thursday where according to Cal running on the same
> system and others it should be a Friday.
>
> Oh dear.. I hope you decide to fix it, have fun if you do. Your script
was
> the 'cutest' of the four alternatives available by some margin, but then I
> guess the above could be the result. If you fix it in the next few hours
> let me know - I'll have started on one of the others by then.
>
> Cheers,
> Mark
>
>
------------------------------
Date: Fri, 24 Sep 1999 10:01:04 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: CGI sending email with attachment
Message-Id: <FIK6Ht.u6@csc.liv.ac.uk>
In article <QzrG3.33$RA1.1835@client>,
"Burt Hwang" <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> writes:
> Hi,
>
> I have no clue why I can't receive attachments correctly with my email
> program. I'll get the attachment, but when I open it, it looks nothing like
> when I sent it.
>
Yukk burt. Use here doc syntax it will make debuging this a piece of cake.
>
> Here's my code:
> open (MAIL, "|/usr/sbin/sendmail -t") || die "Cannot send mail\n";
[snipped and replaced using here doc]
print MAIL <<EOF;
To: $emailto
From: $emailfromName <$emailfrom>
Subject: Proofreadme.com - job #XXXXXXX
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="gc0y0pkb9ex"
--gc0y0pkb9ex
Content-Type: text/plain;
charset=us-ascii\nContent-Transfer-Encoding: 7bit
Hello Everyone!!! This is a test.
--gc0y0pkb9ex
Content-Type: application/msword; name="$filename"
Content-Disposition: attachment;
filename="$filename"
Content-Transfer-Encoding: base64
EOF
As Jonathan said you need another blank line before that EOF
Also you gotta admit it would have been easy to spot your mistake yourself
if you had used the here doc in the first palace?
> open (FILE_FP, "DATA/attachedFile.doc");
Tut tutt. No check to see if opening the file succeded. That's bad. Very bad.
> while (<FILE_FP>){
> print MAIL $_;
> }
> close FILE_FP;
> print MAIL "\n--gc0y0pkb9ex\n";
^
You missed the '--' needed to tell it that's the last boundary. Not sure
if it's strictly necessary but I always add it. You never know when you
might want to toss the whole multipart into another multipart and I think
it is essential then.
As Kragen says read the RFC's, they are invaluable on this subject.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
It's a damn poor mind that can only think of one way to spell a word.
-- Andrew Jackson
------------------------------
Date: Fri, 24 Sep 1999 08:03:23 -0400
From: "Burt Hwang" <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com>
Subject: Re: CGI sending email with attachment
Message-Id: <ZLJG3.6$6S1.304@client>
Yes, I agree using open() without an error is bad. But it was simply a test
and I knew it would open.
As far as the RFCs, where can I read up on this. I don't mind at all
reading up on things but I just didn't know where to look.
And you're right, it does look like there are extra "--" at the end of the
mail.
Thanks again.
I.J. Garlick wrote in message ...
>In article <QzrG3.33$RA1.1835@client>,
>"Burt Hwang" <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> writes:
>> Hi,
>>
>> I have no clue why I can't receive attachments correctly with my email
>> program. I'll get the attachment, but when I open it, it looks nothing
like
>> when I sent it.
>>
>
>Yukk burt. Use here doc syntax it will make debuging this a piece of cake.
>
>>
>> Here's my code:
>> open (MAIL, "|/usr/sbin/sendmail -t") || die "Cannot send mail\n";
>[snipped and replaced using here doc]
>
> print MAIL <<EOF;
>To: $emailto
>From: $emailfromName <$emailfrom>
>Subject: Proofreadme.com - job #XXXXXXX
>MIME-Version: 1.0
>Content-Type: multipart/mixed; boundary="gc0y0pkb9ex"
>
>--gc0y0pkb9ex
>Content-Type: text/plain;
> charset=us-ascii\nContent-Transfer-Encoding: 7bit
>
>Hello Everyone!!! This is a test.
>
>--gc0y0pkb9ex
>Content-Type: application/msword; name="$filename"
>Content-Disposition: attachment;
> filename="$filename"
>Content-Transfer-Encoding: base64
>EOF
>
>As Jonathan said you need another blank line before that EOF
>
>Also you gotta admit it would have been easy to spot your mistake yourself
>if you had used the here doc in the first palace?
>
>> open (FILE_FP, "DATA/attachedFile.doc");
>
>Tut tutt. No check to see if opening the file succeded. That's bad. Very
bad.
>
>> while (<FILE_FP>){
>> print MAIL $_;
>> }
>> close FILE_FP;
>> print MAIL "\n--gc0y0pkb9ex\n";
> ^
>You missed the '--' needed to tell it that's the last boundary. Not sure
>if it's strictly necessary but I always add it. You never know when you
>might want to toss the whole multipart into another multipart and I think
>it is essential then.
>
>As Kragen says read the RFC's, they are invaluable on this subject.
>
>--
>Ian J. Garlick
>ijg@csc.liv.ac.uk
>
>It's a damn poor mind that can only think of one way to spell a word.
> -- Andrew Jackson
>
------------------------------
Date: Fri, 24 Sep 1999 11:31:47 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: Re: Difference between do and require....
Message-Id: <37EB5313.1975EE9B@sophos.com>
Uri Guttman wrote:
>
> >>>>> "BM" == Brian Matchick <matchick@enteract.com> writes:
>
> BM> I'm writing some of my own libraries for some cgi programs and I
> BM> can't figure out the difference between calling do './whatever.pl'
> BM> and require './whatever.pl'. They both seem to do the same thing,
> BM> which is run the code in the file.
>
> BM> Can anyone tell my the differences between the two?
>
> you can't sing "require-be require-be require" and sound cool.
>
Require, or require not: there is no try - as Yoda said :-)
( I may be wrong: is there a try-catch mechanism in Perl ? :-)
> otherwise, rtfm and rtfaq as this is well documented.
>
How cool ! No need to "require" anymore . Just do it (tm)
(see my other thread about "undoing" a require).
Csaba
--
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/>GMU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Fri, 24 Sep 1999 05:20:24 -0700
From: Tim Diller <t.dillerNOvtSPAM@xpres.com>
Subject: Re: Getting the first occurence of a string
Message-Id: <210046ed.20560f08@usw-ex0108-057.remarq.com>
Hi...
My bad, sorry.
Tim
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 24 Sep 1999 11:24:15 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: Re: How can I "undo" a require ?
Message-Id: <37EB514F.E955A760@sophos.com>
Lack Mr G M wrote:
>
> In article <37EA2A18.9CC3277E@sophos.com>, Csaba Raduly <csaba.raduly@sophos.com> writes:
> |>
> |> For each test case there's an automatically generated file with
> |> the expected results:
> |> =========testcase1.exp=======
> |> %expected = {
> |> 'file1.doc', 'virus1',
> |> 'file2.doc', 'virus2',
> |> # etc...
> |> }
> |> =======testcase1.exp end=====
>
> |> # THERE!
> |> require $expfile;
> |>....
> |> close FILE;
> |> undef %expected; # get a fresh start
> |> }
> |>
> |> This doesn't work when I start it with
>
> No. You have undefined %expected, but perl knows that you have
> already read $expfile, so won't do it again unless you tell it to.
>
> Perl keeps a hash of what it has already been require()d to read. It
> is called %INC (read the require section of perlfunc...).
Been there, done that :-)
>
> So, instead of:
>
> undef %expected;
>
> use:
>
> undef %INC{$expfile};
>
Can't use subscript on hash deref at ... near "$expfile}"
(Did you mean $ or @ instead of % ?)
> which will tell perl to forget that you have read it already, and so to
> read it again on the next require.
Not even undef $INC{$expfile}; works this way :-(
$INC{$expfile} is undefined before the require but the hash doesn't
rise from its ashes.
> Since you defined %expected
> absolutely each time you don't need to undef that.
>
I wanted to avoid the two hashes becoming "mixed",
just to be on the safe side.
Csaba
--
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/>GMU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Fri, 24 Sep 1999 11:34:32 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: Re: How can I "undo" a require ?
Message-Id: <37EB53B8.36FCEF95@sophos.com>
Csaba Raduly wrote:
>
> Lack Mr G M wrote:
> >
> > In article <37EA2A18.9CC3277E@sophos.com>, Csaba Raduly <csaba.raduly@sophos.com> writes:
Oh well, all this is futile :-( As I learned from another thread:
No need to require. Just _do_ it :-)
Csaba
--
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/>GMU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Fri, 24 Sep 1999 11:36:55 GMT
From: BernhardMuenzer@cs.com (Bernhard Muenzer)
Subject: Re: HTML to ASCII
Message-Id: <7sfoeb$jf0$1@ssauraaa-i-1.production.compuserve.com>
In article <37EA0FCF.86A26BD4@ktaland.com>, Cyrille <cyrille@ktaland.com> wrote:
>Hi,
>I want to converte HTML to ASCII,
>
>but modules :
> use HTML::FormatText ;
> use HTML::Parse;
>
>doesn't parse TABLE !
In my experience, this combination does parse <TABLE>, but it simply doesn't
render them in tabular form.
This gets a problem when the original HTML code is broken; especially when
<TD> or <TR> tags aren't properly closed or nested. Since HTML::Parse really
parses the code, the content of these broken tables can't be parsed and hence
it doesn't get displayed by HTML::FormatText.
I deal with this problem by replacing row borders with paragraphs, column
borders with whitespace and junking all remaining table related tags before
handing the text to the parser:
use HTML::FormatText ;
use HTML::Parse;
$text =~ s!</tr[^>]*>!<p>!igs;
$text =~ s!<td[^>]*>! !igs;
$text =~ s!<[/]?(table|tbody|tr|td)[^>]*>!!igs;
my $html = parse_html($text);
my $formatter = new HTML::FormatText;
$text = $formatter->format($html);
$text =~ s/\[IMAGE\]//g;
(Did I mention ALT-less IMG tags already?)
The other alternative (shooting Web designers who create broken HTML) is
strongly disapproved by our corporate policy.
--
/* Gesetzestext gesucht? http://www.compuserve.de/recht/gesetze/ */
int m,u,e=0;float l,_,I;main(){for(;1840-e;putchar((++e>907&&942>e?
61-m:u)["\n)moc.isc@rezneumb(rezneuM drahnreB"]))for(u=_=l=0;79-(m=
e%80)&&I*l+_*_<6&&26-++u;_=2*l*_+e/80*.09-1,l=I)I=l*l-_*_-2+m/27.;}
------------------------------
Date: Fri, 24 Sep 1999 14:25:33 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: HTML to ASCII
Message-Id: <q5KG3.660$pn4.3601@news1.online.no>
Bernhard Muenzer <BernhardMuenzer@cs.com> wrote in message
news:7sfoeb$jf0$1@ssauraaa-i-1.production.compuserve.com...
> This gets a problem when the original HTML code is broken; especially
when
> <TD> or <TR> tags aren't properly closed or nested. Since HTML::Parse
really
Bad nesting is of course a problem, but the closing tag on <TD> and <TR>
are optional, so it's not fair to call the HTML code broken if it
doesn't contain closing <T[DR]> tags.
--
Trond Michelsen
------------------------------
Date: Fri, 24 Sep 1999 12:33:48 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: match using scalar
Message-Id: <37EB538C.2156F3A1@ife.ee.ethz.ch>
Dann-o wrote:
>
> I'm trying to use the match function using a scalar rather than a string,
> without success. $country is the value of a field from a web form.
this should work without problems. Are you sure $country contains the
correct value? did you use strict and -w?
> while ($match == 0) {
> foreach $Line (@subs) {if ($Line =~ m/$country/) {
> $test = $Line;
> $match = 1;
> }
> }
> }
>
> Is there a way round this?
If you mean a way round this code, yes
for (@subs) {last if /$country/}
#$_ contains the matched line
- Alex
------------------------------
Date: 24 Sep 1999 05:32:06 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: match using scalar
Message-Id: <m1aeqctrqx.fsf@halfdome.holdit.com>
>>>>> "Dann-o" == Dann-o <druttle@gb.pepperl-fuchs.com> writes:
Dann-o> foreach $Line (@subs) {if ($Line =~ m/$country/) {
Do you really wanna treat $country as a regex? Should a country of
"foo|bar" match either foo or bar? Or "A.B." match "ARBY"?
If not, don't use a regex.
$match = "(.*)"; print "Just another Perl hacker," =~ /$match/;
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 22 Sep 1999 11:52:40 +0200
From: "Maen Suleiman" <maen@packet-technologies.com>
Subject: Re: Method=Post & frames
Message-Id: <7sa8m6$m2b$1@news.netvision.net.il>
Hi ,
I think it's maybe related to CGI as well .. because i open the frames
from a cgi program and not from a html page ,
anyhow thanks :)
David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:37DEB634.8ECF73B@mail.cor.epa.gov...
> Maen Suleiman wrote:
> >
> > Hi to all ,
> >
> > I have this weird phenomena : i have html page with a form inside ,
> > this form call another cgi program that create a html page WITH FRAMES .
the
> > frames sources are both cgi and html pages !
> >
> > the weird thing is , that when the form action method=post , it works
well
> > in the Netscape , but in Explorer it give me "Page not found " Error
> > messages in all of the frames and when i do refresh it it show the
frames
> > well !
> >
> > when the method is not post , it works well ! ,
> >
> > any suggestions ?!
>
> Yes. Your description of the problem indicates that this is
> a browser-related phenomenon, not a CGI or Perl one. So
> you'll probably get the most helpful response in one of the
> Usenet groups which focuses on browsers. This is most likely
> one of those irritating not-quite-conforming-to-the-spec
> problems that constantly crop up with Nyetscape and
> Internet Exploder.
>
> HTH,
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
------------------------------
Date: Fri, 24 Sep 1999 12:16:13 +0200
From: "Peter v. Savigny" <savigny@informatik.uni-hamburg.de>
Subject: Opening a Netscape Composer window from a script
Message-Id: <37EB4F6C.32683292@informatik.uni-hamburg.de>
--------------EEA1138DFC992843F93B4D0C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
is it possible to open a web page in a Netscape Composer window from a
perl-script or from javascript?
Or do I have to let the script open the page in a navigator window and
let the user open it in composer from there?
Thanks for any help with this!
Peter
--
==============================================
Peter v. Savigny
Universitaet Hamburg
savigny@informatik.uni-hamburg.de
http://swt-www.informatik.uni-hamburg.de/~savigny
! neu/new Tel.: 49-40-5494-2306 Fax -2303
==============================================
--------------EEA1138DFC992843F93B4D0C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>is it possible to open a web page in a Netscape Composer window from
a perl-script or from javascript?
<p>Or do I have to let the script open the page in a navigator window and
let the user open it in composer from there?
<p>Thanks for any help with this!
<p>Peter
<pre>--
==============================================
Peter v. Savigny
Universitaet Hamburg
savigny@informatik.uni-hamburg.de
<A HREF="http://swt-www.informatik.uni-hamburg.de/~savigny">http://swt-www.informatik.uni-hamburg.de/~savigny</A>
! neu/new Tel.: 49-40-5494-2306 Fax -2303
==============================================</pre>
</html>
--------------EEA1138DFC992843F93B4D0C--
------------------------------
Date: 24 Sep 1999 11:31:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Opening a Netscape Composer window from a script
Message-Id: <37eb52f6_2@newsread3.dircon.co.uk>
In comp.lang.perl.misc Peter v. Savigny <savigny@informatik.uni-hamburg.de> wrote:
> Hi,
>
> is it possible to open a web page in a Netscape Composer window from a
> perl-script or from javascript?
>
I doubt it but even if it is this a question about the behaviour of the
browser - the fact that you cited two languages whould suggest that
you are aware of this.
You would be better off asking in a group that is interested in the
behaviour of browsers.
[followups set]
/J\
--
"You're blowing me off for a monkey?" - Joey, Friends
------------------------------
Date: 24 Sep 1999 12:36:16 GMT
From: world!swmcd@uunet.uu.net (Steven W McDougall)
Subject: Pod::Tree 1.00 released
Message-Id: <7sfr80$rus$1@play.inetarena.com>
Pod::Tree 1.00 has been released to CPAN.
>From the README:
Pod::Tree - Tree-based POD parser
DESCRIPTION
Modules
Pod::Tree parses a POD into a static syntax tree.
Applications walk the tree to recover the structure and content of
the POD.
Pod::Tree::HTML walks a Pod::Tree and translates it to HTML.
Executables
pod2html translates a POD file into an HTML file.
pods2html walks a directory tree,
translates all the PODs that it finds into HTML files,
and puts the HTML files into a parallel directory tree.
PREREQUISITES
Perl5.004
Exporter
HOW TO BUILD AND INSTALL
Modules
perl Makefile.PL
make
make test
make install
Executables
Copy them to where ever you want them.
TODO
Nothing planned.
Send suggestions, bugs, etc. to swmcd@world.std.com
COPYRIGHT
Copyright 1999 by Steven McDougall. This module is free
software; you can redistribute it and/or modify it under the same
terms as Perl itself.
------------------------------
Date: Fri, 24 Sep 1999 12:19:45 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Printing a list from the bottome to the top verses top to bottom.
Message-Id: <37EB5041.10730424@ife.ee.ethz.ch>
Matt King wrote:
The general answer to all your question is
perldoc perl
> How would can I print a list 'backwords'? For example I have the following:
perldoc -f reverse
or reverse the index:
print $lines[$#lines-$_] for (0..$#lines); #UNTESTED
or use negative indices:
print $lines[-$_] for (1..@lines);
> The file exists, so the error checking isn't there (yes, I know I should add
> it just incase). Any way, how do I make this run from the bottom to the top
> of the file verses from the top to the bottom (as this currently is). Also
> how can I make the loop abort if a 'magic' number (say 12) occurs, but still
> send the output until the number occurs. For example:
perldoc -f last
- Alex
------------------------------
Date: Fri, 24 Sep 1999 13:52:13 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Printing a list from the bottome to the top verses top to bottom.
Message-Id: <7sfmm5$ch4$1@news.uk.ibm.com>
Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote in message
news:37EB5041.10730424@ife.ee.ethz.ch...
> The general answer to all your question is
> perldoc perl
...
> perldoc -f reverse
Thanks, this is an Active Perl (519) installation on Windows 98 so things
are a bit different (I'm not saying that the command doesn't exist, it
does). Also I'm quite new to PERL and I'm still converting from my C days.
It's nice that the Perl language is simuler enough. Makes the transition go
smoother.
Matt
------------------------------
Date: Fri, 24 Sep 1999 12:42:31 GMT
From: amerar@ci.chi.il.us
Subject: Strict?
Message-Id: <7sfrjl$vk0$1@nnrp1.deja.com>
Hello,
I have the following program:
#!/usr/local/bin/perl
use strict;
my $yesterday = time - 24 * 60 * 60;
print +(localtime $yesterday)[6], "\n";
print substr(localtime $yesterday, 0, 3), "\n";
I am really not sure what this 'use strict' does. But this program
calculates the previous weekday. I want to assign that value to a
variable within the program.........
When I try this:
#!/usr/local/bin/perl
use strict;
my $yesterday = time - 24 * 60 * 60;
print +(localtime $yesterday)[6], "\n";
$tmp = +(localtime $yesterday)[6];
print "HI: $tmp\n";
print substr(localtime $yesterday, 0, 3), "\n";
I get this error:
Global symbol "tmp" requires explicit package name at ./test line 8.
Execution of ./test aborted due to compilation errors.
I do not understand. Can someone help? Thanks,
Arthur
amerar@ci.chi.il.us
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 22 Sep 1999 12:31:21 +0200
From: "Yaron Cohen" <chyaron@netvision.net.il>
Subject: using System function to run other programs
Message-Id: <7sab2v$n3u$1@news.netvision.net.il>
im using the System function to run visual basic from perl.
the arguments i pass to function are: "c:\program files\devstudio\vb\vb.exe"
"c:\temp\myproject.vbp" /make
for some reason NT has problems with having 2 arguments in quotes-(on 95 and
98 it works fine).
------------------------------
Date: 24 Sep 1999 12:45:56 GMT
From: fty@utk.edu
Subject: Re: You should be admired
Message-Id: <7sfrq4$go4$1@gaia.ns.utk.edu>
Henry Penninkilampi <spamfree@metropolis.net.au> wrote:
: People, settle!
: The answer to the original question is:
: <A HREF="javascript:document.forms['myForm'].submit();">Make it so!</A>
: Now, that wasn't too painful, was it?
The correct answer for this newsgroup is:
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Pretty;
my $title = qq(How to answer a javascript question in a perl newsgroup);
print
header,start_html($title),h1($title),
start_form(-name=>"myForm",-action=>"/cgi-bin/make_it_so.cgi"),
"What is your Name", textfield('name'), br,
"What is your Quest", textfield('quest'),br,
end_form,
a({-href=>"javascript:document.forms['myForm'].submit();"}, "Make it so!");
end_html;
exit;
__END__
--
--
**********************************************************************
Jay Flaherty fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************
------------------------------
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 898
*************************************