Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: regex replacement help

by furry_marmot (Pilgrim)
on Mar 29, 2011 at 21:47 UTC ( #896279=note: print w/replies, xml ) Need Help??

in reply to regex replacement help

Instead of changing the tildes, use them as anchors to change the characters around them.

UPDATE: Changed second $1 to $2. Stupid fingers...

UPDATE2: Just realized it was wrong, as well. What was I thinking??? This should do it.

s/~/\n/g; chomp;

Replies are listed 'Best First'.
Re^2: regex replacement help
by choroba (Chancellor) on Mar 31, 2011 at 11:06 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://896279]
choroba waits
[thepkd]: $aohoaoh ->{'foo'} has to be dereferenced to access its contents right?
[thepkd]: sorry. i mean $aohoaoh[0]
[GotToBTru]: $aohoaoh is an array reference tho
[thepkd]: some guy was suggesting $aohoaoh[0]->{'foo '}[0]->{}. This wouldnt work.
[GotToBTru]: you're mixing notation there I think
[GotToBTru]: $aohoaoh->[0] is a hash reference, so $aohoaoh->[0]->{ key1} would work
[1nickt]: If 1nickt is the some guy, that's not what he said.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2016-12-06 13:35 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (104 votes). Check out past polls.