programming-examples/perl/String/Passing variable to length() function.pl

12 lines
235 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
use warnings;
use strict;
my $string = "hello there\n";
print "The original string: ", 'hello there\n', "\n\n";
my $length = length( $string );
print "The length of \$string (default) is: $length \n";