in reply to split function

Post your actual code. That code does not compile. This does, with some phony input data. It should work, unless your input data is not what you think it is.
use warnings; use strict; #my @ccView = `cleartool pwv`; my @ccView = map{"Set view: $_"}5..9; my $setView = (grep /Set view:/, @ccView)[0]; my $view = (split(/:/ , $setView))[1]; #my $view = (split(:/ , $setView))[1]; print "$view\n"; __END__ 5

The Basic debugging checklist

Replies are listed 'Best First'.
Re^2: split function
by gimcdan (Acolyte) on Apr 28, 2015 at 15:09 UTC

    Thanx for the input. The original code compiles and produces expected output. I did not understand that split returns an array (aka a list).