From: Graham B. <gb...@us...> - 2002-10-24 13:04:48
|
Update of /cvsroot/perl-ldap/ldap/lib/Net/LDAP In directory usw-pr-cvs1:/tmp/cvs-serv19713/lib/Net/LDAP Modified Files: LDIF.pm LDIF.pod Log Message: Allow the file passed to new to be a pipe to/from a sub-process Index: LDIF.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/LDIF.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- LDIF.pm 24 Oct 2002 12:49:24 -0000 1.18 +++ LDIF.pm 24 Oct 2002 13:04:45 -0000 1.19 @@ -36,7 +36,9 @@ else { require Symbol; $fh = Symbol::gensym(); - my $open = ($mode{$mode} || "<") . $file; + my $open = $file =~ /^\| | \|$/x + ? $file + : (($mode{$mode} || "<") . $file); open($fh,$open) or return; $opened_fh = 1; } Index: LDIF.pod =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP/LDIF.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- LDIF.pod 24 Aug 2001 19:31:14 -0000 1.5 +++ LDIF.pod 24 Oct 2002 13:04:45 -0000 1.6 @@ -36,7 +36,8 @@ =item new ( [ FILE [, MODE [,OPTIONS ]]] ) FILE may be the name of a file or an already open filehandle. If a filename -is passed in then it will be opened with the mode specified. +is passed in then it will be opened with the mode specified. If FILE begins +or ends with a C<|> then FILE will be passed directly to C<open> MODE defaults to "r" for read. You may specify "w" to for write+truncate or "a" for write+append. |