in reply to Troubles with descriptors

You said: "the Perl reports about error." What did 'the Perl' actually say? With out the error message, I am guessing in the dark here.

If you are running out of file-descriptors (which is how I interpret your question), are you closing the @adress file handle after you are done with the mailbox? If not, I can easily see how you are running up against the file-descriptor limit. (This is one of the classical examples of a 'memory leak', acquiring a resource but not returning it.) But, with out the actual error message, this is just hypothesis in vacuuo

Also, while I commend your use of the three argument open(), I have to fault your assumption that the open can't ever fail. Try this construct instead:

open $adress, ">", "$adress.mailbox" or die("Can't open $adress.mailbo +x -- $!\n");

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Troubles with descriptors
by Artimus (Sexton) on May 12, 2013 at 21:49 UTC
    Can't use string as a symbol ref while "strict refs" in use

    thank you, kind man=), I've solved it with:

    no strict 'refs';

      Except that you solve it the wrong way. Don't do that. Or use the "no strict refs" pragma only if there is an excellent reason to do it, i.e. probably never until you reach the level of Perl super-guru doing pure black magics.

      Here, all you need to do is to declare your variable with the 'my' function:

      open my $adress, ">", "$adress.mailbox";

      I would just add that you should not open a file without testing if it worked. So this would most probably be better:

      open my $adress, ">", "$adress.mailbox" or die "could not open mailbox $!\n";
        Using the same variable name for the file handle and part of the file name is confusing.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ