in reply to Re^12: global var
in thread global var
You know how people keep asking you to do the same thing ? And they ask again and again and again? And you never quite do exactly what they're asking? And even when the problem was solved two days ago, you still can't see it? The two things are connected Now, can you or can you not post 20 lines of code that runs and reproduces the problem (self-contained bug report)?
I don't know how to answer you. I ran the little code blocks that were posted and they ran fine with no error.
Please explain how: And even when the problem was solved two days ago, you still can't see it?
Tell me again and I will implement "the change" required.
So a made a little pair of units and the variable is passed.
#!/usr/bin/perl use strict; use warnings; use manageusers_2 qw($LoggedOn_user_id); print "$LoggedOn_user_id\n";
And
#!/usr/bin/perl use warnings; use strict; package manageusers_2; BEGIN { use vars qw($VERSION @ISA @EXPORT); use DBI; # $ENV{DBI_TRACE}=1; # $ENV{PERL_DBI_DEBUG}=1; require Exporter; @ISA = qw(Exporter); # exported functions our @EXPORT_OK = qw($LoggedOn_user_id); $VERSION = '0.0.1'; } our $LoggedOn_user_id=428; 1;
I made sure the aparameters in my real program were the same
It failed
$userid_1 = $manageusers::LoggedON_user_id; warn("userid : '$userid_1' ");
And the result is:
update_tables-development.cgi: Use of uninitialized value in concatena +tion (.) or string at update_tables-development.cgi line 66. userid : '' at update_tables-development.cgi line 66. [Sat Apr 8 13:55:38 2017] update_tables-development.cgi: userid : '' + at update_tables-development.cgi line 66.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^14: global var
by Anonymous Monk on Apr 08, 2017 at 19:30 UTC | |
|
Re^14: global var
by Anonymous Monk on Apr 08, 2017 at 20:24 UTC | |
by tultalk (Monk) on Apr 11, 2017 at 14:23 UTC | |
by huck (Prior) on Apr 11, 2017 at 15:23 UTC | |
by tultalk (Monk) on Apr 11, 2017 at 18:09 UTC | |
by huck (Prior) on Apr 11, 2017 at 18:33 UTC | |
| |
by Anonymous Monk on Apr 11, 2017 at 21:16 UTC | |
by huck (Prior) on Apr 11, 2017 at 21:51 UTC | |
| |
by Anonymous Monk on Apr 11, 2017 at 22:07 UTC |