On Jul 19, Rajeev Rumale said:

>I feel if I override the main exit function in some way it would solve the
>problem as this is called by default at the end.
>
>Kindly let me know how I if this is correct way? and if so how can I do this
>with interfering with exit() in other modules.

The exit() function is only called when EXPLICITLY called.

But what you want to do is set up an END { ... } block.  This block is
execute when your code exits.

  #!/usr/bin/perl -w

  END { print "last\n" }
  BEGIN { print "first\n" }
  print "middle\n";

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to