SIMPLE SOLUTIONS

REX::SHARED::VAR(3PM) - Linux man page online | Library functions

Share variables across Rex tasks.

Chapter
2018-02-01
Rex::Shared::Var(3pm) User Contributed Perl Documentation Rex::Shared::Var(3pm)

NAME

Rex::Shared::Var - Share variables across Rex tasks

DESCRIPTION

Share variables across Rex tasks with the help of Storable, using a "vars.db.$PID" file in the local directory, where $PID is the PID of the parent process.

SYNOPSIS

BEGIN { # put share in a BEGIN block use Rex::Shared::Var; share qw($scalar @array %hash); # share the listed variables }

METHODS

share Share the passed list of variables across Rex tasks. Should be used in a "BEGIN" block. BEGIN { use Rex::Shared::Var; share qw($error_count); } task 'count', sub { $error_count += run 'wc -l /var/log/syslog'; }; after_task_finished 'count', sub { say "Total number of errors: $error_count"; };
perl v5.26.1 2018-02-01 Rex::Shared::Var(3pm)
Download raw manual
Index User Contributed Perl Documentation (+23303) perl v5.26.1 (+10548) № 3 (+68044)
Go top