Thank you for any help. James734#!/usr/bin/perl #macc auto format use warnings; use strict; use Shell qw( perl ); use Shell qw( dir ); use Shell qw( copy ); use Shell qw( del ); use Shell qw( cd ); system( "cd d:" ); system( "dir tmp/*.txt" ); my ($file, $list, $output, $copy, $backup, $remove, $orgin); $list = "dir tmp/*.txt"; $output = $list; print "$list"; print "Enter File Name to be converted.\n"; print "File should be in this directory.\n"; $file = <STDIN>; chomp($file); $copy = copy "/perl/$file /tmp/$file "; sleep 3; open my $IN, "<", $file or die "can't open $file: $!"; print "Staring Edits...1."; perl "/perl/macc1", "/tmp/$file"; sleep 2; print ",13.\n"; perl "/perl/macc13", "/tmp/$file"; print "Edits complete.\n"; print "Do you wish to keep the edits?\n"; print "Enter Yes or No.\n"; &answer(); sub answer() { $backup = <STDIN>; SWITCH: for ($backup) { /^(y|yes)$/i && do { del "/perl/$file"; last SWITCH; }; /^(n|no)$/i && do { copy "/perl/$file /tmp/$file", del "/perl/$file"; last SWITCH; }; #$remove = del "/perl/$file"; #$orgin = copy "/perl/$file /tmp/$file"; # Validate user input and return message if invalid print "\n\n=====================================\n"; print "You Have Entered and Incorrect Option\n"; print "Valid Options are [Y/N]\n"; print "=====================================\n\n"; &answer; } }
In reply to ActivePERL is the devil? by james734
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |