Hi Bob,

On Thu, 15 Nov 2012 21:58:38 -0600
boB Stepp <robertvst...@gmail.com> wrote:

> I am using Win7Pro-64bit.
> 
> say "Another Hello World!";
> 
> if run from Padre v. 0.94 yields:
> 
> String found where operator expected at HelloWorld.plx line 4, near "say
> "Anothe r Hello World!""
>         (Do you need to predeclare say?)
> syntax error at HelloWorld.plx line 4, near "say "Another Hello World!""
> Execution of HelloWorld.plx aborted due to compilation errors.
> Press any key to continue . . .
> 
> However, if I instead use:
> 
> #use 5.010;
> 
> 
> say "Another Hello World!";
> 
> It runs as expected when run from within Padre.
> 
> If I run the first version from the Windows command line (which is
> using Strawberry Perl 5.16 instead of Padre's 5.14), using
> 
> c:\perl helloworld.plx
> 
> I get no error messages and all works well. Why does Padre require the
> insertion of the use pragma?
> 

You need "use 5.010;" (or above) or "use feature 'say';" or whatever, because
the Perl developers were afraid that the new built-in function "say" will clash
with an existing one by the same name, and as a result made it optional. So
always import it explicitly.

Regards,

        Shlomi Fish

> Thanks!
> boB Stepp
> 



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
My Public Domain Photos - http://www.flickr.com/photos/shlomif/

Thank God I found the good in goodbye!
    — “Best Thing I Never Had”, Beyoncé

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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