in reply to Breaking out of a while loop: Is there a better way?
Couldnt simplificate this with somethink like this?
perl -i -pe 'BEGIN{die "Wrong type of file or dont exist" unless $ARGV[0] =~ /\.wpl$/ and -e $ARGV[0]; open $PLAY, $ARGV[0]; while(<$PLAY>){$drive=$1,last if /src=\"(.)\:\\/}print {STDOUT} "It appears the original drive letter is $drive.\nWhat would you like the new drive letter to be?\n";chomp($letter=<STDIN>) until$letter =~/^[a-zA-Z]$/; print {STDOUT} "You want change the $drive drive letter to $letter.\n"}s/="$drive:\\/="$letter:\\/g; print {STDOUT} "."; END{print {STDOUT} $/}' file.wpl
|