Im reading a code for enhancement right now, but have little bit problem in understanding this portion of code in a file :

my $dateAndtime = `date`;
$dateAndtime =~ tr// /;
print "Start : ".$dateAndtime."\n";

As far as i know the "tr" code is for deleting or replacing something in a string..but what actually it does here?
help please,, thanks :)

That looks like perl. tr translates the first set of characters (empty in your case) to the second set of characters and returns the count. With an empty set that is basically a no-op. Perhaps there was a copy-paste error from where you pulled this script?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.