[19370] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1565 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 19 14:05:34 2001

Date: Sun, 19 Aug 2001 11:05:08 -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: <998244308-v10-i1565@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 19 Aug 2001     Volume: 10 Number: 1565

Today's topics:
        array question <henrytti@softhome.net>
    Re: array question <ilya@martynov.org>
    Re: array question <mbudash@sonic.net>
        capturing command line error or output from `<command>` <jagman@h80.c960693-a.plano1.tx.home.com>
    Re: capturing command line error or output from `<comma <ilya@martynov.org>
    Re: CODE reference to member function of package Confus <ilya@martynov.org>
        Compile a perl programm <famili@svs.ru>
    Re: Compile a perl programm <benz.ben@wanadoo.fr>
    Re: Compile a perl programm <bart.lateur@skynet.be>
    Re: dec2hex conversion ,uninitialized value <stephen@oxnee.com>
    Re: dynamic variable question <bart.lateur@skynet.be>
        FAQ: How can I pull out lines between two patterns that <faq@denver.pm.org>
    Re: Finding keywords in text files (shaz)
    Re: Hash of Complex Records <mark.riehl@agilecommunications.com>
    Re: Hash of Complex Records <samneric@tigerriverOMIT-THIS.com>
        HTMLView 0.9 - make web interfaces to relational SQL da (Haakan Ardoe)
    Re: Is element in array <pne-news-20010819@newton.digitalspace.net>
    Re: Search the pattern with Perl Regular Expression <bart.lateur@skynet.be>
    Re: Search the pattern with Perl Regular Expression <Tassilo.Parseval@post.rwth-aachen.de>
    Re: String Parsing > Remove everything after the first  <mbudash@sonic.net>
    Re: This is not a question ... call me slow if you like <iltzu@sci.invalid>
        Webserver environment settings <Pcmann1@btinternet.com>
    Re: Webserver environment settings <Tassilo.Parseval@post.rwth-aachen.de>
        xml::Parser <fpourki@gmx.de>
    Re: xml::Parser (Eric Bohlman)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 19 Aug 2001 12:50:11 -0700
From: "Mr bad luck" <henrytti@softhome.net>
Subject: array question
Message-Id: <tnvr0m22iiak92@corp.supernews.com>

how can I tell how many elements my array has after I read a text file into
it

the text file my have 10 to 25 lines after I load it into a array
I want to count the elements of the array




------------------------------

Date: 19 Aug 2001 20:51:44 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: array question
Message-Id: <874rr49en3.fsf@abra.ru>


bl> how can I tell how many elements my array has after I read a text
bl> file into it

bl> the text file my have 10 to 25 lines after I load it into a array
bl> I want to count the elements of the array

my $count = @array;

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


------------------------------

Date: Sun, 19 Aug 2001 16:50:21 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: array question
Message-Id: <mbudash-DC3AA4.09503119082001@news.sonic.net>

In article <tnvr0m22iiak92@corp.supernews.com>, "Mr bad luck" 
<henrytti@softhome.net> wrote:

> how can I tell how many elements my array has after I read a text file 
> into
> it
> 
> the text file my have 10 to 25 lines after I load it into a array
> I want to count the elements of the array
> 
> 

if this isn't a FAQ, i oughta be... 

$elements = @array; # returns count in a [forced] scalar context

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: Sun, 19 Aug 2001 14:46:54 GMT
From: "JagMan" <jagman@h80.c960693-a.plano1.tx.home.com>
Subject: capturing command line error or output from `<command>`
Message-Id: <20010819.094933.76065818.8629@h80.plano1.tx.home.com>

I needs to capture both error and/or output generated by a command line
using ``.

Example:

@snmpget = `snmpget <ip> <comm> OID`;

This does not capture errors.  How can I capture errors from a command
line.

TIA!
JM


------------------------------

Date: 19 Aug 2001 19:11:58 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: capturing command line error or output from `<command>`
Message-Id: <87zo8w9j9d.fsf@abra.ru>


J> I needs to capture both error and/or output generated by a command line
J> using ``.

J> Example:

J> @snmpget = `snmpget <ip> <comm> OID`;

J> This does not capture errors.  How can I capture errors from a command
J> line.

See 'perldoc -q capture'

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


------------------------------

Date: 19 Aug 2001 14:33:00 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: CODE reference to member function of package Confusing..
Message-Id: <87elq8e3vn.fsf@abra.ru>


KP> Hi,
KP>         I've found many modules using some callback functions such as

KP> $obj->set_handler('on_clicked',\&clicked);

KP> this work with most programs. Users can set callback handlers to their 
KP> functions. But when I try to bind the callback to my method in a package
KP> I can't do something like this:

KP> $obj->set_handler('on_clicked', \&{$self->clicked} );

$obj->set_handler('on_clicked', sub {$self->clicked} );

KP> this is not work,

KP> what should I do?
KP> suggestion please...

KP> Regards,
KP> u40kpp.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


------------------------------

Date: Sun, 19 Aug 2001 19:16:37 +0400
From: "Andreus" <famili@svs.ru>
Subject: Compile a perl programm
Message-Id: <9loksj$2krb$1@josh.sovintel.ru>

Hello!
Could u help me solve the problem: is there a way to compile a perl programm
under
Win'98 so that i could use it in a computer without Perl installed?
Thank u!




------------------------------

Date: Sun, 19 Aug 2001 19:15:15 +0200
From: Benzakoun <benz.ben@wanadoo.fr>
Subject: Re: Compile a perl programm
Message-Id: <B7A5C0C2.2BFD%benz.ben@wanadoo.fr>

> Hello!
> Could u help me solve the problem: is there a way to compile a perl programm
> under
> Win'98 so that i could use it in a computer without Perl installed?
> Thank u!
You can use perl2exe (look at www.indigostar.com)

J. Benzakoun



------------------------------

Date: Sun, 19 Aug 2001 17:23:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Compile a perl programm
Message-Id: <aftvnt82idkceds8fmqts1qgqc5f7srva3@4ax.com>

Andreus wrote:

>Could u help me solve the problem: is there a way to compile a perl programm
>under Win'98 so that i could use it in a computer without Perl installed?

It's not really compiling, and it's not free, but it looks like it does
what you want, it integrates script, modules, and even DLL's into one
executable. The product is called "perl2exe" and it can be gotten from
<http://www.indigostar.com/perl2exe.htm>. You can try it out to test if
it does what you want.

-- 
	Bart.


------------------------------

Date: Sun, 19 Aug 2001 22:14:21 +1000
From: Stephen Lohning <stephen@oxnee.com>
Subject: Re: dec2hex conversion ,uninitialized value
Message-Id: <3B7FAD9D.18792D2E@oxnee.com>

I was pretty sure there must be a better way to do it Thanks.

"John W. Krahn" wrote:

> Stephen Lohning wrote:
> >
> > This function works but comes back with a warning uninitialized value
> > at hexStr, any idea why ?
> > And does anyone know how to get pack unpack to do decimal to hex string
> > conversions ?
> >
> > Thanks
> >
> > sub dec2hex{
> > my $dec = pop @_;
> > my $width = pop @_;
> > my @hex =
> > ("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
> > my @hexStr = ();
> > my $stringIndex = ();
> > $stringIndex =0;
> > #if( $dec >= 0 && $dec <= 0xFFFFFFFF){
> > my $k = ();
> >   # @hexStr =();
> >     for($k = 0; $k < $width; $k++){
> >       $stringIndex = $dec % 16;
> >       $hexStr[($width-$k)] = $hex[$stringIndex];
> >       if( ( $dec - $stringIndex) >0){
> >          $dec = ($dec - $stringIndex)/16;
> >       }else{
> >          $dec = 0;
> >       }
> >     }
> >
> > #}
> > my $retStr = (join '',@hexStr); <--
> > return $retStr;
> > }
>
> sub dec2hex {
>     my $dec = pop @_;
>     my $width = pop @_;
>
>     return substr( sprintf( "%0${width}X", $dec ), -$width );
>     }
>
> John
> --
> use Perl;
> program
> fulfillment



------------------------------

Date: Sun, 19 Aug 2001 11:55:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: dynamic variable question
Message-Id: <8davnto18f81hlaf9uvtv5i64q84tb14kb@4ax.com>

Zachary Kent wrote:

>I have this code in my script quoting data stored in variables for an SQL
>database.  Instead of quoting the value of the variable itself, I would like
>to make a new variable for the quoted value

Why aren't you using placeholders instead?

-- 
	Bart.


------------------------------

Date: Sun, 19 Aug 2001 12:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How can I pull out lines between two patterns that are themselves on different lines?
Message-Id: <17Of7.245$V3.171113984@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How can I pull out lines between two patterns that are themselves on different lines?

    You can use Perl's somewhat exotic ".." operator (documented in the
    perlop manpage):

        perl -ne 'print if /START/ .. /END/' file1 file2 ...

    If you wanted text and not lines, you would use

        perl -0777 -ne 'print "$1\n" while /START(.*?)END/gs' file1 file2 ...

    But if you want nested occurrences of "START" through "END", you'll run
    up against the problem described in the question in this section on
    matching balanced text.

    Here's another example of using "..":

        while (<>) {
            $in_header =   1  .. /^$/;
            $in_body   = /^$/ .. eof();
            # now choose between them
        } continue {
            reset if eof();         # fix $.
        } 

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           06.03
-- 
    This space intentionally left blank


------------------------------

Date: 19 Aug 2001 09:08:13 -0700
From: ssa1701@yahoo.co.uk (shaz)
Subject: Re: Finding keywords in text files
Message-Id: <23e71812.0108190808.65b17919@posting.google.com>

If you save the data in the example file to read.txt and run the code,
you should get the ouptput of the form

tag /NN
   book (2)
   tab (1)
   file (2)

tag /NNS
   report (1)


These are individual words (keywords). I would like the program to try
and find combinations of words.

ie

read file (1)       - read/NN followed by file/NN 
final report (1)


------------------------------

Date: Sun, 19 Aug 2001 13:06:34 GMT
From: "Mark Riehl" <mark.riehl@agilecommunications.com>
Subject: Re: Hash of Complex Records
Message-Id: <uROf7.3640$gf.1856491@typhoon2.gnilink.net>

I fixed the exists problem, as you said, it was something else (didn't chomp
after reading the data from the input file).

OK, I removed the records key, so my data should now look like this:

 my %LocationData = (
    1001 => [
       { time => "8456823", lat => "35.311", long => "-116.4101", },
       { time => "8456824", lat => "35.312", long => "-116.4201", },
       { time => "8456825", lat => "35.313", long => "-116.4301", },
    ],
 };

If I use the following:

my ($key);
for $key (keys %LocationData) {
     print "\$key = $key\n";
}

I can loop through and see all the keys.  I'm close to figuring this out,
but I'm having trouble extracting the data.

Two questions - how do I display a count of the time, lat, long records for
each key?  Also, how do I loop through all the keys and display the data for
each key?  I thought I'd be able to do the following to see one record:

my ($key);
for $key (keys %LocationData) {
    print "$LocationData{$key}[0]{time}\n";
}

How would I loop through all the records for a key?

Thanks,
Mark






"Samneric" <samneric@tigerriverOMIT-THIS.com> wrote in message
news:MPG.15e924f2de99d511989688@news.usit.net...
> Mark Riehl wrote:
> > Question - how do I use exists() to see if a vehicle is in the
LocationData
> > hash?  I tried the following:
> >
> > if (exists ($LocationData{1001}) ) {
> >     ...
> > }
> >
> > But this isn't working.
>
> If your example code wasn't copied from your actual code, then your
example
> doesn't reflect the problem that you encountered (and is actually better-
> written). If the code within the "if" block didn't give you what you
expected,
> then maybe that's why you assumed that the condition wasn't being met.
>
> This works, and it reflects your own example:
>
> ************
> #!/usr/bin/perl -w
> use strict;
>
> my %LocationData = (
>   1001 => {
>     records => [
>       { time => "8456823", lat => "35.311", long => "-116.4101", },
>       { time => "8456824", lat => "35.312", long => "-116.4201", },
>       { time => "8456825", lat => "35.313", long => "-116.4301", },
>     ],
>   },
> );
>
> if (exists ($LocationData{1001})) {
>    print "Time 0: $LocationData{1001}{records}[0]{time}\n";
> }
> else {
>    print "1001 does not exist\n";
> }
>
> ********
> Time 0: 8456823
>
> ********
>
> BTW, unless you want to add another key to %{$LocationData{1001}}, then
that
> hash containing the single "records" key is an un-needed level of
complexity.
>
> my %LocationData = (
>    1001 => [
>       { time => "8456823", lat => "35.311", long => "-116.4101", },
>       { time => "8456824", lat => "35.312", long => "-116.4201", },
>       { time => "8456825", lat => "35.313", long => "-116.4301", },
>    ],
> };




------------------------------

Date: Sun, 19 Aug 2001 11:17:06 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: Hash of Complex Records
Message-Id: <MPG.15e9a260ea2b396098968a@news.usit.net>

Mark Riehl wrote:

>  my %LocationData = (
>     1001 => [
>        { time => "8456823", lat => "35.311", long => "-116.4101", },
>        { time => "8456824", lat => "35.312", long => "-116.4201", },
>        { time => "8456825", lat => "35.313", long => "-116.4301", },
>     ],
>  };

");" -> hoof error :)

> Two questions - how do I display a count of the time, lat, long records for
> each key?  Also, how do I loop through all the keys and display the data for
> each key?  I thought I'd be able to do the following to see one record:

foreach my $vid (keys %LocationData) {          # each vehicle id
   print "Vehicle ID: $vid\n";
   foreach my $rec ( @{$LocationData{$vid}} ) { # each $rec is hashref
      print "Time: $rec->{time}\n";
      print "Lat:  $rec->{lat}\n";
      print "Long: $rec->{long}\n\n";
   }
   print "\n";
}


------------------------------

Date: 19 Aug 2001 11:48:55 GMT
From: hakan@debian.org (Haakan Ardoe)
Subject: HTMLView 0.9 - make web interfaces to relational SQL databases
Message-Id: <tnvknbkrvtotc7@corp.supernews.com>

It's finaly here! The now so long promised new release of HTMLView,
0.9. I beleave that I've included all the patches I've recieved
so far, but if you've sent me something and it's not here, please let
me know. Thankyou all for spending your time on HTMLView.

The main news this time is the introduction of compiled fmts which
execute very fast and has a few new fmt tags which gives you more
control of the selects made.

HTMLView is a set of modules to handle relational SQL databases
through a DBI interface and create web user interfaces to them. Among
it's features are the possibility to handle relations in the same
manner as fields and it is easily extended with additional field or
relation specifications as well as custom editors and viewers.

HTMLView contains a query language based on SQL, but extended to allow
easy inclusion of relations in the queries. Say you have a Users
table with an N2N relation, called grp, to a Groups table you can select
users from the Users table based on the name field in the Groups
table by selecting on grp->name (eg "grp->name = 'sudo'" would match
all users belonging to the group named sudo while "grp->gid = 27" would
match all users belonging to the group with gid 27).

There is also a fmt language used to specify how the data in a post
or a set of posts should be presented. It works in a template like way
with a html like format, and it can be specified on a PostSet, Post or
Relation/Field level.

It's most frequent use is that it allows you to write a fmt file and
in it place a "<node>...</node>" construct, which will repeat the
"..." part for every post that's supposed to be viewed. It can contain
"<fld name>" tags which will be replaced by the fld (field or relation)
named name. It's also possible to specify how that data in an fld
should be viewed by instead using the "<fmt name>...</fmt>" where
"..." is a new fmt string used to view the fld. This is especially 
useful for relations as it allows you to specify exactly how the
related posts should be presented.

It's also possible to insert perl code that's executed using
"<perl>...</perl>" constructs. Se the README.fmt file for a complete
description of the language.

News in this version is:

 * Added push and pop functions for the presentation of the fmt
   templates to produce an hierarchical interface, much like 
   common pop-up requesters.
 * Added README.compiled_fmt describing the special tags avalible 
   in a compiled fmt.
 * <sql_val ...> added, which is used to select some arbetrary sql
   command and insert into fld.
 * <fld ...> and <fmt ..> now takes options as name=value which  
   then are accessable in the below fmt as <var name>.
 * Added fld options makeing <fld file=filename field> the same as
   <fmt field>contetnt of file filenmae</fmt>. <fld file=filename>
   would be a normal file include.
 * Bj<F6>rn Ard<F6> <f98ba@efd.lth.se> has added:
     + no_create option to N2N to prevet automatic linktable creation
     + $dbi->print_only debug mode (See HTMLView::DB man page)
     + Apache mod_perl support for compiled fmts
     + extra_{select,from,where} options to SubTab
 * Giuseppe Costantino <costanti@students.cs.unibo.it> has contributed
   with quite som additions, including:
     + Multilevel ordering in CGIListView
     + Easy to use filtering in CGIListView
     + Loggin of all database modifications, simply set a logfilename by
       $dbi->setlogfile('filename');
     + Oracle support, simply use OracelDB instead of mysqlDB or msqlDB
     + Client side javascript sainty checks fld and table specifik (see
       exmaple .js files)
     + Server side perl sainty checks in View.cgi, place in checkparam.
 * Speeded up seraches that returns a lot of data.
 * Added a new relationtype called SubTab allowing posts to contain
   a list of posts form a related table.
 * Added a short_add feature that lets you specify a fld that
   describes a add form which is placed at the bottom of the 
   table listing (see config.pm for eaxmple).
 * Added a $opt param to the Table constructor to give a few options
   to it. Currently there are options for specifying which fields to
   view in a listing (flds_to_view), how many rows per page should   
   be used (rows) and for the short_add feature described above.
 * Added support for searching multi level relations, eg
   Lnk->Link->testf=7.
 * Optimized fmt handling viewing an fmt with only fields are now 
   72% faster. The same optimations should be appliable for relations.
 * Added an Order fld that allows you to specify one order the posts
   can be displayed in.
 * Moved the viewer pointer to the DB class where it's accessable 
   from everywhere as db->viewer. Which means you should add the
   following line to old View.cgi scripts before $v->view_html
   is called: 
     if ($v->isa('DBIx::HTMLView::CGIView')) {$dbi->viewer($v);}
 * Added a N2NOrder field that relates a post to a set of posts
   from another table in a specifik order.
 * Added a compiler (comp.pl) that compiles a fmt and a search string
   into a perlscript that executes up to 8 times faster than
   Formated2.cgi. Not all features are supported in compiled fmts
   though.
 * Added support to make abetrary selects from compiled fmts
   using <sql_select from=... where=... extra=...> construcst.
 * Added support for <fld ...> tags within <perl>...</perl> code
   in compiled fmt's.
 * Perl code in <perl>...</perl> tags are no longer executed with
   use strict vars, and all code are executed in the same context
 * Perl code in <perl>...</perl> tags are no longer executed with
   use strict vars, and all code are executed in the same context
   (package fmt_code).

You'll find the distribution at CPAN in:

   authors/id/H/HA/HAKANARDO/DBIx-HTMLView-0.9.tar.gz

Or if the mirrors are not updated yet you can pick it up by ftp from
hobbe.lub.lu.se in /pub/CPAN/DBIx-HTMLView-0.9.tar.gz.

--
Hakan Ardo <hakan@debian.org>, http://master.debian.org/~hakan




------------------------------

Date: Sun, 19 Aug 2001 14:02:39 +0200
From: Philip Newton <pne-news-20010819@newton.digitalspace.net>
Subject: Re: Is element in array
Message-Id: <ajavntk3pfo6svgabige3n8jqp9jank0c5@4ax.com>

[alt.perl removed]

On 19 Aug 2001 09:02:41 GMT, Tassilo.Parseval@post.rwth-aachen.de
(Tassilo v. Parseval) wrote:

> my %seen;
> $seen{$_}++ for (@bla);

Or even: "@seen{@bla} = ();" -- since you're testing with exists, you
don't need to assign anything special.

> In case you are lazy you could also use grep:
> 
> if (grep {$_ eq 'two} @bla) { print "Yes, it is there" }

Or a tiny bit faster as: if(grep $_ eq 'two', @bla) { ... }, using grep
EXPR LIST rather than grep BLOCK LIST.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Sun, 19 Aug 2001 12:16:38 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Search the pattern with Perl Regular Expression
Message-Id: <s1bvntgv3piavgj63evjgiqoq8sb7k0udi@4ax.com>

Tassilo von Parseval wrote:

>Yet, I remember when I started with Perl (it was CGI stuff that brought 
>me to Perl). I quickly needed something for HTML and HTML::Parser 
>sounded pretty promising. But HTML::Parser is pretty unusable for a 
>beginner. Thinking back to the manpages I read it talked about 
>subclassing HTML::Parser which left me with a big blank on my face.

Have you seen Jonathan Stowe's example code?

	<http://www.gellyfish.com/htexamples/>


>Thus, I'd recommend HTML::TokeParser that also comes with docs that 
>actually include some useful and almost ready-to-do examples. I always 
>missed that in HTML::Parser.

I'm not going to comment on the (lack of) examples, but I too find the
approach HTML::TokeParser to be far more intuitive for a non-OO-obsessed
programmer.

-- 
	Bart.


------------------------------

Date: Sun, 19 Aug 2001 15:01:09 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Search the pattern with Perl Regular Expression
Message-Id: <3B7FB895.6060706@post.rwth-aachen.de>

Bart Lateur wrote:

> Tassilo von Parseval wrote:
> 
> 
>>Yet, I remember when I started with Perl (it was CGI stuff that brought 
>>me to Perl). I quickly needed something for HTML and HTML::Parser 
>>sounded pretty promising. But HTML::Parser is pretty unusable for a 
>>beginner. Thinking back to the manpages I read it talked about 
>>subclassing HTML::Parser which left me with a big blank on my face.
>>
> 
> Have you seen Jonathan Stowe's example code?
> 
> 	<http://www.gellyfish.com/htexamples/>


No, that's new too me. Looking at some of the snippets, HTML::Parser 
does not look that unusable at all any longer.
Thanks for this link, might get handy for me at some time!

Tassilo
-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



------------------------------

Date: Sun, 19 Aug 2001 16:44:14 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: String Parsing > Remove everything after the first non-number
Message-Id: <mbudash-FAAA7F.09442319082001@news.sonic.net>

In article <Cozf7.5228$c81.1759461@news1.rdc1.md.home.com>, "David 
Hilsee" <davidhilseenews@yahoo.com> wrote:

> "Stephen Deken" <shutupsteve@awdang.no.thanks.com> wrote in message
> news:tntfqatgfqd645@corp.supernews.com...
> > rubbish_tip@hotmail.com (DB) wrote:
> > > ...just everything up to, but not including the "%".
> >
> >
> > "Michael Budash" <mbudash@sonic.net> wrote:
> > > $string =~ s/%.*$//;
> >
> > He meant:
> >
> >   $string =~ s/%.*$/%/;
> >
 
no - that would include the '%', which the OP said he didn't want...

> > --sjd;
> >
> 
> Actually, I think both of these are geared toward the example and not
> towards the general problem that the OP had.
> 
> He said "I need a snippet of a regex to remove everything after the first
> non-number in a string.".

argh, i agree... i typed too soon... 8^\
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: 19 Aug 2001 17:30:47 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: This is not a question ... call me slow if you like...
Message-Id: <998242240.15405@itz.pp.sci.fi>

In article <slrn9nu32o.3ga.mgjv@martien.heliotrope.home>, Martien Verbruggen wrote:
>On 18 Aug 2001 20:45:35 GMT,
>	Ilmari Karonen <iltzu@sci.invalid> wrote:
>> 
>> y/n/\n/,s/\d+/$"x$&/eg,print for qw'n4|9|21|3|n1\2||2|(_-<2_|4_`1|3\3_1\2_|3\3
>> -_)2_|n\__/\_,_|___/\__|2\__,_|_|1_|\___/\__|_|1_|\___|_|nn4_1\9|3|14|n4__/1-_
>> )2_|1|5\3_`1|2_|1!1/2-_)2_|n3_|1\___|_|2_|2_|1_|\__,_|\__|_i_\\\___|_|1)n45/n'
>> 
>> Hey, it even fits in three lines.
>
>Under Perl 5.00503, yes. Under 5.6.0 it doesn't work.

Oops.  Well, that can be fixed, and it even saves a stroke!

s''n4|9|21|3|n1\2||2|(_-<2_|4_`1|3\3_1\2_|3\3-_)2_|n\__/\_,_|___/\__|2\__,_|_|
1_|\___/\__|_|1_|\___|_|nn4_1\9|3|14|n4__/1-_)2_|1|5\3_`1|2_|1!1/2-_)2_|n3_|1\
___|_|2_|2_|1_|\__,_|\__|_i_\\\___|_|1)n45/n',y/n\n/\n/d,s/\d+/$"x$&/eg,print

And it can be made warnings-free too, at the cost of that one keystroke.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



------------------------------

Date: Sun, 19 Aug 2001 17:55:48 +0100
From: "Peter Mann" <Pcmann1@btinternet.com>
Subject: Webserver environment settings
Message-Id: <9lor0i$75d$1@neptunium.btinternet.com>

Dear All,
I am trying to locate a relevant library/module to help attain information
relating to a webserver.

I have found plenty of scripts that reside on a webserver and provide
information about your web server, including your perl version, environment
variables, perl version, server time, etc.

However, I am looking to do this remotely. Does anyone have any suggestions
for a relevant library/module to assist with this.

Thanks in advance
- Pete




------------------------------

Date: Sun, 19 Aug 2001 19:56:07 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Webserver environment settings
Message-Id: <3B7FFDB7.6080208@post.rwth-aachen.de>

Peter Mann wrote:

> Dear All,
> I am trying to locate a relevant library/module to help attain information
> relating to a webserver.
> 
> I have found plenty of scripts that reside on a webserver and provide
> information about your web server, including your perl version, environment
> variables, perl version, server time, etc.
> 
> However, I am looking to do this remotely. Does anyone have any suggestions
> for a relevant library/module to assist with this.

I am not sure whether this is usually handled by Perl. On my apache 
webserver, I can retrieve most of the relevant Information with loading 
mod_info and mod_status just by accessing two sites on my server 
(/server-status and /server-info).

Which webserver are you running?

Tassilo
-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



------------------------------

Date: Sun, 19 Aug 2001 16:07:50 +0200
From: pourki <fpourki@gmx.de>
Subject: xml::Parser
Message-Id: <3B7FC836.7A102402@gmx.de>

I've got an *.xml file and want to make
a formatted text file out of that. The format is specied in an *.xsl
file. How can i do this with perl xml::Parser module?


------------------------------

Date: 19 Aug 2001 15:11:07 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: xml::Parser
Message-Id: <9lokub$9pa$2@bob.news.rcn.net>

pourki <fpourki@gmx.de> wrote:
> I've got an *.xml file and want to make
> a formatted text file out of that. The format is specied in an *.xsl
> file. How can i do this with perl xml::Parser module?

Using XML::Parser probably isn't the way to go here, as the only Perl XSLT 
module I know of that interfaces to it is XML::XSLT, which is still rather 
incomplete.  If it were me, I'd use XML::LibXML and XML::LibXSLT (the 
latter depends on the former), but that's just because I'm most familiar 
with those.  There's also XML::Sablotron and I believe there's an XML 
interface to Xalan floating around as well.



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1565
***************************************


home help back first fref pref prev next nref lref last post