$str = "this is just a test\nthis is another test\nthis is yet another test\n"; open F, "<", \$str or die; # open a handle to our string $/ = \5; # Read 5 characters at a time while () { # Read 'em! print "$_\n"; }