#!/usr/local/bin/perl -w
###########################################
# file-rm -- Delete a file without write
#   permissions on the file
# Mike Schilli, 2015 (m@perlmeister.com)
###########################################
use strict;
use Sysadm::Install qw( blurt );
use File::Path qw( rmtree );

mkdir "test";
blurt "data", "test/abc";
chmod 0333, "test";
chmod 0444, "test/abc";

# d-wx-wx-wx test
# -r--r--r-- test/abc

unlink "test/abc" 
    or die "unlink failed: $!";

rmtree "test";
