Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Parse messy string into neat data structure

by Anonymous Monk
on Aug 09, 2010 at 01:46 UTC ( #853708=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @images = ( [], [] );
    {
    ...
        @{ $images[1] } = $imgstr[1] =~ m/(\w+\.jpg)/gi;
    }
    
  2. or download this
    my @images;
    {
        my @imgstr  = split /\|/, $str, 2;
        push @images, [ $_ =~ m/(\w+\.jpg)/gi ] for @imgstr;
    }
    
  3. or download this
    my @images = map { [  $_ =~ m/(\w+\.jpg)/gi ] } split /\|/, $str;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2018-11-13 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (146 votes). Check out past polls.

    Notices?