Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > split slice que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 11051 of 11751
Post > Topic >>

split slice question

by rich.japh@[EMAIL PROTECTED] (Richard Lee) May 10, 2008 at 10:14 AM

I use this before (split slice ) but it's working bit funny now..

can someone tell me why??

it looks like it's splitting on '' instead of /|/ as I have specified 
below... ??

use strict;
use warnings;


my $array = q/hi|how|are|you|fine/;

my ($moe,$hae,$now) = (split(/|/,$array))[0,1,2];
print "$moe $hae $now\n";

[root@[EMAIL PROTECTED]
 ~]# ./!$
.././split_practice.pl
h i |
 




 3 Posts in Topic:
split slice question
rich.japh@[EMAIL PROTECTE  2008-05-10 10:14:54 
Re: split slice question
noreply@[EMAIL PROTECTED]  2008-05-10 16:42:05 
Re: split slice question
rvtol+news@[EMAIL PROTECT  2008-05-11 12:50:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 6:42:04 CDT 2008.