[LUGA] Mit freundlicher Unterstützung von:
init.at

Mail Thread Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [luga] Perl: isBlessed() ???



On Wednesday, 25 June 2003 16:40, rs@ednet.at wrote:

> Ich brauche also etwas in der art:
>
> error2.5 if (!isBlessed $obj);
>
> Lieder hab ich da nichts gefunden.

Schau dir mal Scalar::Util an (ist üblicherweise bereits installiert).
Aus `perldoc Scalar::Util`:


   blessed EXPR
       If EXPR evaluates to a blessed reference the name of
       the package that it is blessed into is returned. Oth­
       erwise "undef" is returned.

          $scalar = "foo";
          $class  = blessed $scalar;           # undef

          $ref    = [];
          $class  = blessed $ref;              # undef

          $obj    = bless [], "Foo";
          $class  = blessed $obj;              # "Foo"


hth,
stefan




powered by LINUX the choice of a gnu generation
linux user group austria;
Suche
Suche
Letzte Änderung:
webmaster@luga.at
September 2010