in reply to The instance/type of a variable

ref() is a good start. Scalar::Util provides a number of other options, such as looks_like_number() (which tells you if something is probably a number), blessed() (which returns the class it's blessed into, if any). As for int vs. float, that's easy - int($a) == $a means it's an int.

The important point here is that when you program in Perl, you shouldn't have to worry about int vs. float. Personally, I tend to not worry about anything except reference, object, and non-reference.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: The instance/type of a variable
by jeanluca (Deacon) on Oct 19, 2005 at 13:51 UTC
    All this helps a lot!!!!
    Thanks
    Luca