[ale] Off topic - perl question

Jim Lynch jwl at sgi.com
Wed Aug 25 15:14:41 EDT 1999


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