Solved:Hash declared, but Perl complains "Global symbol ..."

English! place to talk about development, programming and coding
Post Reply
shostakovich
Znuny advanced
Posts: 146
Joined: 11 Apr 2011, 08:11
Znuny Version: 3.2.5

Solved:Hash declared, but Perl complains "Global symbol ..."

Post by shostakovich »

I'm declaring a hash %wf and assign values, then I want to immediately use $wf("FollowupState") - But Perl keeps on telling me: "Global symbol "$wf" requires explicit package name at /home/..." (forelast line with "testtest")- why is this? I read this happens upon using strict and undeclared variables...

I reckon I'm a Perl n00b 8) TIA

Code: Select all

use strict;
[...]
my %wf = (
   FollowupState          => 'WF::LogonID::ADUserDone',
   FollowupTicketTitle    => 'Neuer Titel des Tickets',
   FollowupArticleSubject => 'Dies ist das Subject.',
   FollowupArticleBody    => 'Dies ist ein Body mit Anweisungen für die Folgequeue.',
   FollowupQueueID        => 65 
);

   $Self->{TicketObject}->HistoryAdd(
      TicketID     => $Param{Data}->{TicketID},
      CreateUserID => $Param{UserID},
      HistoryType  => 'Misc',
      Name         => 'Testtest.' . $wf("FollowupState"),
   );
Last edited by shostakovich on 04 Oct 2011, 15:53, edited 1 time in total.
shostakovich
Znuny advanced
Posts: 146
Joined: 11 Apr 2011, 08:11
Znuny Version: 3.2.5

Re: Hash declared, but Perl complains "Global symbol ..."

Post by shostakovich »

Solved.

Code: Select all

$wf{"FollowupState"}
instead of

Code: Select all

$wf("FollowupState")
Post Reply