[12184] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5784 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 26 05:07:22 1999

Date: Wed, 26 May 99 02:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 May 1999     Volume: 8 Number: 5784

Today's topics:
    Re: [perlfunc][perldata] access to data structures (Dave Cross)
    Re: [perlfunc][perldata] access to data structures zenin@bawdycaste.org
    Re: [perlfunc][perldata] access to data structures <uri@sysarch.com>
    Re: database backed perl function <office@asc.nl>
        Get spaces off. (PaulK)
        hash of array ? tvn007@my-dejanews.com
    Re: hash of array ? (Andrew Johnson)
    Re: hash of array ? (Dave Cross)
    Re: Ho to get started with Tk on Win32? <c4jgurney@my-dejanews.com>
    Re: leeches, compilers, and perl, oh my (all mine?) <jcl_n0spam@mail.ocis.net>
    Re: More Oraperl pain <scancm@biobase.dk>
    Re: newbi: UNIX to NT (Larry Rosler)
    Re: Perl "constructors" (Brendan O'Dea)
    Re: Perl "constructors" (Alan Curry)
    Re: Perl and MySQL (Dave Cross)
        Perl equivalent of c++ "struct" steveeq1@earthlink.net
    Re: Perl equivalent of c++ "struct" (Dave Cross)
    Re: RDF parser for My Netscape type RDF <larsga@ifi.uio.no>
    Re: removings " "s from strings <daniel.vesma@thewebtree.com>
    Re: removings " "s from strings <daniel.vesma@thewebtree.com>
    Re: req: directional help <office@asc.nl>
        Split behaviour <Rod.Munro@ibm.net>
    Re: Using string content as an a variable name <ronald_f@my-dejanews.com>
    Re: What's wrong with this hit counter? <felixtse@crosswinds.net>
    Re: XML::XQL <buchhorn@bln.sel.alcatel.de>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 26 May 1999 07:32:05 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: [perlfunc][perldata] access to data structures
Message-Id: <374ca34a.1472870@news.demon.co.uk>

On Tue, 25 May 1999 22:48:20 PDT, teqqus@asdf.engr.sgi.com wrote:

>so i'm trying to figure out how to nicely pick at an array contents:
>
>so i have something like
>$a = "a b c d e f";
>and i want to access the start and end elements
>so i want to be able to do something like the following:
>
>$start,$end = (split(/ /,$a))[0][$#];
>or
>$start,$end = (split(/ /,$a))[0,$#];
>
>or even if necessary
>$start,$end = (split(/ /,$a))[0,5];
>
>but i coudn't figure out a nice way to do this.

my ($start, $end) = (split(/ /, $a))[0, -1];

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: 26 May 1999 07:28:24 GMT
From: zenin@bawdycaste.org
Subject: Re: [perlfunc][perldata] access to data structures
Message-Id: <927703857.502000@localhost>

teqqus@asdf.engr.sgi.com wrote:
: so i'm trying to figure out how to nicely pick at an array contents:
: so i have something like
: $a = "a b c d e f";
: and i want to access the start and end elements so i want to be able to do
: something like the following:
: $start,$end = (split(/ /,$a))[0][$#];
: or
: $start,$end = (split(/ /,$a))[0,$#];
: or even if necessary
: $start,$end = (split(/ /,$a))[0,5];

	So close:

		($start, $end) = (split ' ', $a)[0,-1];

	It's all about context.

-- 
-Zenin (zenin@archive.rhps.org)         Caffeine...for the mind.
                                        Pizza......for the body.
                                        Sushi......for the soul.
                                             -- User Friendly


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

Date: 26 May 1999 03:35:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: [perlfunc][perldata] access to data structures
Message-Id: <x7wvxwe111.fsf@home.sysarch.com>

>>>>> "DC" == Dave Cross <dave@dave.org.uk> writes:

  DC> On Tue, 25 May 1999 22:48:20 PDT, teqqus@asdf.engr.sgi.com wrote:
  >> so i'm trying to figure out how to nicely pick at an array contents:
  >> 
  >> so i have something like
  >> $a = "a b c d e f";
  >> and i want to access the start and end elements
  >> so i want to be able to do something like the following:
  >> 
  >> $start,$end = (split(/ /,$a))[0][$#];
  >> or
  >> $start,$end = (split(/ /,$a))[0,$#];
  >> 
  >> or even if necessary
  >> $start,$end = (split(/ /,$a))[0,5];
  >> 
  >> but i coudn't figure out a nice way to do this.

  DC> my ($start, $end) = (split(/ /, $a))[0, -1];

or why not use a different op:

my ($start, $end) = ( substr($a, 0, 2), substr($a, -1) )

could be faster without the temp array and the slicing. i think it is
clearer too.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 26 May 1999 08:30:29 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: database backed perl function
Message-Id: <7ig4gc$bl$1@zonnetje.NL.net>

why don't you just scan for urls and then include <a href> yourself?

that way , you're user can just type 'hey man , http://www.sheep.fc/ is
cewl' and end up with a underlined <a hreffed> url.. :)

cul8r
buZz


Phil Buckley <1918@1918.com> heeft geschreven in bericht
<374AC3DD.BDF4041E@1918.com>...
>I built a real simple admin feature for a database (MySQL) backend
>website, where the administrator can add new news stories. The client
>now wants to also add hyperlinks into the text field. I mentioned that
>the easiest way was to put the <a href... right into the text where he
>wants it. No good. He wants something a little more "html editor" like.
>I am not familiar with anything perl related that can do what he wants.
>My suggestion was a follows: Put in some type of tag like # and then
>have a pull down showing files on the server that the guy could link to
>then substitute the <a href> in where the # was and write in the proper
>file to link to.
>Is there a more interactive way? Is there a module I'm over looking?
>
>Thanks in advance,
>Phil Buckley




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

Date: Wed, 26 May 1999 08:23:58 GMT
From: paul@vdkamer.nl (PaulK)
Subject: Get spaces off.
Message-Id: <374baf9b.7578348@news.wxs.nl>

Probl. a simple question but, what is the easest way to get the spaces
of at the end of a string ?

$teststring= 'Hello this is a test string                      ';

How do get $teststring to be 'Hello this is a test string';

Thanks

Paul


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

Date: Wed, 26 May 1999 07:29:15 GMT
From: tvn007@my-dejanews.com
Subject: hash of array ?
Message-Id: <7ig7sa$9s1$1@nnrp1.deja.com>

Hi,

Does anyone knows any web site or books that I can learn more
on Hash of Array , Array of Array or Hash of Hash ?

I am looking for some good examples.

Thanks,


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Wed, 26 May 1999 08:22:48 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: hash of array ?
Message-Id: <sbO23.23459$Q_5.4141331@news2.rdc1.on.home.com>

In article <7ig7sa$9s1$1@nnrp1.deja.com>,
 tvn007@my-dejanews.com <tvn007@my-dejanews.com> wrote:
! Hi,
! 
! Does anyone knows any web site or books that I can learn more
! on Hash of Array , Array of Array or Hash of Hash ?
! 
! I am looking for some good examples.

did you check out the included documentation?

perldoc perlref
perldoc perllol
perldoc perldsc

(substitute 'man' for 'perldoc' where your platform allows)

regards
andrew


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

Date: Wed, 26 May 1999 08:46:24 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: hash of array ?
Message-Id: <374bb486.5885351@news.demon.co.uk>

On Wed, 26 May 1999 07:29:15 GMT, tvn007@my-dejanews.com wrote:

>Hi,
>
>Does anyone knows any web site or books that I can learn more
>on Hash of Array , Array of Array or Hash of Hash ?
>
>I am looking for some good examples.

Try perldoc perllol or perldoc perldsc. These texts also form part of
'Programming Perl' (2nd Ed) starting on pages 257 and 264
respectively.

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: Wed, 26 May 1999 08:06:15 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Ho to get started with Tk on Win32?
Message-Id: <7iga1n$bav$1@nnrp1.deja.com>

In article <7idhr6$aeg$1@nnrp1.deja.com>,
  Leon <leonandrews@my-dejanews.com> wrote:
> Hi,
>
> Can anyone point me to any examples of how to get started with Tk?
>

A handy perl TK user guide is at
http://w4.lns.cornell.edu/~pvhp/ptk/pod/UserGuide.html

More help can be had from comp.lang.perl.tk or their FAQ at
http://w4.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html

Other than that just type widget at the command prompt.

HTH

Jeremy Gurney
SAS Programmer  |  Proteus Molecular Design Ltd.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Wed, 26 May 1999 00:31:04 -0700
From: Jason <jcl_n0spam@mail.ocis.net>
Subject: Re: leeches, compilers, and perl, oh my (all mine?)
Message-Id: <374BA338.985E6930@mail.ocis.net>

This is kinda funny.  Dr. David Sazuki from UBC in Canada was commenting
on the fact that drug companies are looking to patent genes they map.
This means they would hold a patent to a part of the human race that is
in you and me.

Who gives a crap about a gif?  Take controle of your own body first.

And they have been doing this for years with plants.  They go to India,
patent various plants in case they have medicinal properties that can
later be harvested.

You should all get of cloud nine and realize that the world is a big
place, and the news you see on FOX is just the 'crap' tip of the ice
burg.

J



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

Date: 26 May 1999 07:54:59 GMT
From: Christian Mondrup <scancm@biobase.dk>
Subject: Re: More Oraperl pain
Message-Id: <7ig9cj$11n4$1@news.net.uni-c.dk>

Jared Hecker <jhecker@iago.nac.net> wrote:
: Hi, all -

: Given the following snippet of code, I expected to retrieve all records
: (up to 8 ) in the 'instance_name' and 'password' fields of the table
: 'sid'.  Instead, all I get back is the first record.  Can anyone point me
: to what I am doing wrong?

: #################

: eval 'use Oraperl; 1' ||die $@ if $] >= 5;
: $ENV{TWO_TASK} = 'EMAN';
: $lda = &ora_login('EMAN','username','password');

: $csr2 = &ora_open($lda,'select instance_name from sid',8);

you must explicitly fetch every row:
while (@sid = &ora_fetch($csr2)) {
  <do something with the current row>
}
warn $ora_errstr if $ora_errno;
die "$ora_errstr\n" if $ora_errno;
&ora_close($csr2) || die "$ora_errstr\n";

Remember to use error handling in order to catch and correct errors !

: @sid = &ora_fetch($csr2);
: &ora_close($csr2);

: $csr = &ora_open($lda,'select password from sid',8);
: @pw = &ora_fetch($csr);
: &ora_close($csr);
: &ora_logoff($lda);

: ##################

: TIA -

: Regards,
: jh
: -- 
: Jared Hecker	| HWA Inc. - Oracle architecture and Administration
: jared@hwai.com	|  ** serving NYC and New Jersey **

-- 
Christian Mondrup, Computer Programmer
Scandiatransplant, Skejby Hospital, University Hospital of Aarhus
Brendstrupgaardsvej, DK 8200 Aarhus N, Denmark
Phone: +45 89 49 53 01, Telefax: +45 89 49 60 07


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

Date: Tue, 25 May 1999 22:57:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbi: UNIX to NT
Message-Id: <MPG.11b52d2d72db6894989afc@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <YeI23.252$u03.490@news.rdc1.sfba.home.com> on Wed, 26 May 
1999 01:36:56 GMT, Don Stefani <customk9@home.com> says...
> I am brand new to programming and am trying to learn the basics so I can be
> a better webpage designer.
> I have active perl on my windows machine, and all the study books and
> scripts I can get from the web are for UNIX. May I ask you please, how do I
> make a UNIX perl / CGI program NT ready?
> 
> Can someone send to the right referal pages?

Look in the ActivePerl FAQ for perlwin32faq7 - Web Programming (CGI and 
PerlIS).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 26 May 1999 17:24:40 +1000
From: bod@compusol.com.au (Brendan O'Dea)
Subject: Re: Perl "constructors"
Message-Id: <7ig7jo$qb$1@duende.compusol.com.au>

In article <oiJ%2.7880$LP2.159246@news6.ispnews.com>,
Alan Curry <pacman@defiant.cqc.com> wrote:
[snip]
>Why then do you tolerate a language that dies whenever a brk() fails with
>ENOMEM? These are all _temporary_ failures, and the programmer should have
>the freedom to deal with them as he wishes. Where do you draw the line that
>makes it acceptable for a general-purpose interpreter to turn a temporary
>error into a fatal one?

On systems with resource limits (get/setrlimit, ulimit), brk may also
fail with ENOMEM when a request is made which exceeds the limits for a
process.  This is a _permanent_ failure.

Regards,
-- 
Brendan O'Dea                                        bod@compusol.com.au
Compusol Pty. Limited                  (NSW, Australia)  +61 2 9809 0133


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

Date: Wed, 26 May 1999 08:43:52 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Perl "constructors"
Message-Id: <cvO23.13418$M3.295664@news7.ispnews.com>

In article <7ig7jo$qb$1@duende.compusol.com.au>,
Brendan O'Dea <bod@compusol.com.au> wrote:
>In article <oiJ%2.7880$LP2.159246@news6.ispnews.com>,
>Alan Curry <pacman@defiant.cqc.com> wrote:
>[snip]
>>Why then do you tolerate a language that dies whenever a brk() fails with
>>ENOMEM? These are all _temporary_ failures, and the programmer should have
>>the freedom to deal with them as he wishes. Where do you draw the line that
>>makes it acceptable for a general-purpose interpreter to turn a temporary
>>error into a fatal one?
>
>On systems with resource limits (get/setrlimit, ulimit), brk may also
>fail with ENOMEM when a request is made which exceeds the limits for a
>process.  This is a _permanent_ failure.

Regrettably true... in the worst case, you can't know whether retrying a brk
is useless (there should probably be more errnos, but I don't expect them to
be coming soon). However, in the somewhat better cases, the programmer knows
what the runtime environment will be like, and perl still denies him the
ability to handle an error in the way the underlying C library allows it.
This is a bad thing. I believe perl should be at least as good as the system
underneath it.
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: Wed, 26 May 1999 07:28:18 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Perl and MySQL
Message-Id: <374ba262.1240601@news.demon.co.uk>

On Tue, 25 May 1999 22:55:30 GMT, kickinapants@home.com wrote:

>Hello Gang
>
>I am about to embark on a shopping cart project. I will be interfacing
>with MySQL databases that will keep track of menu items, shopping cart
>contents, client history and info. The sections of the menu have sub
>sections of a sort, a description of how their nachos are prepared and
>then the different nachos are listed. The other tough one is pizzas,
>there are lots of differnt types of pizza as well as a build your own
>section. Then there is the mix and match pasta section.
>
>I am looking for a shopping cart to do this. For 3 months now. I am
>looking at writing the program myself. What I need to know is how to
>connect to MYSQL databases from a Perl CGI.

To connect to a MySQL databbase from Perl, use the DBI and DBD::MySQL
modules. Both are available from CPAN <http://www.cpan.org>.

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: Wed, 26 May 1999 06:50:19 GMT
From: steveeq1@earthlink.net
Subject: Perl equivalent of c++ "struct"
Message-Id: <7ig5jb$7rd$1@nnrp1.deja.com>

Hey,

I am trying to read some binary data and assign them into variables in
Perl. I have done it many times in visual basic, and I kinda sort know
how to do it in C++, but what is the command to do it in Perl?

Like "read the first 5 bytes of this file and assign it to variable A.
Then take the next 5 bytes, and assign it to variable B".

Anyone know of a man page or a web page that has sample code or
explains the concept?


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Wed, 26 May 1999 07:35:14 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Perl equivalent of c++ "struct"
Message-Id: <374da3aa.1568950@news.demon.co.uk>

On Wed, 26 May 1999 06:50:19 GMT, steveeq1@earthlink.net wrote:

>Hey,
>
>I am trying to read some binary data and assign them into variables in
>Perl. I have done it many times in visual basic, and I kinda sort know
>how to do it in C++, but what is the command to do it in Perl?
>
>Like "read the first 5 bytes of this file and assign it to variable A.
>Then take the next 5 bytes, and assign it to variable B".
>
>Anyone know of a man page or a web page that has sample code or
>explains the concept?

You should probably be looking at the Perl documentation for details
of the following functions...

perldoc -f open
perldoc -f seek
perldoc -f read
perldoc -f unpack
perldoc -f pack

and for storing the data in complex data structures take a look at

perldoc perldsc

hth,

Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: 26 May 1999 08:39:20 +0200
From: Lars Marius Garshol <larsga@ifi.uio.no>
Subject: Re: RDF parser for My Netscape type RDF
Message-Id: <wkn1ysxrl3.fsf@ifi.uio.no>


* Otis Gospodnetic
| 
| Has anyone written or does anyone know of a Perl module/script that
| can parse My Netscape (or Slashdot) RDF files?

I have one in Python, if that's any use to you. If nothing else you
can use it for inspiration. For the moment it's available from

<URL: http://birk105.studby.uio.no/tmp/rsslib.zip>
 
but that's just where I've placed a very early draft of it.

I'm working on a more polished version, which will have an RSS DTD as
well. 

--Lars M.


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

Date: Wed, 26 May 1999 09:33:42 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: removings " "s from strings
Message-Id: <7igcvc$r1r$1@gxsn.com>

>   Where did you get your perl from?


Perl5 for dummies.

>   Maybe the docs *are* there, but you just can't find them.


I looked at my install log for perl, and it says that "docs" was created,
but there are no subdirectories. Maybe the install failed?


Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma





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

Date: Wed, 26 May 1999 09:37:27 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: removings " "s from strings
Message-Id: <7igcvf$r1r$2@gxsn.com>

>That's the simple truth of the matter.  Now, do you have
>Perl or don't you?


I have Perl, and it says that docs were installed, but there are no docs.

Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma





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

Date: Wed, 26 May 1999 09:39:25 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: req: directional help
Message-Id: <7ig8hp$3ql$1@zonnetje.NL.net>

oh man!!!!

great tutorial , it is allready learning me everything i ever wanted to know
:)
btw. is that perlmonth.com down or something? i can't look it up from here..

cul8r
buZz

>> i'm a young internet enthousiast that is starting to look at perl for
easy
>> to maintain , template driven , database-like approaches to normal
webpages
>
>Good choice.  But you'll probably need to learn enough Perl to be
>able to recognize bad Perl programs when you find them on the
>Web.  Trust me, there are more bad ones out there than good ones.

well , the idea is to code my own stuff , i have some years of
basic/pascal/c++/html experiance , and perl is a logical step onwards.

>Sturgeon's Law certainly applies to the Web.

what's his law??


>You might also want to read this article, which will tell you
>how to look things up in the extensive Perl docs:
>   http://www.perlmonth.com/articles//rtfm.html

>Unfortunately, it doesn't help to use AltaVista with
> +perl +tutorial +dbi +not_full_of_hideous_errors


nope , it doesn't :)

>But you can use Deja to look through posts in this newsgroup
>about DBI and DBD issues, and glean dozens of good code
>samples.

yeah , i figured..




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

Date: Wed, 26 May 1999 08:29:01 +0100
From: "Rod Munro" <Rod.Munro@ibm.net>
Subject: Split behaviour
Message-Id: <374b94f9@news.uk.ibm.net>

Is this behaviour of split correct?

@x =  split(/^([^:]+):\s*/m, "field: value here");

results in

@x = ['','field','value here'];

Some examples of split seem to indicate that this would give 2 items not 3,
the empty field being ignored.

What is the correct result?

TIA

Rod






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

Date: Wed, 26 May 1999 06:44:14 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Using string content as an a variable name
Message-Id: <7ig581$7h1$1@nnrp1.deja.com>

Big cheers to Tad and David for pointing out in this thread that the
best way to use symbolic references is to not use them at all! Well - I
surely *did* read the FAQs, but I must admit that this important point
had escaped my long term memory. Shame on me.

Ronald <ronald_f@my-dejanews.com>


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Wed, 26 May 1999 16:54:37 +0800
From: Felix <felixtse@crosswinds.net>
Subject: Re: What's wrong with this hit counter?
Message-Id: <374BB6CD.71E5D9BA@crosswinds.net>

How about this?

Code:
#!/usr/bin/perl -w
use diagnostics;

open(LOG,"counter.log") || die "cannot open, $!";
chomp($count = <LOG>);
$count++;
close(LOG);
open(WRITELOG,">counter.log");
print LOG "$count";
@digits=split(//,sprintf("%05d",$count));

print "Content-type: text/html\n\n";
print "<Html>";
print "<Head>";
print "<Title>Hit counter</Title>";
print "</Head>";
print "<Body>";
print "<p>";

foreach my $digit (@digits) {
print qq(<img src="count$digit.gif" alt="" width="20" height="30">);
}

print "</p>;
print "</Body>";
print "</Html>";


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

Date: Wed, 26 May 1999 07:56:37 +0200
From: Matthias Buchhorn <buchhorn@bln.sel.alcatel.de>
Subject: Re: XML::XQL
Message-Id: <374B8D14.B76C0660@bln.sel.alcatel.de>


--------------279E4AD8BC91F2E3394BE345
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Steve Farris wrote:

> Does anyone have some code samples using the XML::XQL module.
> Having trouble building queries and accessing element contents.
> Thanks!

a example:

use XML::XQL;
use XML::XQL::DOM;
$parser = new XML::DOM::Parser;
$doc = $parser->parsefile ("file.xml");
# Return all UNIX_USER elements with attribut 'smc_adm'
$query = new XML::XQL::Query (Expr => "UNIX_USER[@site =~ 'smc_adm']");
@result = $query->solve ($doc);

find the XML-line:

<UNIX_USER  site="amc_adm" ...>
 ...
<UNIX_USER>

--
-----------------------------------------------------
EMAIL:    buchhorn@bln.sel.alcatel.de
HOMEPAGE: http://aww.bln.sel.alcatel.de/~buchhorn
------------------------------------------------------



--------------279E4AD8BC91F2E3394BE345
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Steve Farris wrote:
<BLOCKQUOTE TYPE=CITE>Does anyone have some code samples using the XML::XQL
module.
<BR>Having trouble building queries and accessing element contents.
<BR>Thanks!</BLOCKQUOTE>
a example:
<P>use XML::XQL;
<BR>use XML::XQL::DOM;
<BR>$parser = new XML::DOM::Parser;
<BR>$doc = $parser->parsefile ("file.xml");
<BR># Return all UNIX_USER elements with attribut 'smc_adm'
<BR>$query = new XML::XQL::Query (Expr => "UNIX_USER[@site =~ 'smc_adm']");
<BR>@result = $query->solve ($doc);
<P>find the XML-line:
<P>&lt;UNIX_USER&nbsp; site="amc_adm" ...>
<BR>...
<BR>&lt;UNIX_USER>
<PRE>--&nbsp;
-----------------------------------------------------
EMAIL:&nbsp;&nbsp;&nbsp; buchhorn@bln.sel.alcatel.de
HOMEPAGE: <A HREF="http://aww.bln.sel.alcatel.de/~buchhorn">http://aww.bln.sel.alcatel.de/~buchhorn</A>
------------------------------------------------------</PRE>
&nbsp;</HTML>

--------------279E4AD8BC91F2E3394BE345--



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5784
**************************************

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