From: Roman Makurin <dro...@gmail.com> > On Tue, Jun 23, 2009 at 12:46:33PM +0200, Jenda Krynicky wrote: > > From: Roman Makurin <dro...@gmail.com> > > > Just looked throught some standart perl modules and found > > > something cryptic to myself: > > > > > > package Module; > > > > > > $Module::VERSION = '1.0'; > > > $Module::VERSION = eval $Module::VERSION; > > > > > > Why eval part is needed here ? > > > > It's not. What module was that? Maybe you skipped something that was > > the reason. > > File::Spec and CPAN, maybe other
Looks like cargo culting to me. Maybe someone let their source control system update the version string and needed the eval to turn it into something Perl understands. In this case you'd get the same result by $Module::VERSION = 0 + $Module::VERSION; because the only difference between the $VERSION before and after the line above or the eval is that before it's a string and after it's a number. But Perl happily converts that any time it's needed so it's irrelevant in all except very very few cases. I'm actually not so surprised it's in File::Spec. That's one heck of an inconveniently designed module. Jenda ===== je...@krynicky.cz === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/