Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Problem with Pseudohash

by uday_sagar (Scribe)
on Feb 08, 2012 at 13:26 UTC ( #952494=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with Pseudohash
in thread Problem with Pseudohash

if the content has type1="scientific" type2="technical" instead of type="technical", how to get only type1="sceintific"?

Replies are listed 'Best First'.
Re^3: Problem with Pseudohash
by choroba (Chancellor) on Feb 08, 2012 at 14:31 UTC
    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?
        For STYLE 1, there are lots of modules (search CPAN for XML). For STYLE 2, there is none, because this is not the standard way to represent structured data in XML.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952494]
help
Chatterbox?
[hippo]: The thesholds/benefits balance at the time was nuts.
[hippo]: But that doesn't last because, you know ... politicians. :(
[Corion]: hippo: Yeah, if you still get enough money to get by and don't have expensive hobbies or other fixed costs that can work out well
[ambrus]: ah good. I pay only rent too. but that still costs significant money.
[Corion]: ambrus: Yes, but that is already budgeted for
[holli]: Corion is well off. I am sure there is a script of his running in the frankfurt banking data center, diligently mining bitcoins ;-)
[Corion]: holli: Hahaha :-D

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-09-21 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (249 votes). Check out past polls.

    Notices?