Jeez, this is a beginner's list? Y'all are defining my ignorance of this here purrl
stuff.
I hope someone with patience can help me out. In a simple login/registration program
using 5.6.1...
#!/usr/bin/perl -wT
use strict;
[CGI and DBI stuff]
$countryid="1";
$statename=$gotcha;
@r_states=getStates([EMAIL PROTECTED], \%states1, \%states2);
$stateid=$states2{$statename};
@r_counties=getCounties([EMAIL PROTECTED], \%counties1);
if ($CGI->param("Register")) {
Register($CGI, \%$counties1);
}
elsif ($CGI->param("Verify")) {
Verify($CGI);
}
else {
displayLoginScreen($CGI);
}
sub displayLoginScreen {
[misc stuff]
foreach $state(@states) { # I already have the state, of course
print "<option>$state"; # Still here for historical/testing
}
[more stuff]
}
Through the scope(?) of displayLoginScreen (main?) all of the state/county
arrays/hashes are available, though note the @states syntax instead of @$states. (Why
is this syntax working?) The states data is more persistent (I'll later figure out why
if ever a pattern emerges), but Verify knows the county stuff only until the first
validation error.
Instead of making subsequent db fetches I want to send(?) any/all of these to any/all
subsequent (inner?) subroutines that may need them. Is this possible and what might
the referencing/dereferencing look like?
Verify calls other subroutines and then another HTML page. That page calls Register.
Do I need to send references to Verify before sending them to the other subs?
You can see what I'm trying with Register. After many fanciful iterations of code I'm
still clueless. My wordiness is to encourage you to the same. Thanks to all.
--JM