In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Joergen W. Lang) wrote:

>     my $text = GetResource( 'TEXT', '256');
> 
>     print Dumper $text; 

>  This gives me:
> 
> $VAR1 = \bless( do{\(my $o = 65688)}, 'Handle' );
> 
> so I obviously have a handle to the resource. But how to get the actual
> data (should be something like 'here is the description')?

You have a Handle object, which is described in Mac::Memory.  You may need 
to "use Mac::Memory" in your script to gain access (as Mac::Resources 
doesn't load it for you).  The basic syntax is:

   print $text->get;

Other options on a Handle object include set(), append(), size().  e.g.,

   $ perl -MMac::Memory -le '
      $a = new Handle "foo";
      print $a->size;
      print $a->get;
      $a->append("bar");
      print $a->size;
      print $a->get;
   '
   3
   foo
   6
   foobar

Cheers,

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to