in reply to Re^3: Empty string checking in output
in thread Empty string checking in output

yes,i executed the block of code above its printing "true clause: array not empty" but how to find exactly what is there in that?i wrote dis code to check a configuration in cisco devices.

Replies are listed 'Best First'.
Re^5: Empty string checking in output
by AnomalousMonk (Archbishop) on Aug 17, 2011 at 13:56 UTC

    One way (there are many 'data dumpers'). Note: you must pass a reference to the array to the Dumper function.

    >perl -wMstrict -le "use Data::Dumper; my @output = qw(1 2 foo); print Dumper \@output; " $VAR1 = [ '1', '2', 'foo' ];

    See Data::Dumper.

      Thank you,let me learn and try this..i just want to ask one question ,is there any mistake in my code regarding about not executing the else block?

        What code? Do you mean the code of the original posting of Empty string checking in output? If so, there is definitely a mistake as explained by toolic in Re: Empty string checking in output: the value of the  @output array evaluated in scalar context (imposed by the comparison operator) and then stringified (for the string comparator) will never be anything other than a string like '0', '1', '2', etc., and so will never be anything other than not-equal to the empty string, and so the false clause of the conditional will never execute.