Jalcock501 has asked for the wisdom of the Perl Monks concerning the following question:
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"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filename Partial Match function
by Eily (Monsignor) on Sep 18, 2013 at 09:09 UTC | |
|
Re: Filename Partial Match function
by choroba (Cardinal) on Sep 18, 2013 at 08:33 UTC | |
by Jalcock501 (Sexton) on Sep 18, 2013 at 09:20 UTC |