here is my complete code. Could someone please have a look through and help as I have been stuck for ages! Thanks Guys#!/usr/bin/perl -w use strict; use File::Copy; use warning; system("clear"); system("mount /dev/cd0 /mnt"); system("cp /mnt/* /usr/castle/pctemp/."); system("umount /mnt"); my $file; my $solar = "SO_PC"; my $stdpc = "MS_PC"; my $cv = "SO_CV"; my $mb = "ms_mc"; print("\n\n\n\n\n\n\t\t\tEnter File Name:"); my $input = <STDIN>; chomp($input); $file = $input; #Solar PC if(index(uc($file), uc($solar)) != -1) { print "Copying $file to Quotes Engine"; copy($file, "PCMAP.BIN"); system("mv PCMAP.BIN /usr/castle/np_new"); } #Standard PC elsif(index(uc($file), uc($stdpc)) != -1) { print "Copying $file to Quotes Engine"; copy($file, "FULLPC.BIN"); system("mv FULLPC.BIN /usr/castle/np_new"); } # CV elsif(index(uc($file), uc($cv)) != -1) { print "Copying $file to Quotes Engine"; copy($file, "CVFULLPC.BIN"); system("mv CVFULLPC.BIN /usr/castle/np_new"); } #MB elsif(index(uc($file), uc($mb)) != -1) { print "Copying $file to Quotes Engine"; copy($file, "MBFULLPC.BIN"); system("mv MBFULLPC.BIN /usr/castle/np_new"); }
In reply to Filename Partial Match function by Jalcock501
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |