Please post messages to the list, not to me personally. That way, you will get 
better answers sooner.

On May 23, 2014, at 3:13 PM, Sherman Willden wrote:

> Thank you, Jim;
> 
> How do I get rid of the warning message without getting rid of the -w switch?

Use the 'use warnings;' pragma in your program instead of '-w' on the first 
line. That way, you can control which messages are issued.

I do not know if it is possible to get rid of the warnings you are seeing. I do 
not use the 'say' command, but prefer print, and use one of the other 
techniques I listed.

See 'perldoc use warnings' and 'perldoc perllexwarn' for more details about 
'use warnings'.


> The code is last in this text. The output is as follows:
> 
> perl -c nums.pl
> Unquoted string "say" may clash with future reserved word at nums.pl line 4.
> nums.pl syntax OK
> 
> perl nums.pl
> Unquoted string "say" may clash with future reserved word at nums.pl line 4.
> 6.28318530717959
> 6.28318530717959
> 6.28318530717959
> 6.283185
> 
> #!/usr/bin/perl -w
> 
> use Math::Trig;
> use feature say;
> 
> say pi * 2;
> print pi * 2, "\n";
> print pi * 2 . "\n";
> printf "%f\n", pi * 2;
> 


--
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