siva kumar has asked for the wisdom of the Perl Monks concerning the following question:

Its strange issue I am facing. 

Is there a possibility for a function not being called?

My part of the program flow is something like this: 

open(FH,"logfile.txt") or die ("can't open");
print FH "Before calling dumphash \n";
dumphash("", $rh_article);         -- Function Call

## FUNCTION:
sub dumphash {                  -- Function Definition 

my $prefix  = shift;
my $rh      = shift;          
print FH "Inside FUNCTION : dumphash \n";
Other statements here…

}

### End dumphash
print FH "After dumphash function \n";

Output 98% time:
Before calling dumphash
Inside FUNCTION : dumphash
After dumphash function

Outout Occasionaly:

Before calling dumphash
After dumphash function

-Sivakumar

Replies are listed 'Best First'.
Re: Function not being called
by Anonymous Monk on Mar 12, 2009 at 09:30 UTC
    Your shell is lying to you, observe
    C:\>perl -le"print qq!hello \rgoodbye!" goodbye C:\>perl -le"print qq!hello \rgoodbye!" |cat -v hello ^Mgoodbye^M C:\>perl -le"print qq!hello \rgoodbye!" |od -tx1 0000000 68 65 6c 6c 6f 20 0d 67 6f 6f 64 62 79 65 0d 0a 0000020