Hi,

try:

my $results = $_[0] + $_[1];

mit freundlichen Grüßen
Martin Wildgruber

On 13.02.2012, at 16:43, lina wrote:

> Hi,
> 
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> sub add
> {
>       $results = $_[0] + $_[1];
>       print "The result was: $results\n";
> }
> 
> add(1,2)
> 
> $ ./subroutines_examples.pl
> Global symbol "$results" requires explicit package name at
> ./subroutines_examples.pl line 8.
> Global symbol "$results" requires explicit package name at
> ./subroutines_examples.pl line 9.
> Execution of ./subroutines_examples.pl aborted due to compilation errors.
> 
> How to adjust the strict in this situations, why we use strict?
> 
> Thanks with best regards,
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
> 
> 


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to