[Pdx-pm] New DA question - sub return'd values

Roderick A. Anderson raanders at acm.org
Thu Jan 8 07:17:54 CST 2004


Sometimes I feel like Red (from "That 70's Show) is talking to me!

When I use 'return N;' -- where N is a number -- in a sub(routine) is N
returned as as a number or a string?

I ask because I'm having some issues using the values in a (faked) switch 
construct.

$_ = typeofcust($username, $password);

CASE: {

   /1/ and do { ... ;
	last CASE; };
   /2/ and do { ... ;
	last CASE; };
   /3/ and do { ... ;
	last CASE; }
   blow_chunks;

}

If typeofcust() returns a value from 1, 2 or 3 is $_ treated as a string
or number by the match operation?


Once again - TIA,
Rod
-- 
    "Open Source Software - You usually get more than you pay for..."
     "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"





More information about the Pdx-pm-list mailing list