Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Function not being called

by siva kumar (Pilgrim)
on Mar 12, 2009 at 09:24 UTC ( [id://750103]=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://750103]
Approved by wfsp
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found