I was having him print the variables before and after the module was supposed to modify them to see what happened. That's what all the print statements are.
IE if the variables stil have values after the module then look in the module. IE if they don't the module is working like it should. The idea is to trim out all of the code that you can and still test what you're wondering about. That way you don't have some weird syntax 500 lines away form the code in question causing the code in question to act different than you expect. So did you actually run that little 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 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 PROTECTED]... > i'm building a routine in a module (ISD.pm) that will clear a list of > variables (set them to ""), with the intent of expanding the > functionality further in the future. when called, the sub is passed a > list of strings that are variable names without the leading "$". > > my goal is to append the "$" to each string (school_id becomes > $school_id, etc) then set $school_id = "". > > the expanded functionality is to allow a single argument to a sub be > used as the variable name and the CGI param() argument since i tend to > use the same name for each component. > > the call: > &ISD::clear_input(FIELDS => "school_id, school_name, school_address"); > > the sub: > # CLEAR_INPUT > # takes a list of variables (w/o the "$") to clear to an empty string > sub clear_input > { > my %options = @_; > my $fields = $options{FIELDS}; > my (@field) = split /, /, $fields; > > foreach my $current_field (@field) > { > my $field_name = "\$" . $current_field; > my $field_value = \$field_name; > print "\$current_field = .$current_field. : \$field_name = > $field_name = ." . \$field_value . ". <br />"; > print "\$current_field = .$current_field. = ." . > ${field_name} . ". <br />"; > } > } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]