Hello all. My goal is to take the first 50 characters of a 400 character 
document and write it to a new file. For now I have been working on trying 
just to learn how to break strings. This code I created seems to allow me to 
break an inputted string into the separate words and list them. I was 
wondering how can I rewrite that code to take a x-variable amount of 
characters and rewrite them. This is my code:

print "Type in the text you want to break:";
$string=<STDIN>;
@fields= split (/ /, $string);
foreach $field (@fields) {
print("$field\n");
}
------------------------------------
Thank You. Joseph.

Reply via email to