9 use Inline ( 10 C => "DATA", 11 ($ENV{LIBUSB_LIBDIR} 12 ? ( LIBS => "-L\"$ENV{LIBUSB_LIBDIR}\" " . 13 ($^O eq 'MSWin32' ? ' -llibusb -L\"$ENV{W +INDDK}\\lib\\crt\\i386\" -lmsvcrt ' : '-lusb') ) 14 : ( LIBS => '-lusb', ) 15 ), 16 ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\ +"" ) : () ), 17 NAME => 'Device::USB', 18 VERSION => '0.35', 19 CCFLAGS => "$Config{ccflags} $ENV{CFLAGS} $ENV{CPPFLAGS}" +, 20 LDDLFLAGS => "$Config{lddlflags} $ENV{LDFLAGS}", 21 ); 22 print "CCFLAGS =>|$Config{ccflags}|$ENV{CFLAGS}|$ENV{CPPFLAGS}|\n +"; 23 print "LDDLFLAGS =>|$Config{lddlflags}|$ENV{LDFLAGS}|\n";

this gave the following errors and output:

root@gk-kubuntu-dev:~/dav/Nevada# perl kk.pl Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 10. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 10. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 10. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 22. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 22. CCFLAGS =>|-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno- +strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64||| Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 23. LDDLFLAGS =>|-shared -L/usr/local/lib -fstack-protector||

This indicates $ENV{CFLAGS},$ENV{CPPFLAGS} and $ENV{LDFLAGS} are uninitialized. I'll need to determine what they are supposed to be. There is not much useful I can find. I wonder why the package did not set the variables it needed. Could it be the botched cpan install? Frankly I have no idea what those things should be. I will try defining them as '' or some value

9 $ENV{CFLAGS} = 'A'; 10 $ENV{CPPFLAGS} = 'B'; 11 $ENV{LDFLAGS} = 'C'; 12 $ENV{LIBUSB_LIBDIR} = 'D'; 13 $ENV{WINDDK} = 'E'; 14 $ENV{LIBUSB__INCDIR} = 'F'; 15 use Inline ( 16 C => "DATA", 17 ($ENV{LIBUSB_LIBDIR} 18 ? ( LIBS => "-L\"$ENV{LIBUSB_LIBDIR}\" " . 19 ($^O eq 'MSWin32' ? ' -llibusb -L\"$ENV{W +INDDK}\\lib\\crt\\i386\" -lmsvcrt ' : '-lusb') ) 20 : ( LIBS => '-lusb', ) 21 ), 22 ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\ +"" ) : () ), 23 NAME => 'Device::USB', 24 VERSION => '0.35', 25 CCFLAGS => "$Config{ccflags} $ENV{CFLAGS} $ENV{CPPFLAGS}" +, 26 LDDLFLAGS => "$Config{lddlflags} $ENV{LDFLAGS}", 27 ); 28 print "CCFLAGS =>|$Config{ccflags}|$ENV{CFLAGS}|$ENV{CPPFLAGS}|\n +"; 29 print "LDDLFLAGS =>|$Config{lddlflags}|$ENV{LDFLAGS}|\n";

gives the following errors and output

Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 16. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 16. Use of uninitialized value in concatenation (.) or string at /usr/lib/ +perl5/Device/USB.pm line 16. CCFLAGS =>|-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno- +strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64|A|B| LDDLFLAGS =>|-shared -L/usr/local/lib -fstack-protector|C|

from what I can tell, every ENV variable is assigned something, Why are there still 3 concatenation errors?


In reply to Re^4: 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.