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

Re: Non Greedy?

by citromatik (Curate)
on Jun 02, 2009 at 23:54 UTC ( [id://767823]=note: print w/replies, xml ) Need Help??


in reply to Non Greedy?

Some gave you hints to solve your regexp problem. I will give you a quick-n-dirty non-regexp related solution (I will never put a code like this in production):

use strict; use warnings; use Data::Dumper; my $i = "[[{bunches_of_data}, {more_data}, {etc}], [{hey_more_data}, { +etc}, {etc}], [{etc}, {etc}, {etc}]]"; $i =~ s/{|}//g; $i =~ s/([^\[\],\s]+)/'$1'/g; my $iv = eval "$i"; print Dumper $iv;

Outputs:

$VAR1 = [ [ 'bunches_of_data', 'more_data', 'etc' ], [ 'hey_more_data', 'etc', 'etc' ], [ 'etc', 'etc', 'etc' ] ];

citromatik

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-18 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found