sub call not getting params??

Russ Johnson russj at dimstar.net
Wed Jul 3 19:06:03 CDT 2002


I have this in a script I'm writing:

		foreach $tag ( @tags ) {
			if ( "$$tag" ) {
			$writer->startTag("$tag");
				$writer->characters("$$tag");
			$writer->endTag("$tag");
			}
		}

Which works fine. However, the part inside the if statement is repeated elsewhere, so I tried this:

		foreach $tag ( @tags ) {
			if ( "$$tag" ) {
			&writer( "$tag", "$$tag" );
			}
		}

sub writer {

	$writer->startTag("$_[0]");
		$writer->characters("$_[1]");
	$writer->endTag("$_[0]");

}

When I run this, I get value undefined in line ### where line ### is the line with $_[0] in it. So why are my parameters not making it to writer?

Thanks in advance!

-- 
"The power to untie is stronger than the power to tie."                         
                                                                                
Well, yeah, otherwise my shoes would tie themselves.                            
                                                                                
---                                                                             
                                                                                
Russ Johnson                                                                    
Stargate Online                                                                 
                                                                                
http://www.dimstar.net                                                          
telnet://telnet.dimstar.net                                                     
ICQ: 3739685:Airneil
TIMTOWTDI



More information about the Pdx-pm-list mailing list