[ale] Off topic - perl question

Jim Kinney jkinney at teller.physics.emory.edu
Wed Aug 25 18:22:49 EDT 1999


@fi=split(/\./, $test);

[jkinney at teller jkinney]$ chmod 755 perltest
[jkinney at teller jkinney]$ ./perltest
1 splitting abc.xyz, first part = abc, second part = xyz

works

James Kinney M.S.Physics		jkinney at teller.physics.emory.edu
Educational Technology Specialist	404-727-4734
Department of Physics Emory University	http://teller.physics.emory.edu

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