Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^3: Problem with Pseudohash

by choroba (Canon)
on Feb 08, 2012 at 14:31 UTC ( #952512=note: print w/ replies, xml ) Need Help??

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

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"/;

Comment on Re^3: Problem with Pseudohash
Select or Download Code
Replies are listed 'Best First'.
Re^4: Problem with Pseudohash
by uday_sagar (Scribe) on Feb 13, 2012 at 12:54 UTC
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952512]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2015-11-25 20:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (690 votes), past polls