Anyway, unquoting $message and putting the &= into the mode argument worked. Thank you.
In reply to Re^2: open to a scalar variable by girarde in thread open to a scalar variable by girarde