#! /usr/bin/perl use strict; use warnings; use Win32::File qw( ARCHIVE HIDDEN ); my $attrib; if ( Win32::File::GetAttributes( $0, $attrib ) ) { print "$0 has to be archived.\n" if $attrib & ARCHIVE; print "$0 is hidden.\n" if $attrib & HIDDEN; } else { print "Could not get attributes for $0.\n"; }