Chris Nandor <[EMAIL PROTECTED]> wrote:
> 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;
Now that you say it. Shure it's in the docs for Mac::Memory.
I should have guessed that since the Mac::Resources example use()s
Mac::Memory in the beginning.
Sorry for the hazzle.
> 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
Yup. Works fine. Thanks a lot!
Joergen