I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-07-02 22:11:39-07 by unstoppabledrew
foo.defined test throws error 'foo is undefined'
I am experiencing a weird problem I've never had before with the toolkit. I have the following in my template:
<sellerId> {[%- IF (sellerid_root.defined AND sellerid_instance.defined) -%] [%- sellerid_root -%][%- sellerid_instance -%] [%- ELSE -%] [%- seller_id -%] [%- END -%]} </sellerId>

If both sellerid_root & sellerid_instance are defined, it properly fills in the values. But if they are not defined, processing of the template dies on the IF line with the error:
undef error - sellerid_root is undefined

How can it be an error to test an undefined thing for definedness ? By definition that's half the cases.
Direct Responses: 5615 | Write a response
Posted on 2007-07-03 15:21:13-07 by unstoppabledrew in response to 5608
Re: foo.defined test throws error 'foo is undefined'
*Sigh* I'm an idiot. I just noticed one of my coworkers who had worked on the script added DEBUG_UNDEF to the new Template line. I've never used that option myself, so I was used to just treating undefined stuff as false, but perfectly ok.
Direct Responses: Write a response