All pastes #802415 Raw Edit

Stuff

public text v1 · immutable
#802415 ·published 2007-11-30 03:59 UTC
rendered paste body
#!E:/Perl/bin/perl.exe -w
use strict;
use File::Copy;
&welcome_msg();
my ($workingDir, $arrayNumber, $fileIn, $shifter) = undef;
print "\n\nPlease Enter Working Dir : ";
while(<>)
{
	chomp;
	$workingDir = $_;
	if(!chdir($workingDir))
	{
	  print "Error :$!\n";
	} else
	{
	 chdir($workingDir);
	 print "Files? : ";
	 my @a = glob <STDIN>;
		$arrayNumber=@a;
		print "Please enter a folder name : ";
		$fileIn = <STDIN>;
		chomp($fileIn);
	 if(!-e $fileIn) { mkdir($fileIn) or die "Could not create $fileIn\n"; }
	   for(my $i=0;$i<$arrayNumber;$i++)
	   {
	   	 $shifter = shift(@a);
		 move($shifter,$fileIn);
	 	 print "\n$shifter moved to $fileIn";
	   }
	 print "\n";
	}
}

sub welcome_msg()
{
	print "\n\nYou've Decided to run $0 which was written by\n";
	print "Gnomer/PaTcH. The working are simple, but there\n";
	print "are things you should know. If the file name has spaces\n";
	print "then it will NOT sort the file. That will be fixed when I release\n";
	print "this for the public. If no folder exist, it makes the name\n";
	print "you specify.\n\n\n\tThank you, PaTcH/Gnomer\n";
}