Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: find the starting character position in a line

by linuxer (Curate)
on Apr 16, 2009 at 08:47 UTC ( #757897=note: print w/replies, xml ) Need Help??


in reply to find the starting character position in a line

$ perl -wle ' $line = " This is a test."; if ( $line =~ m/(\S)/g ) { print pos($line); } ' 4

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-09-25 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (469 votes). Check out past polls.