I had a DBI related perl problem today.

I had an array containing strings $test = ['a','b','c'];
then by mistake i used a numeric compare on one of the values
do_something if $test->[1] == 1;

after this the $test->[1] value is numeric ?? and DBI (selectall_hashref)
thought it was a number and didnt quote it (i used bind values)

is this a bug or a feature ??

Regards
Terje Kristensen

p.s. Here is the data from Devel::Peek

SV = RV(0x81050c8) at 0x8100a3c
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,ROK)
  RV = 0x80f7acc
  SV = PVAV(0x80f8fdc) at 0x80f7acc
    REFCNT = 1
    FLAGS = ()
    IV = 0
    NV = 0
    ARRAY = 0x81037f0
    FILL = 2
    MAX = 2
    ARYLEN = 0x0
    FLAGS = (REAL)
    Elt No. 0
    SV = PV(0x80f7da4) at 0x80f7bb0
      REFCNT = 1
      FLAGS = (POK,pPOK)
      PV = 0x8105e98 "a"\0
      CUR = 1
      LEN = 2
    Elt No. 1
    SV = PVNV(0x80f8890) at 0x80f79dc
      REFCNT = 1
      FLAGS = (NOK,POK,pNOK,pPOK)
      IV = 0
      NV = 0
      PV = 0x80fd340 "b"\0
      CUR = 1
      LEN = 2
    Elt No. 2
    SV = PV(0x80f7e4c) at 0x8100a18
      REFCNT = 1
      FLAGS = (POK,pPOK)
      PV = 0x8108860 "c"\0
      CUR = 1
      LEN = 2

Reply via email to