Ah, a Win32 named pipe (in Unix it is trivial). Fetch Win32API::File (if it didn't come with your copy of Perl) and you can do this:
and then just use FILE like you would any old Perl file handle. (See the module documentation for more details like how to open the pipe for write access or for read/write access, etc.) - tye (but my friends call me "Tye")use Win32API::File qw( createFile OsFHandleOpen ); my $h= createFile( "//./pipe/MyPipe", "r" ) or die "Can't read from pipe/MyPipe: $^E\n"; $^E= 0; # Clear possibly misleading errors out. OsFHandleOpen( FILE, $h, "r" ) or die "Can't associate Perl handle: $! ($^E)\n";
In reply to (tye)Re: How do I open a r/w named pipe as a file? *Should* be simple...
by tye
in thread How do I open a r/w named pipe as a file? *Should* be simple...
by Coleoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |