On Mon, Mar 28, 2011 at 05:22, a b <testa...@gmail.com> wrote:
> Thanks Rob
>
> I too was thinking that way. Just in case if any one might have face this
> issue and hence this email
>
> Well if no module i will live with it for time being
snip

The Unix dd command is a swiss army knife of copying data, could you
narrow it down to what you want to use dd for?  A simple
implementation would be

#!/usr/bin/perl

use strict;
use warnings;

die "usage: $0 infile outfile\n" unless @ARGV == 2;

open my $in, "<:raw", $ARGV[0]
        or die "could not open $ARGV[0]: $!\n";
open my $out, ">:raw", $ARGV[1]
        or die "could not open $ARGV[1]: $!\n";

local $/ = \4096; #read 4k at a time

print $out $_ while <$in>;



-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to