I don't know if the warnings have anything to do with it, but this code:

1 use Device::USB; 2 3 $usb = Device::USB->new(); 4 $dev = $usb->find_device('0403', '6001'); 5 printf("Device: %04X:%04X\n", $dev->idVendor(), $dev->idProduct( +)); 6 $dev->open(); 7 print "Manufactured by: $dev->manufacturer()\n"; 8 print "Product: $dev->product()\n";

gives the concatenation warnings plus:

Can't call method "idVendor" on an undefined value at kk.pl line 5, <D +ATA> line 1.

Here is the part of dmesg that applies

[349416.436284] usb 4-2: new full-speed USB device number 3 using uhci +_hcd [349416.634282] usb 4-2: New USB device found, idVendor=0403, idProduc +t=6001 [349416.634294] usb 4-2: New USB device strings: Mfr=1, Product=2, Ser +ialNumber=3 [349416.634302] usb 4-2: Product: FT232R USB UART [349416.634309] usb 4-2: Manufacturer: FTDI [349416.634316] usb 4-2: SerialNumber: A100X16Z [349416.642482] ftdi_sio 4-2:1.0: FTDI USB Serial Device converter det +ected [349416.642595] usb 4-2: Detected FT232RL [349416.642603] usb 4-2: Number of endpoints 2 [349416.642610] usb 4-2: Endpoint 1 MaxPacketSize 64 [349416.642618] usb 4-2: Endpoint 2 MaxPacketSize 64 [349416.642624] usb 4-2: Setting MaxPacketSize 64 [349416.644397] usb 4-2: FTDI USB Serial Device converter now attached + to ttyUSB0

OK, SLAM ON THE BRAKES: I jumped onto my Ubuntu 13.04 box and ran the same code. It asked for Device::USB. I installed it correcly by using apt-get install libdevice-usb-perl. The warnings went away and all I still have left is the error: "Can't call method "idVendor" on an undefined value at kk.pl line 5, <DATA> line 1." which is probably due to my lack of knowledge so I have to go study this. Thanks for your help and the lesson here is: IF YOU'RE USING UBUNTU, AVOID CPAN!!"


In reply to Re^6: Device::USB gives "Use of uninitialized value in concatenation" error by holandes777
in thread Device::USB gives "Use of uninitialized value in concatenation" error by holandes777

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.