NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
You are an idiot (Score:1)
Just look at it:
That’s clearly orders of magnitude easier to read than the Perl version.
Re: (Score:1)
Oh wait, it has to be this:
Or possibly chain the methods.
Perl can’t hold a candle to any of that.
Re: (Score:1)
But perl6 might...
http://xrl.us/ftqq [xrl.us]
http://xrl.us/5obh [xrl.us]
In Python that can be written as:
msg = msg.strip()Re: (Score:1)
msg = msg.strip()Re: (Score:1)
That won’t quite work. Make it
or maybe
Re:You are an idiot (Score:1)
use warnings;
my $string = " This is the test ";
sub trim {
my $a = $_[0];
$a = join(" ", split(" ", $a));
return $a;
}
my $nstring = trim($string);
print "$string\n";
print "$nstring\n";
I don't think it takes every case...but it works with the "test" string.
Reply to This
Parent