Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Apache::Registry - shared variable?

by Anonymous Monk
on Jun 20, 2013 at 14:48 UTC ( #1039984=note: print w/ replies, xml ) Need Help??


in reply to Apache::Registry - shared variable?

It appears as though this may be the issue

It isn't, not with the code you posted, it has no nested subs, it shares no variables (unless the code you haven't shown does that)

A problem is with CGI->Vars , you never want to use CGI->Vars, CGI->Vars is for perl4

Also , return from main, exit after main

main( @ARGV ); exit( 0 );
or exit main( @ARGV );


Comment on Re: Apache::Registry - shared variable?
Select or Download Code
Re^2: Apache::Registry - shared variable?
by DaisyLou (Acolyte) on Jun 20, 2013 at 15:07 UTC
    Thanks for the advice, and you're right -- there are no nested sub. I thought maybe mod-perl mangled it somehow to make one. I thought CGI stuff was made safe using Registry? What should be used in this case, instead, then?

      I thought CGI stuff was made safe using Registry? What should be used in this case, instead, then?

      use CGI->param not CGI->Vars , CGI->Vars has caveats

Re^2: Apache::Registry - shared variable?
by DaisyLou (Acolyte) on Jun 20, 2013 at 15:11 UTC
    ... Made the changes suggested, but the problem persists.

      ... Made the changes suggested, but the problem persists.

      :)

      If you want to solve this you will need to post real code that really shows the real problem

      oh? you say your code is too long? well you trim trim trim until the problem disappears, or you have short self contained compilable test case that shows the bug

      OTOH, what version of CGI.pm do you have installed?

        That is the real code, but I changed the names of the variables to protect the innocent and make it easier to understand/read in general.

        The only thing that's not included is the library code (other modules). If it's useful or helpful, let me know and I'll share the functions from those libraries.

        The SQL code returns two rows:

        a,b,c d,e,f

        Quite often, and especially if run in rapid succession, the output of "list" will be:

        a,b,c d,e,f a,b,c d,e,f
      You could try a single fetch statement
      my $list = ""; my $ar = $hStmt->fetchall_arrayref(); for (@$ar){ $list .= (join ',',@$_).';'; } print $list;
      poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-23 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls