meanroc has asked for the wisdom of the Perl Monks concerning the following question:
Hello , I want to say I am sorry first, because I criate one topic confusied..I do not speak english very well, and I am noob in perl, so I need more patience from you....So, I coded:
#!/usr/bin/perl use strict; use warnings; my $sys="$^O";if ($sys eq linux) { $lim="clear";} else { $lim="cls"; } print "hello"; my $ts=<STDIN>; print "$ts"; system("$lim");
So when I run:Global symbol "$lim" requires explicit package name at /root/Desktop/exemplo.pl line 4;4;8. Bareword "linux" not allowed while "strict subs" in use at /root/Desktop/exemplo.pl
What is wrong? Thanks and sorry.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Global symbol requires explicit package..
by SuicideJunkie (Vicar) on Jan 21, 2014 at 18:10 UTC | |
|
Re: Global symbol requires explicit package..
by Eily (Monsignor) on Jan 21, 2014 at 18:12 UTC | |
|
Re: Global symbol requires explicit package..
by Laurent_R (Canon) on Jan 21, 2014 at 18:19 UTC | |
by tobyink (Canon) on Jan 22, 2014 at 10:12 UTC | |
by choroba (Cardinal) on Jan 22, 2014 at 10:23 UTC | |
|
Re: Global symbol requires explicit package..
by meanroc (Acolyte) on Jan 21, 2014 at 18:54 UTC | |
by Tux (Canon) on Jan 21, 2014 at 19:00 UTC | |
by Laurent_R (Canon) on Jan 21, 2014 at 19:50 UTC |