Help for this page
substr $string, 0, 30; # will extract UP TO the first 30 characters of the string. ... length($string) == 30; # tests if the string is 30 characters long.
my @strings = ( join ('', 'a' .. 'z' ), join ('', 'a' .. 'z', 0 .. 3 ), ... print 'regex : ', ( $string =~ m/.{30}/ ), "\n"; print 'regex : ', ( $string =~ m/(.{30})/ ), "\n"; }
string : abcdefghijklmnopqrstuvwxyz length : 26 substr : abcdefghijklmnopqrstuvwxyz ... substr : abcdefghijklmnopqrstuvwxyz0123 regex : 1 regex : abcdefghijklmnopqrstuvwxyz0123