in reply to Re: local and global variable?
in thread local and global variable?

... my @species = split "//", $list;. The @species array will contain each letter of $list (a split on the null string ...

Splitting on  "//" does not split on the null string, but rather on the literal sequence of two forward-slash characters.

>perl -wMstrict -le "my $s = 'foo//bar//baz'; my @species = split qq{//}, $s; printf qq{'$_' } for @species; " 'foo' 'bar' 'baz'

Replies are listed 'Best First'.
Re^3: local and global variable?
by Marshall (Canon) on Aug 22, 2011 at 13:29 UTC
    my booboo corrected above. Thanks for pointing this mistake out.
Re^3: local and global variable?
by Jim (Curate) on Aug 22, 2011 at 17:36 UTC

    It was an accident waiting to happen. This is one reason I always make it clear in my code that the first argument of split is a regular expression pattern, not a string.

    my @species = split m{//}, $list;