A very simple Perl-Script that prints some information about the current string, like length numbers and words:
#!/usr/bin/perl use strict; print str_stat("123 abc"); sub str_stat { my $var = shift; my $out .= "length = ".length($var); my @text = ("a-zA-Z","words","0-9","numbers"); my @reg = ('[a-zA-Z]','\w+','[1-9]','\d+'); for(0..$#text){ $out .="\n".$text[$_]." = "; $out .=()= $var =~ /$reg[$_]/g; } return($out.$/); }
Our result:
length = 7 a-zA-Z = 3 words = 2 0-9 = 3 numbers = 1
It’s a shame you don’t have a donate button! I’d withhout a doubt donate to this superb blog!
I suppose for now i’ll settlle for bookmarking annd adding your RSS feed to mmy Google account.
I look forward to new updates and wijll share this site with my Facebook group.
Chat soon!
Great blog here! Also your site loads up fast! What host are you using?
Can I get your affiliate link to your host?
I wish my web site loaded up as quickly as yours lol
I am regular reader, how are you everybody? This post posted at this website is
truly fastidious.
Hi, yup this article is truly fastidious and I have learned
lot of things from it concerning blogging. thanks.