RE: Use of uninitialized value



Beast <mailto:beast@xxxxxxx> wrote:

: my $value = get_value_from_external_program;
:
: How do avoid such warning, because value is coming from
: external program thus I can't make sure that it will
: return a string or null.

What do you want to do with $value when the external
program does not return a value?


One option is to supply a default value:

my $value = get_value_from_external_program || 'default';


Or:

my $value = get_value_from_external_program || '';


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328




.



Relevant Pages

  • Re: Avoiding uninitialized value warning?
    ... > comparing the first two fields of comma delimited data in a text file. ... > following warning: Use of uninitialized value in join or string... ... > to accomplish this and avoid the warnings. ...
    (comp.lang.perl.misc)
  • RE: Use of uninitialized value
    ... How do avoid such warning, ... external program thus I can't make sure that it will ... return a string or null. ... a Different Tape ID.',"\n"); ...
    (perl.beginners)
  • Use of uninitialized value
    ... How do avoid such warning, because value is coming from external program thus I can't make sure that it will return a string or null. ...
    (perl.beginners)
  • Re: Use of uninitialized value
    ... Charles K. Clarkson wrote: ... How do avoid such warning, ... external program thus I can't make sure that it will ...
    (perl.beginners)
  • Re: how to call foreign programs from c?
    ... >> I'd like to run check from within my c program a gnupg signature. ... > from the C program to get the output into your string. ... But there's no portable way to tell an external program to write its ... Many systems will support ...
    (comp.lang.c)