Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Problem with Pseudohash

by choroba (Chancellor)
on Feb 02, 2012 at 08:49 UTC ( #951377=note: print w/replies, xml ) Need Help??


in reply to Problem with Pseudohash

In the 2nd style, the part type="technical" is not an attribute, it is just a text. You can find it in $book->{content}, including the newline before it.
Update: Where do you see any pseudohash?

Replies are listed 'Best First'.
Re^2: Problem with Pseudohash
by uday_sagar (Scribe) on Feb 08, 2012 at 13:26 UTC
    if the content has type1="scientific" type2="technical" instead of type="technical", how to get only type1="sceintific"?
      OK, you have a string
      my $content = "\n" . 'type1="scientific" type2="technical"';
      Are you interested in type1 only? Use
      my ($type1) = $content =~ /type1="([^"]+)"/;
      Are you interested whether scientific is present? Use
      my $is_sceintific = $content =~ /type[0-9]*="scientific"/;
        Okay, What I am really interested is that the data should get stored in a hash table irrespective of the position of the attributes of the xml file. (As shown above, STYLE 1 and STYLE 2) Is there any construct/module for this?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951377]
help
Chatterbox?
choroba having "blue pipeline duty" this week
[Corion]: choroba: Exactly that, but I prefer to keep an eye on my mood nowadays...
[Corion]: Also, there's one colleague who wants to join a well-established weekly telco, and I'm not convinced of the use there...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2017-03-29 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (344 votes). Check out past polls.