David Muir Sharnoff > File-Slurp-Remote > File::Slurp::Remote::SmartOpen

Download:
modules/File-Slurp-Remote-0.44.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.2   Source  

NAME ^

File::Slurp::Remote::SmartOpen - open files locally or remotely automatially

SYNOPSIS ^

 use File::Slurp::Remote::SmartOpen;

 smartopen($file, $fd, $mode);

DESCRIPTION ^

This module provides one function: smartopen($file, $fd, $mode). The function looks at the filename. If it has a colon in it, then it assumes that what comes before the colon is a hostname. If that hostname is not the hostname of the local system, it uses ssh to get to the remote system to open the file.

If the filename ends with .gz or .bz2, then it will pipe the input (or output) though zcat or bzcat (gzip or bzip2) as it opens the file.

The mode can be r or w. It defaults to read.

By default, remote files are accessed with

 ssh -o StrictHostKeyChecking=no

You can override that by redefining $File::Slurp::Remote::SmartOpen::ssh.

EXAMPLES ^

 smartopen("host1:/etc/passwd", my $fd, "r");

LICENSE ^

This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.

syntax highlighting: