Title: Briefvorlage

Hi!

 

Yes big thanks! That caused the problem!

I never use those predefined things so I don’t know their names ;-)

 

- Alex

 


Von: Hall, Philippe [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 27. Dezember 2004 20:11
An: Hartmaier Alexander
Betreff: RE: strange object oriented problem...

 

Hi,

$col is a "Predefined variable".  http://perl.apache.org/embperl/pod/doc/Embperl.-page-5-.htm#sect_16  Does that help?

 

-Philippe Hall

 

 -----Original Message-----
From: Hartmaier Alexander [mailto:[EMAIL PROTECTED]
Sent: Monday, December 27, 2004 2:02 PM
To: embperl@perl.apache.org
Subject: strange object oriented problem...

Hi list!

 

I started to use object oriented coding in (emb)perl on the 23rd ;-)

I just discovered a strange behaviour...

 

I define an array of object method names...

 

[-

  @colname = ( "name", "fk_device", "snmpid", "snmpid_rtt", "type", "speed", "mtu", "ipaddr", "ipnetmask", "description");

-]

 

A couple plain html lines later I have

 

[$ foreach $col ( @colname ) $]

      [$ if ($obj_int_nac->$col ne $obj_int_scan->$col) $]

        <tr class="light">

          <td class="dark">[+ $col +]</td>

          <td>[+ $obj_int_nac->$col +]</td>

          <td>[+ $obj_int_scan->$col +]</td>

        </tr>

      [$ endif $]

    [$ endforeach $]

 

This workaround code works:

 

[$ foreach $col ( @colname ) $]

      [-

        $col_name = $col;

        $nac  = $obj_int_nac->$col;

        $scan = $obj_int_scan->$col;

      -]

      [$ if ($nac ne $scan) $]

        <tr class="light">

          <td class="dark">[+ $col_name +]</td>

          <td>[+ $nac +]</td>

          <td>[+ $scan +]</td>

        </tr>

      [$ endif $]

    [$ endforeach $]

 

The variable $col gets overwritten after the ‘[$ if ($obj_int_nac->$col ne $obj_int_scan->$col) $]’ by a counter starting with ‘0’.

The result is an error that the method ‘0’ is unknown for the object ‘$obj_int_nac’...

 

Any ideas?

 

With kind regards

Alexander Hartmaier

 

T-Systems Austria GesmbH

Rennweg 97-99 1030 Wien

 

phone: +43 57057-4320

fax: +43 57057-95-4320

mobile: +43 676 8642 4320

mail: [EMAIL PROTECTED]

internet: http://www.t-systems.at

 

 


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Hinweis: Dieses E-mail kann vertrauliche und geschützte Informationen enthalten.
Sollten Sie nicht der beabsichtigte Empfänger sein, verständigen Sie bitte den Absender und löschen Sie dieses E-mail dann sofort.

Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Hinweis: Dieses E-mail kann vertrauliche und geschützte Informationen enthalten.
Sollten Sie nicht der beabsichtigte Empfänger sein, verständigen Sie bitte den Absender und löschen Sie dieses E-mail dann sofort.

Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

Reply via email to