Hello monks, I am trying to print xml type output using perl for which I used XML::Simple module.When I check one value is defined or not like this
sub error_excerpt{ return defined($error_excerpt)?$self->{_error_excerpt}:"No Error Excer +pt."; }
and I print corresponding value in sub print like this:
if(defined $self->error_excerpt()) { printf("\t\tError Excerpt:\t\t%s\n", $self->error_excerpt()); }
I am getting an output
<error_excerpt>No Error Excerpt</error_excerpt>although the error excerpt value is defiened..
One more thing when I used
sub error_excerpt{ $self->{_error_excerpt} = $error_excerpt if defined($error_excerpt); return $self->{_error_excerpt}; }
I gets proper error excerpt value where the error_excerpt is defined and I do not get any value and just gets
<error_excerpt></error_excerpt>where I actually wants to print "No error Excerpt exist"
Can anybody tell me where I am doing mistake?If possible rectify me.Thanks in advance !!!!
In reply to Question on XML output using Perl by siddheshsawant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |