Problems? Is your data what you think it is? | |
PerlMonks |
Re^5: Space between digitsby muba (Priest) |
on Nov 22, 2012 at 01:35 UTC ( [id://1005037]=note: print w/replies, xml ) | Need Help?? |
my $string = "(\d+)\:(\d+) (\d+)\/(\d+)\/(\d+)"; What is the purpose of this line? Does it really help you to do what you want to? What happens if you leave it out entirely? s/// works in place (that is, on the variable it is bound to). What happens if you rewrite it as this:
And of course, m// and s/// works on $_ in lieu of any other variable, so you could even just go:
Which could be shortend to:
Those parens serve no purpose, as you're seemingly not capturing anything, so we can be even more briefer without harming readability:
In Section
Seekers of Perl Wisdom
|
|