Hello again Monks,
I wanted to know scope of threads when I include package. I have a package called SPFTP and wanted to know if global variables will be global only to each thread, meaning each thread will have their own global vairables.
SPFTP is package.
# some code here.... for (0 ..3)) { my $thr = threads->create ( sub { my global_var; use SPFtp qw(/^\$/); use SPFtp qw (Connect Login PrepareLsFtpList deleteFile Get +File GetFileSize Logout GetMessage CheckConnection); worker(); } )->detach(); } # Master Thread while (1) { my global_var; use SPFtp qw(/^\$/); use SPFtp qw (Connect Login PrepareLsFtpList deleteFile GetFile G +etFileSize Logout GetMessage CheckConnection); master(); }
The question is does any "our" variable that is declared in SPFTP.pm unique to its self/thread? Also, will global_var be global variables?
In reply to Scope of thread variable by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |