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@RLEE ~]# ./!$
././split_practice.pl
h i |
'|' is special in a regular expression and needs to be escaped.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
> I use this before (split slice ) but it's working bit funny now..
> it looks like it's splitting on '' instead of /|/ as I have specified
> below... ??
Look for quotemeta in perlre.
--
Affijn, Ruud
"Gewoon is een tijger."