Hi
I am new user to ttk,
In some perl script I wanted to process __END__ part usinf \*DATA file
handle,
and I am passing a hash %p4u, in a foreach loop, which change %p4u
in each iteration,
But problem is, I am only getting the data that calculated in first
iteration, with all iteration
while in each iteration data of %p4u getting changed.
This is the foreach loop where i am processing template.
=========================================\/=========================================
  foreach ( grep $now - $_->{"Access"} > $days * 24 * 60 * 60, @{
$p4u{"list"} } ) {

    ${$p4u{"inactive_user"}}{"id_first_name"} = $1 if $_->{"FullName"} =~
/\s*(\S+)/;
    ${$p4u{"inactive_user"}}{"id"}            = $_->{"User"};
     .....
    @{${$p4u{"inactive_user"}}{"of"}}         =
      grep $_->{"user"}  eq ${$p4u{"inactive_user"}}{"id"}, @{
$all_open_files   };

    $template->process(\*DATA, \%p4u, \$mail_txt)  || die
$template->error();
    &process(\%p4u, \$mail_txt);
  }
=========================================/\=========================================

Please let me know
how i will get every time correct data that I assigned to %p4u in each
iteration ?

I will be thankful to you.

partial __END__ or \*DATA I have given at the end of mail.

-- 
Regard
         (`
         _) h a r a d

=========================================\/=========================================
...... [ perl script]

__END__

Hi [% inactive_user.id_first_name IF inactive_user.email ==
inactive_user.approver %],
[% IF optional_text -%]
[% optional_text %]
[%- END %]
You had *not* accessed perforce at perforce:1666
from [% inactive_user.days_not_used %] days.
So please let us know if
  [%- IF inactive_user.email == inactive_user.approver -%]
you are
  [%- ELSE -%]
he is
  [%- END -%]
not going to use
[%- IF inactive_user.email == inactive_user.approver -%]
your
  [%- ELSE -%]
his
[%- END -%]
perforce user id `[% inactive_user.id %]'.

This will help us to accomodate new perforce users,
because we have 374 limited number of per user licenses for all peoples.

[% IF inactive_user.of.size || inactive_user.oc.size -%]
  [%- IF inactive_user.email == inactive_user.approver -%]
you
  [%- ELSE -%]
he
  [%- END -%] have
  [%- IF inactive_user.of.size -%]
=========================================/\=========================================
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to