David,
this appears to be exactly what i was looking for, and i thank you with
infinite groveling *g*. the reason i wanted something like this is
because i like to name my variables and cgi parameters the same as my
database fields - $school_id = school_id (cgi parameter) = school_id
(mysql field
Excellent info!
-Original Message-
From: david [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 1:59 PM
To: [EMAIL PROTECTED]
Subject: RE: reference problem (i think)
Joe Mecklin wrote:
> Dan,
>
> here is the output with your additions.
>
> BEFORE :: ID - 101
Joe Mecklin wrote:
> Dan,
>
> here is the output with your additions.
>
> BEFORE :: ID - 101
> NM - Arapaho Elementary
> AD - 1300 Cypress Dr.
>
> # this is the call to clear_input in ISD.pm
> $fields = school_id, school_name, school_address
> @field = school_id school_name school_address
ELDS => "school_id, school_name, school_address");
>
> Print "AFTER :: ID - $school_id \n NM - $school_name \n AD -
> $school_address \n";
>
> exit;
>
>
>
>
>
>
> -Original Message-
> From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
>
us know if it can access the variable
>directly or not
> #&ISD::clear_input(FIELDS => "school_id, school_name, school_address");
>
> Print "AFTER :: ID - $school_id \n NM - $school_name \n AD -
> $school_address \n";
>
> exit;
>
>
>
>
>
&
ot
> #&ISD::clear_input(FIELDS => "school_id, school_name, school_address");
>
> Print "AFTER :: ID - $school_id \n NM - $school_name \n AD -
> $school_address \n";
>
> exit;
>
>
>
>
>
>
> -Original Message-
> From: J
e, school_address");
Print "AFTER :: ID - $school_id \n NM - $school_name \n AD -
$school_address \n";
exit;
-Original Message-
From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 12:34 PM
To: Dan Muey
Subject: RE: reference problem (i think)
script I sent? What does it output?
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: reference problem (i think)
Hi Joe
I got a bit lost amongst all those 'print' statements, but
Hi Joe
I got a bit lost amongst all those 'print' statements, but what you need to
know is this:
$current_field = 'school_id';
${$current_field} = 1234;# same as $school_id = 1234
HTH,
Rob
"Joe Mecklin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTE
Hi Joe
I got a bit lost amongst all those 'print' statements, but what you need to
know is this:
$current_field = 'school_id';
${$current_field} = 1234;# same as $school_id = 1234
HTH,
Rob
"Joe Mecklin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTE
--
> From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 11:44 AM
> To: [EMAIL PROTECTED]
> Subject: RE: reference problem (i think)
>
>
> thanks Dan, but no go. here is the current incarnation, based on your
> suggestion:
>
> sub cl
d you
get that from? ( It could be totally legit I've just never seen it. )
Dan
-Original Message-
From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 12:05 PM
To: [EMAIL PROTECTED]
Subject: RE: reference problem (i think)
yes, the variables exist in the cal
may be better as -$$f- instead of .$$f. just incase
>it's trying to use a var named $f. instead of $f.
>
> Dan
> -----Original Message-
> From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 11:44 AM
> To: [EMAIL PROTECTED]
> Subject: RE: re
hat you get.
Also print "\$f = $f = .$$f." may be better as -$$f- instead of .$$f. just incase it's
trying to use a var named $f. instead of $f.
Dan
-Original Message-
From: Joe Mecklin [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 11:44 AM
To: [EMAIL PROTECTED
thanks Dan, but no go. here is the current incarnation, based on your
suggestion:
sub clear_input
{
no strict 'refs';
my %options = @_;
my $fields = $options{FIELDS};
my (@field) = split /, /, $fields;
print "\$fields = $fields ";
print "\@field = @field ";
foreach $f(@fields) {
$$f = ""; # or use undef, whatever
}
If strict refs is in use this won't work unless you turn them off do the $$f = ""; bit
then turn them back on if stricy refs was in use
So actually ( or somehting like it, I'm in a hurry and may have been sloppy )...
foreach $f
16 matches
Mail list logo