[ale] Off topic - perl question
Stan.Hearn at ipst.edu
Stan.Hearn at ipst.edu
Wed Aug 25 16:31:23 EDT 1999
Split wants you to enclose the split with slashes. And yes the period is
special.
Try
@fi = split (/\./,$test);
At 03:14 PM 8/25/99 , you 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