Can the indented code below be written better (fewer lines or easier/better algorithm)?
srand(time ^ $$); # i don't care about the seed $words = "Removes a random letter"; $randnum = int( rand( length($words) ) ); # always an interger number one less than the length # this was the only way I could think of (without using an array) $words =~ s/(.{$randnum})./$1/o; # to remove the random letter print "$subject $randnum\n"; __END__ What if I wanted to put this in a subroutine with out worrying about performance issues of the pattern match? Is there a better way without the pattern match I am doing? Nikola Janceski Summit Systems, Inc. 212-896-3400 I am not discouraged, because every wrong attempt discarded is another step forward. -- Thomas A. Edison ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]