perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Gunton <neil.embp...@home.nilspace.com>
Subject Global 'use strict' in 2.x
Date Sun, 03 Nov 2002 18:47:55 GMT
Hi Gerald, I'm trying to enforce 'use strict' in my [$ sub $] routines for
2.0b8. Is there any way to tell Embperl to use strict in every [$ sub $] without
having to do something like the following?

[$ sub hello $]
   [* use strict; my ($self, $name) = @_; *]
   Hello [+ $name +]!!!!
[$ endsub $]

I'd like to avoid having to put the 'use strict' explicitly in every [$ sub $].
I want the same effect as putting 'use strict' just once at the start of the
file. However when I put this it doesn't seem to affect anything inside the [$
sub $] blocks:

[# start of file #]
[* use strict; *]
[$ sub hello $]
   ...
[$ endsub $]

I really don't want to use [$ var $] in this context, I'd prefer to use 'my' to
declare my variables, since it's cleaner and more convenient for more complex
code.

If there's a way to set 'strict' on globally, then that would be great too.

This is being done in a subs file under Embperl::Object, via the Execute({object
=> 'file.epl'}) syntax.

I see there is a 'strict' method mentioned in the README.v2 for the Component
object, but there's no more detail about what this does or how to use it. Any
clues most welcome...

I'm in the process of trying to transition my existing 1.x based sites over to
2.x.

Thanks!

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message