in reply to Re: Troubles with descriptors
in thread Troubles with descriptors

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';

Replies are listed 'Best First'.
Re^3: Troubles with descriptors
by Laurent_R (Canon) on May 12, 2013 at 22:36 UTC

    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.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ