>>>>> "k" == kz <> writes:
k> "John W. Krahn" <> wrote in message
k> news:...
>> Because localtime returns a scalar in scalar context and a list in list
>> context and since print forces a list context you need to insert
>> "scalar" to force a scalar context.
k> Is "ref" THE (best) way to check the context of an expression, like this:
k> if (ref($r) eq "sometype") {
k> print "r is a reference to sometype.\n";
k> }
huh? where is the context checked there? do you have a basic
understanding of list vs scalar context? the code AROUND or NEAR an
expression provides the context, not the expression itself. you can't
directly check the context inside an expression but you don't need to,
you just look at the code and you can see what context is provided. but
there is a way to do so inside a sub and that is with wantarray.
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org