[15525] in Perl-Users-Digest
Perl-Users Digest, Issue: 2935 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 3 14:15:34 2000
Date: Wed, 3 May 2000 11:15:24 -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: <957377724-v9-i2935@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 3 May 2000 Volume: 9 Number: 2935
Today's topics:
Re: Regular Expression and HTML tags (Randal L. Schwartz)
Re: Regular Expression and HTML tags (Ilya Zakharevich)
Re: Regular Expression and HTML tags <Tbone@pimpdaddy.com>
REX vs HTML::Parser (was: Re: Regular Expression and HT <rootbeer@redcat.com>
running perl from command line interface - NT 4.0 <pauls@pauls.seanet.com>
Re: running perl from command line interface - NT 4.0 <lauren_smith13@hotmail.com>
sprintf in CGI jdaves@gilanet.com
Re: sprintf in CGI <blah@nospam.com>
Re: sprintf in CGI nobull@mail.com
Re: tricking the regex syntax (Bart Lateur)
Re: Trouble finding @INC settings FILE ??? push2@my-deja.com
Unicode::Map8 and Unicode::String for Win32 : WHERE TO <asg@natlib.udm.ru>
Re: Want to study programming? <uri@sysarch.com>
Where is a clear, complete explanation of using perldeb (jkroger)
Re: Where is a clear, complete explanation of using per <samay1NOsaSPAM@hotmail.com.invalid>
Re: Where is a clear, complete explanation of using per (jkroger)
where is the getopt::Std module vnguyen_1999@my-deja.com
Re: where is the getopt::Std module <sariq@texas.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 03 May 2000 09:12:19 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Regular Expression and HTML tags
Message-Id: <m1n1m77gv0.fsf@halfdome.holdit.com>
>>>>> "Intergalactic" == Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com> writes:
Intergalactic> Once again I will mention REX, a regular expression
Intergalactic> which may be found on the web by searching for the
Intergalactic> terms "shallow parse" and "XML". Maybe it is not
Intergalactic> "simple", but it's excellent for a task like stripping
Intergalactic> tags, and is at least an order of magnitude faster than
Intergalactic> HTML::Parser.
Is it really faster than the *new* HTML::Parser that is XS based? Or
are you still using old info from back when HTML::Parser was Perl
Regex based? Cuz the new HTML::Parser is an order of magnitude faster
than the old one. :)
--
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: 3 May 2000 16:18:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regular Expression and HTML tags
Message-Id: <8epjfr$rm3$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Bart Lateur
<bart.lateur@skynet.be>],
who wrote in article <390ff1c7.743959@news.skynet.be>:
> Even when compared to HTML::Parser v.3.x? The core of HTML::Parser has
> now been converted into compiled C code, so it ought to run faster than
> the old, plain Perl, module.
I do not think that (?p{}) would be able to beat specially designed C
code (even when handling of (?p{}) is optimized). On the other hand,
having RExen for different HTML "chunks" would allow embedding them in
larger application-specific RExen, which could be much more
convenient than alternatives.
Ilya
------------------------------
Date: 3 May 2000 17:15:59 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: Regular Expression and HTML tags
Message-Id: <8epmsf$27ek$1@news.enteract.com>
merlyn@stonehenge.com writes:
>Intergalactic> Once again I will mention REX, [...]
>
>Is it really faster than the *new* HTML::Parser that is XS based? Or
>are you still using old info from back when HTML::Parser was Perl
>Regex based? Cuz the new HTML::Parser is an order of magnitude faster
>than the old one. :)
To everyone who had this question--no, I don't remember what I tested
it against, though it's unlikely it was HTML::Parser version 3. Also,
I benchmarked it only for one task: stripping tags.
However, I do believe that the difficulty of working with a regex like
that is exaggerated, and there is no need to hide it obsessively from
the user.
More follows...
--
Tushar Samant
------------------------------
Date: Wed, 3 May 2000 08:05:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: REX vs HTML::Parser (was: Re: Regular Expression and HTML tags)
Message-Id: <Pine.GSO.4.10.10005030752220.13677-100000@user2.teleport.com>
On 3 May 2000, Intergalactic Denizen of Mystery wrote:
> >> It's not possible to parse HTML with simple regular expressions; use
> >> HTML::Parser or another module instead.
> Once again I will mention REX, a regular expression which may be
> found on the web by searching for the terms "shallow parse" and
> "XML". Maybe it is not "simple", but it's excellent for a task
> like stripping tags, and is at least an order of magnitude
> faster than HTML::Parser.
I'll agree that it's not simple!
http://www.cs.sfu.ca/~cameron/REX.html
I don't know about faster. But REX is not so easy to install and use as
HTML::Parser - it's not 'strict' compliant, and has many global variables
(although those problems would be easy to fix). It should be made into a
proper module. In fact, if someone wants to put REX into a module that is
a more-speedy replacement for HTML::Parser, I'll cheer for it. I'd suggest
it be called XML::REX, but maybe someone will suggest a better name.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 May 2000 10:30:25 -0700
From: Paul Spitalny <pauls@pauls.seanet.com>
Subject: running perl from command line interface - NT 4.0
Message-Id: <39106231.F85CE930@pauls.seanet.com>
Hi,
I have successfully installed activeware perl. I appended the path
variable on my system ton incoude the directory where all my perl
scripts live. Then I did this:
ASSOC .pl=PerlScript
FTYPE PerlScript=[full path to perl]\perl.exe %1 %*
Let's say I have a fred.pl script that expects two arguments. Now, from
the command line interface , in any directory, I should be able to
type::
fred 2 2 (where 2 and 2 are the args passed by $ARGV[0] and $ARGV[1])
This used to work for me, but now it doesn't. Any tips
thanks,
Paul
--
To respond to this posting, remove -nospam- from my email address.
Sorry for the inconvenience
------------------------------
Date: Wed, 3 May 2000 10:41:20 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: running perl from command line interface - NT 4.0
Message-Id: <8epoba$45n$1@brokaw.wa.com>
Paul Spitalny <pauls@pauls.seanet.com> wrote in message
news:39106231.F85CE930@pauls.seanet.com...
> Hi,
> I have successfully installed activeware perl. I appended the path
> variable on my system ton incoude the directory where all my perl
> scripts live. Then I did this:
>
> ASSOC .pl=PerlScript
> FTYPE PerlScript=[full path to perl]\perl.exe %1 %*
>
> fred 2 2 (where 2 and 2 are the args passed by $ARGV[0] and $ARGV[1])
I don't think Windows executes programs without specifying (sp?) the entire
program name. The exceptions are .exe, .bat, and .com.
fred.pl 2 2
Lauren
------------------------------
Date: Wed, 03 May 2000 15:39:10 GMT
From: jdaves@gilanet.com
Subject: sprintf in CGI
Message-Id: <8eph6q$6ti$1@nnrp1.deja.com>
Hi, all. I'm trying to put a nicely formatted string into a CGI list box
(essentially, to get multiple columns in a list box). I'm using the CGI
modules. My code goes something like this:
#################
use CGI;
$query= new CGI;
$format = "%-30.30s %-30.30s %s-10.10s";
foreach $i (1 .. 10) {
$list[$i] = sprintf($format, $a[$i], $b[$i], $c[$i]);
}
print $query->startform($method, $file, $CGI::URL_ENCODED);
print $query->scrolling_list(-name=>'LIST',
-size=>10,
-multiple=>'true',
--values=>\@list);
print $query->endform;
#Format check
open FILE, '>/tmp/testfile';
foreach (@list) {
print FILE "$_\n";
}
#################
Unfortunately, all the formatting gets lost in the scrolling_list. What
I'd like to do is this:
-Use a fixed font (so things line up)
-Retain spacing as specified in the sprintf format string
Any ideas will be greatly appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 May 2000 18:06:25 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: sprintf in CGI
Message-Id: <39104E81.8C3A91F4@nospam.com>
Hi jdaves,
jdaves@gilanet.com wrote:
> I'm trying to put a nicely formatted string into a CGI list
> box (essentially, to get multiple columns in a list box). I'm
> using the CGI modules. My code goes something like this:
[...]
> Unfortunately, all the formatting gets lost in the scrolling_list.
Are you sure that HTML provides that feature? I am not: your browser
should treat any number of consecutive "blank" character as one only, in
form elements too.
Best regards,
Marco
------------------------------
Date: 03 May 2000 18:09:58 +0100
From: nobull@mail.com
Subject: Re: sprintf in CGI
Message-Id: <u9em7jblw9.fsf@wcl-l.bham.ac.uk>
jdaves@gilanet.com writes:
> Unfortunately, all the formatting gets lost in the scrolling_list. What
> I'd like to do is this:
> -Use a fixed font (so things line up)
> -Retain spacing as specified in the sprintf format string
As it happens I think this has nothing to do with Perl or CGI. It is
a pure HTML problem. Last time I looked (a couple of weeks ago) there
was no solution that worked on a wide variety of browsers.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 03 May 2000 17:00:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: tricking the regex syntax
Message-Id: <39105381.25761362@news.skynet.be>
Daniel Berger wrote:
>I would like to do the following:
>
>$opt = 'i';
>$line =~ /pattern/$opt
>
>Perl doesn't like that (and yes, I've tried different
>permutations of quotes, etc).
>
>Is there a way to make this work? Thanks in advance.
There is an alternative: see the "(?: ... )" syntax in "perlre". You can
put the options between the question mark and the colon.
/(?i:pattern)/
or, apparently, also:
/(?i)pattern/
However, applying this directly to your problem, the result,
"/(?$opt:pattern)/" or "/(?$opt)pattern/" will suffer the same problem
as "/$pattern/": there's a need to compile the regex every time you try
to match anything. The //o option would help, but then, you can't
recompile, not in the same script run anyway.
--
Bart.
------------------------------
Date: Wed, 03 May 2000 17:22:25 GMT
From: push2@my-deja.com
Subject: Re: Trouble finding @INC settings FILE ???
Message-Id: <8epn7u$e2k$1@nnrp1.deja.com>
If you have the most recent version of active perl installed, cd to the
perl directory type ppm at the prompt. Once prompted type install dbi,
select yes and wait. Then you will probably need to type install
dbd-odbc select yes and wait. That should take care of it for you.
Activeperl is not installing that module by default, i dont know why.
thanks,
push
In article <8daesb$os3$1@nnrp1.deja.com>,
end3r@my-deja.com wrote:
>
> > end3r@my-deja.com writes:
> > > My Question:
> > > Where do I find this @INC variable, that I can add
> > > the path for this DBI.pm file ?
> >
> > Your questions are answered in Section 8 of the FAQ:
> >
> Thank you,
> I found this article. However, I still don't have
> a slightest clue, which file to add these lines to ?
>
> The document didn't express that in any way.
>
> Could somebody please enlighten me with this one ?
>
> P
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 3 May 2000 17:10:40 GMT
From: Sergey Aleshin <asg@natlib.udm.ru>
Subject: Unicode::Map8 and Unicode::String for Win32 : WHERE TO GET?
Message-Id: <8epmig$cqt$1@natlib.udm.ru>
Hello All!
Does anyone know where to get prebuilt Unicode:;* modules for Win32?
To use with ActiveState Perl.
--
Sergey Aleshin
e-mail: asg@natlib.udm.ru
------------------------------
Date: Wed, 03 May 2000 15:41:15 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Want to study programming?
Message-Id: <x7d7n3y739.fsf@home.sysarch.com>
>>>>> "p" == ping29007670 <ping29007670@my-deja.com> writes:
p> Would you like to study your preferred
p> programming language as a self teacher and make
p> quick progresses in order to conquer the cyberspace?
i wanna conquer cyberspace just like uncle bill did!!
p> There is a shortcut available:
p> start studying the simple and elegant language used in the Nasa
p> space shuttles: Forth.
forth is my preferred language? and is that why the shuttle is always
delayed? did they use forth on mir?
p> It gives you complete control over your computer and, as it shows
p> what is behind the scenes, makes the move to any other language
p> easy, even to Java.
any other postfix language, maybe.
p> Compiler and book are for free.
big whoop!! so is gcc.
p> Free email support also possible.
possible? not guaranteed? no free help desk? i won't learn it!
oddest spam we have seen here in a while. who proseletyzes forth for no
reason but a loonie?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 03 May 2000 12:12:52 -0400
From: jkrogerSPAMBLOCKER@earthlink.net (jkroger)
Subject: Where is a clear, complete explanation of using perldebug?
Message-Id: <jkrogerSPAMBLOCKER-0305001212520001@tritone.csbmb.princeton.edu>
I have before me Learning Perl, Perl Cookbook, and Programming Perl. I
also have open in a window perldoc perldebug.
Nowhere are any clear explanations of how to debug using the debugger. For
example, how do you look at the value of a variable? Nowhere can I find a
description, leave alone an *example* or two, showing how.
Thanks in advance for any help/pointers. It's not practical to use this
newsgroup every time I have a new question about the debugger; I have
several now.
It's easy to see why unix is not ready for prime time; this even though
I've been using it for 20 years off and on. Even $100+ worth of O'reilly
books don't help.
Thanks
Jim
------------------------------
Date: Wed, 03 May 2000 09:33:23 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: Where is a clear, complete explanation of using perldebug?
Message-Id: <021ce718.82ff3d07@usw-ex0104-031.remarq.com>
How to look at value of variable::
from Perldoc Perldebug
p expr Same as print {$DB::OUT} expr in the current
package. In particular, because this is just
Perl's own print function, this means that
nested data structures and objects are not
dumped, unlike with the x command.
The DB::OUT filehandle is opened to /dev/tty,
regardless of where STDOUT may be redirected to.
* 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: Wed, 03 May 2000 12:53:01 -0400
From: jkrogerSPAMBLOCKER@earthlink.net (jkroger)
Subject: Re: Where is a clear, complete explanation of using perldebug?
Message-Id: <jkrogerSPAMBLOCKER-0305001253010001@tritone.csbmb.princeton.edu>
In article <021ce718.82ff3d07@usw-ex0104-031.remarq.com>, Samay
<samay1NOsaSPAM@hotmail.com.invalid> wrote:
> How to look at value of variable::
>
> from Perldoc Perldebug
>
>
> p expr Same as print {$DB::OUT} expr in the current
> package. In particular, because this is just
> Perl's own print function, this means that
> nested data structures and objects are not
> dumped, unlike with the x command.
>
> The DB::OUT filehandle is opened to /dev/tty,
> regardless of where STDOUT may be redirected to.
>
>
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
Thanks, I appreciate it. However, only a subset of aspiring perl
programmers would understand that "p expr" can be used to see the value of
a variable, or why it works.
Where is documentation on the debugger which is not intended for
unix/c/etc professionals? Which is intended for all beginning perl
programmers?
Thanks
Jim
------------------------------
Date: Wed, 03 May 2000 15:47:03 GMT
From: vnguyen_1999@my-deja.com
Subject: where is the getopt::Std module
Message-Id: <8ephlg$7ct$1@nnrp1.deja.com>
Hello Everyone,
I want to download the getopt::Std module but could not find in CPAN. If
you find it, please let me know. I tried to down load the getopt:mixed.
this module is bad. it's absolutely confused.
Thanks
Van
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 03 May 2000 11:13:45 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: where is the getopt::Std module
Message-Id: <39105039.2ECB9391@texas.net>
vnguyen_1999@my-deja.com wrote:
>
> Hello Everyone,
>
> I want to download the getopt::Std module but could not find in CPAN.
I don't know how you missed it on CPAN. It's included in the standard
Perl distribution.
- Tom
------------------------------
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 2935
**************************************