in reply to Package-Level Variables
This is meant for rough "Rosetta" comparison, and clearly the two languages have some very different idioms and distinct semantics on various features.
Foo.pm:
|
Foo.cpp:
|
I mention the C++ this twice for clarity, though these are implicit, not required, and rarely mentioned in C++. Note that static means something entirely different inside a C++ function versus outside a function. The Perl hack my $foo if 0; is not something I recommend, but does emulate C++'s static lexical variables (or as Larry calls them, "persistent" between calls).
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Package-Level Variables
by sauoq (Abbot) on Jul 25, 2003 at 20:42 UTC | |
by halley (Prior) on Jul 25, 2003 at 23:36 UTC | |
by sauoq (Abbot) on Jul 26, 2003 at 00:32 UTC | |
by tachyon (Chancellor) on Jul 26, 2003 at 07:01 UTC | |
|
Re: Re: Package-Level Variables
by Anonymous Monk on Jul 28, 2003 at 17:54 UTC |