Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Regex - counting number of '|'

by mickeyn (Priest)
on Mar 18, 2008 at 07:42 UTC ( #674731=note: print w/ replies, xml ) Need Help??

in reply to Regex - counting number of '|'

this one works for me:

use strict; my $inp_row = "per|l|mo|nks|ro|ck|s"; print $inp_row =~ tr/\|/\|/, "\n";

Comment on Re: Regex - counting number of '|'
Download Code
Replies are listed 'Best First'.
Re^2: Regex - counting number of '|'
by ikegami (Pope) on Mar 18, 2008 at 07:54 UTC
    He specifically said he didn't want to hardcode the character, so no good.
      Hi guys!

      Thanks a lot for takin the time out for this...!! I m really grateful...!! I am new to perl and was havin a really tough time with these things... but things are now slowly falling into place....!!

      Again... thanks..!!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-11-26 09:43 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 (696 votes), past polls