Hi monks,

I'm trying to find out more about how the perl function 'do' works.
I'm aware that in almost all cases it's better to 'use', but please bear with me...
If I have a cgi script with the following:
do 'loation/to/code.pl';
and the code looks like such:
warn 'this is a warning';
everything works fine.
However with the following setup, it doesnt print the warning the the http error log...
Script:
do 'location/to/code.pl';
code.pl:
do 'location/to/another/code.pl';
another/code.pl
warn 'this is a warning from another code";
Can anyone explain this to me please?

Cheers,
Reagen

Big Update: I've discovered that the problem is not being caused by the do code, but because one of the blocks of code is forking into the background.
I'm still interested to know what is going on, ie. how i can see the warnings, but I'm not sure now what route to take.
Should I mark this question as mute and open a new one or continue with this one?
Cheers.

In reply to behaviour of do by rsiedl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.