in reply to Splitting a string... Duh?

Presumably it's because you are trying to split and put the results into a scalar context.
So you might want to do something like:
$cnID = ( split("/", $serverID) )[0]; print $cnID"\n";
(Untested, but should do it...)

Replies are listed 'Best First'.
Re: Answer: Splitting a string... Duh?
by Preceptor (Deacon) on Sep 16, 2002 at 16:24 UTC
    Oops, I typoed the print.
    use strict; my $cnID= (split("/", $serverID))[0]; print "$cnID\n";
    As a hint, using strict would have indicated that something was wrong with this line.
    --
    It's not pessimism if there is a worse option, it's not paranoia when they are and it's not cynicism when you're right.