[ale] Off topic - perl question

Zhongbin Yu " <zyu at premtec.com> Zhongbin Yu " <zyu at premtec.com>
Wed Aug 25 15:40:08 EDT 1999


I did split(/\./, $test) and it worked fine.

'man perlfunc' gives sympnosis of split as the following:
	split /PATTERN/,EXPR,LIMIT
	split /PATTERN/,EXPR
In regular expression,  a single dot is reserved char. It acts more like a
wild card, it stands for any character. w is alphanumeric plus _, and d is
for number. So, need use \ to espace it.

$0.02.

Jerry Yu
----------------------------------------------------------------------------
Systems Engineer	| zyu at tc.net
Premiere Technologies	| 404-262-8544(O)	1-800-979-1105 (P)
Atlanta, GA 30326	| ae.tc.net/dept/engineering/op/public/developer/zyu

On Wed, 25 Aug 1999, Jim Lynch wrote:

#What is wrong with this?  I can't make it do what I want it to.
#
#$test = "abc.xyz";
#
#@fi = split (".",$test);
#print "$#fi";
#print " splitting $test, first part = $fi[0], second part = $fi[1]\n";
#
## $#fi = -1, according to the output
#
#$test = "abc,xyz";
#
#@fi = split (",",$test);
#print "$#fi";
#print " splitting $test, first part = $fi[0], second part = $fi[1]\n";
#
## this works fine so it is the period that is causing the problem but
#I've tried:
#@fi = split ("\.",$test);
#
#@fi = split ('.',$test);
#
#@fi = split (/./,$test);
#
#@fi = split (/"."/,$test);
#
#@fi = split (/"\."/,$test);
#
#to no avail.
#
#Suggestions appreciated.
#
#Thanks,
#Jim.
#






More information about the Ale mailing list