Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: How to get each character in string value

by linuxer (Curate)
on Dec 02, 2008 at 09:26 UTC ( [id://727340]=note: print w/replies, xml ) Need Help??


in reply to Re: How to get each character in string value
in thread How to get each character in string value

According to perldoc perldata (paragraph for $MATCH) I would avoid the use of "$&"; I would capture the pattern and use "$1" instead.

use strict; use warnings; my $string = "Hello World"; while($string =~/(.)/g){ print "$1\n"; }
But usually I prefer the split() solution.

Log In?
Username:
Password:

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

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

    No recent polls found