(RADIATOR) sub append (Util.pm, v 2.19.1)

Sergey Y. Afonin asy at kraft-s.ru
Fri Apr 19 07:27:26 CDT 2002


Hello.

What do you think about this replace for "append" ?

sub append
{
    my ($file, $line) = @_;

    if ( substr($file, 0, 1) eq "|" ) {
      open(FILE, "$file") || return;
    }
    else {
      open(FILE, ">>$file") || return;
    }
    print FILE $line;
    close(FILE) || return;
    return 1;
}

It's allow write some logs to STDIN of external programs...
For example:
  PasswordLogFileName |/etc/radiator/logpwd

-- 
whith respect, Sergey Afonin
asy at kraft-s.ru

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list