#!/usr/bin/perl
# cpanel - perl_auto_link                         Copyright(c) 2009 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

my $auto     = 'auto';
my $dir      = '/usr/local/cpanel/perl';
my $filename = $dir . '/' . $auto;

chdir $dir or die "Could not change directories into $dir";
if ( !-l $auto ) {
    if ( -d $auto ) {
        system 'rm', '-rf', $filename;
    }
    elsif ( -e $auto ) {
        unlink $filename;
    }
    symlink '.', $auto;
}
