in reply to FMTYEWTK about split //
I always used ()=$string=~/(.)/gs; to split a string to characters. Also, it's sometimes useful to iterate through the characters of a list, for which you can use the scalar-context variation: while($string=~/(.)/gs){DO SOMETHING WITH ($1)}; -- you can't do this with split, can you?
Update: added s flags, strange noone noticed that
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: FMTYEWTK about split //
by particle (Vicar) on Jan 21, 2004 at 14:52 UTC | |
Re: Re: FMTYEWTK about split //
by Roger (Parson) on Jan 21, 2004 at 14:25 UTC | |
by ambrus (Abbot) on Jan 21, 2004 at 14:41 UTC | |
by hardburn (Abbot) on Jan 21, 2004 at 14:47 UTC | |
by ambrus (Abbot) on Jan 21, 2004 at 14:49 UTC |
In Section
Meditations