in reply to Global symbol requires explicit package..

Try to change your code this way:
my $sys = $^O; my $lim; if ($sys eq "linux") { $lim="clear"; } else { $lim="cls"; } # ...
You actually don't really need the $sys variable, you could compare dirfectly $^O, but it does not matter.

Replies are listed 'Best First'.
Re^2: Global symbol requires explicit package..
by tobyink (Canon) on Jan 22, 2014 at 10:12 UTC

    Indeed; the whole thing could be written as:

    my $lim = ($sys eq 'linux') ? 'clear' : 'cls';
    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name