Tuesday, June 24, 2008

uudecode in perl

while (<>)
{
if (/^begin [0-7][0-7][0-7] ([^\n ]+)$/)
{
open (OUTPUT, ">$1") || die "Cannot create $1\n";
binmode OUTPUT;
while (<>)
{
last if /^end$/;
$block = unpack ("u", $_);
print OUTPUT $block;
}
close OUTPUT;
}
}

1 Comments:

Blogger Richard said...

That was helpful, thanks.

3:02 PM  

Post a Comment

<< Home