in reply to Text::Template and the Binding of Package Variables

I never really use our, but as I understand it those are lexical avriables. You need to use globals if you want this to work (i.e. use vars).

Replies are listed 'Best First'.
Re: Re: Text::Template and the Binding of Package Variables
by princepawn (Parson) on Oct 03, 2003 at 19:56 UTC
    They are lexical variables, but I they are also package lexicals... to contrast: my variables do not have a package assoc'ed with them - they hang off of a piece of code. But our variables are package variables with lexical scope. The manpage talks about my variables as not working, but it may be that what you are saying about my variables applies.

    Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.

      Kind of seems like it should work, actually. You are assigning values to $main::start_date and $main::end_date and then your template runs in package main:: and refers to $start_date and $end_date without strict turned on. Maybe there's something special about the use of the main:: package. You could try declaring a package in your program and see if that helps.