Richard Lee wrote:
Chas. Owens wrote:
my $sabal = new XML::Twig(
twig_roots => {
'foo/yahoo' =>
#'[EMAIL PROTECTED]"kingtony"]' =>
sub {
my ($yabal, $element ) = @_;
Chas. Owens wrote:
Perhaps I am dense, but what is the desired output from the given XML?
Hello Chas,
From xml file, based on attribute value for bayking id, I want to find
kingtony and then I want to traverse back up to yahoo and print
everything from
to
I have tried to use xpath
On Sat, Nov 15, 2008 at 23:18, Richard Lee <[EMAIL PROTECTED]> wrote:
> Richard Lee wrote:
>>
>> Chas. Owens wrote:
>>>
>>> On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote:
>>> snip
>>>
if ( $bay1->att('id' eq 'kingtony' ) ) {
>>>
>>> snip
>>>
>>> I thi
Richard Lee wrote:
Chas. Owens wrote:
On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
if ( $bay1->att('id' eq 'kingtony' ) ) {
snip
I think you mean to say
if ($bay1->att("id") eq "kingtony") {
yes, that was a typo...
I changed to
my $sabal
Chas. Owens wrote:
On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
if ( $bay1->att('id' eq 'kingtony' ) ) {
snip
I think you mean to say
if ($bay1->att("id") eq "kingtony") {
yes, that was a typo...
--
To unsubscribe, e-mail: [EMAIL PROTECTE
On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote:
snip
>if ( $bay1->att('id' eq 'kingtony' ) ) {
snip
I think you mean to say
if ($bay1->att("id") eq "kingtony") {
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
use strict;
use warnings;
use XML::Twig;
my $xml = <
1
yes
10
no
emmigrate="no">
On Sat, Nov 15, 2008 at 17:42, Jenda Krynicky <[EMAIL PROTECTED]> wrote:
snip
> The rule for automatic quoting within $hash{...} is "if it looks like
> word, it doesn't have to be quoted". And - is not in the list of word
> characters as far as Perl is concerned.
snip
Not exactly. A hyphen is all
Kelly Jones wrote:
> Consider:
>
> perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
> [no result]
>
> perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
> 1
>
> I sort of understand this: in the first script, Perl treats foo-bar as
> a subtraction, and sets $hash{0} to 1. In the second one
From: "Kelly Jones" <[EMAIL PROTECTED]>
> Consider:
>
> perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
> [no result]
>
> perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
> 1
>
> I sort of understand this: in the first script, Perl treats foo-bar as
> a subtraction, and sets $hash{0} to
Hello, I am praticing below XML file.
Based on where I find att id for bayking id 'kingtony' , I wanted to
print out the entire element/att(and ID) and any text found from
to .(exception of bayqueen_list and its descendatns)...
I am having problem just print out one value... can someone take
On Sat, Nov 15, 2008 at 15:10, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
> s/pargmas/pragmas/;
snip
And I had paragams at one point. I need more (or better) sleep.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail:
Chas. Owens wrote:
On Sat, Nov 15, 2008 at 13:52, Kelly Jones <[EMAIL PROTECTED]> wrote:
Consider:
perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
[no result]
perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
1
I sort of understand this: in the first script, Perl treats foo-bar as
a s
Kelly Jones wrote:
Consider:
perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
[no result]
Using warnings and/or strict may have helped:
$ perl -Mwarnings -le 'my %hash = ("foo-bar", 1); print $hash{foo-bar}'
Unquoted string "foo" may clash with future reserved word at -e line 1.
Argument
On Sat, Nov 15, 2008 at 13:52, Kelly Jones <[EMAIL PROTECTED]> wrote:
> Consider:
>
> perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
> [no result]
>
> perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
> 1
>
> I sort of understand this: in the first script, Perl treats foo-bar as
> a subtra
Consider:
perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
[no result]
perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
1
I sort of understand this: in the first script, Perl treats foo-bar as
a subtraction, and sets $hash{0} to 1. In the second one it assumes
you just left off some quot
16 matches
Mail list logo