XS::Framework::Manual::SVAPI::Scope - XS::Framework scope utils
This class contains static methods for setting scope hints at compile time and getting it in runtime.
Example:
use MyModule::strict_mode; # MyModule::strict_mode::import() XS function calls Scope::Hints::set ... MyModule::somefunc($arg); # XS function may use Scope::Hints::get to alter its behaviour ... no MyModule::strict_mode; # MyModule::strict_mode::unimport() XS function calls Scope::Hints::remove
Set hint name with value value. Must be called at compile time to take effect, i.e. from XS import() function or from XS function that is called from BEGIN block.
name
value
import()
BEGIN
Scope::Hints::set("myhint", Simple("myvalue"));
Have the same effect as calling from perl
BEGIN { $^H{myhint} = "myvalue" }
Removes hint name and its associated value. Must be called at compile time to take effect (usually from unimport()).
unimport()
Returns true if hint name exists in current scope. Must be called at runtime.
Returns value associated with hint name or empty scalar if no such hint in scope. Must be called at runtime.
Returns all hints and their values in scope as hashref. Must be called at runtime.
Compile-time version of get(name). Returns value associated with hint name or empty scalar if no such hint enabled. Must be called at compile time.
get(name)
BEGIN { my $val = $^H{myhint}; }
XS::Framework
XS::Framework::Manual::SVAPI
To install XS::Framework, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XS::Framework
CPAN shell
perl -MCPAN -e shell install XS::Framework
For more information on module installation, please visit the detailed CPAN module installation guide.