Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Applying regex to each line in a record.

by tybalt89 (Monsignor)
on Oct 24, 2020 at 21:20 UTC ( [id://11123137]=note: print w/replies, xml ) Need Help??


in reply to Applying regex to each line in a record.

I tried paragraph mode, still didn't need /s and /m. :)

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11123126 use warnings; local $/ = ''; # paragraph at a time my %hash = map { $1 x /(\w+):\n/, { /(\w+):(\w+)/g } } <DATA>; use Data::Dump 'dd'; dd \%hash; __DATA__ first: this:that here:there when:what how:where now:later name:onlyfirst second: this:that here:there when:what how:where now:later name:onlysecond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-16 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found