in reply to imitation block device in linux

Are you sure you want a block device? (Like a hard disc), Perhaps you actually need a fifo or a character device. (Like a serial port or a unix named pipe.) I think you need to tell us a bit more about what you are attempting to do.

Named pipes are easy to create, just call mkfifo <filename> in your unix shell, or call mkfifo() from the POSIX module. With a named pipe you can setup your script to write into the pipe while other processes read, or vice versa. Pipe are uni-directional, but you can easily create a pair.

FUSE is for setting up filing systems. (With files, directories, access controls etc). There are perl modules that will help you setup a FUSE filesystem, and let you create virtual files that give access to information when they are read.