CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [rovf] store each word of string: Edit Log



harshmane
Novice

Jun 28, 2011, 10:04 AM


Views: 1527
Re: [rovf] store each word of string


Code
use strict; 
use warnings;


$xyz= "hello hi friend do you want some help.";

$xyz=~m/(\s|\S+)/;
print "$1 \n"; #print hello

$xyz=~m/(\s)(\S+)/;
print "$2 \n"; #print hi


$xyz=~/((\s)(\S+)){2}/;
print " $1\n"; #print friend



(This post was edited by harshmane on Jun 28, 2011, 10:05 AM)


Edit Log:
Post edited by harshmane (Novice) on Jun 28, 2011, 10:05 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives