that's my point exactly (couldn't get the words out just right tho'!) :(**
anyways, so you're essentially saying what i am (i think). that the way to get
a solution to the question is to do a "proper" dereferencing, outside of the
quoted string.
however, honza's solution works nicely as well:
print "hello, @{[ $textField->Text ]}, how are you?\n";
which i guess is a sneaky deref :)
Aaron Dalton <[EMAIL PROTECTED]> on 02/15/99 12:12:21 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (Sundar Raman/MW/US/3Com)
Subject: Re: [perl-win32-gui] Working with Values....HELP!
Dereferenceing does _not_ interpolate correctly, in any version of
Perl. You have to go:
print "Hello, ".$textField->Text.". Welcome!";
OR
print "Hello, ", $textField->Text, ". Welcome!";
Cheers!
Aaron :)
Sundar Raman wrote:
>
> are you sure you're trying the same thing? i mean, are you enclosing the
> function call in a quoted string:
> print "Hello, $textField->Text how are you?"; ?
>
> i'm getting the same result as jeremy. possibly a version issue? i'm on
> activeperl 509 on NT4 wkstn.
>
> my result:
> Hello, Win32::GUI::Textfield=HASH(0xde6408)->Text how are you?
>
> Aaron Dalton <[EMAIL PROTECTED]> on 02/15/99 11:34:37 AM
>
> Please respond to [EMAIL PROTECTED]
>
> To: [EMAIL PROTECTED]
> cc: (Sundar Raman/MW/US/3Com)
> Subject: Re: [perl-win32-gui] Working with Values....HELP!
>
> Drop the () after Text and just see. I'm sorry, but it works fine for
> me :(
>
> Cheers!
> Aaron :)
>
> Sundar Raman wrote:
> >
> > put returned values from any controls in an "external" context (don't know
the
> > jargon any better, sorry :( ), as below:
> > print "Hello, ", $textField->Text(), ", how are you?\n";
> > Otherwise perl seems to return the value of the reference (ie, it does not
> call
> > the method within the reference).
> >
> > Actually, I'm not even sure that you can call a method inside a quoted
string!
> > i mean, the result's that you get when you put all of the above into a
string
> > indicates that perl only evaluates the '$textField' portion, and provides
the
> > '->Text' piece unaltered.
> >
> > Sorry this is a half-ass explanation, but i'd like to hear something more
> > definitive from those that have a better understanding of perl's
> interpretation
> > in different contexts.
> >
> > HTH.
> >
> > "Jeremy K. Truax" <[EMAIL PROTECTED]> on 02/14/99 06:05:40 PM
> >
> > Please respond to [EMAIL PROTECTED]
> >
> > To: [EMAIL PROTECTED]
> > cc: (Sundar Raman/MW/US/3Com)
> > Subject: Re: [perl-win32-gui] Working with Values....HELP!
> >
> > I tried that and it doesn't seem to work. It prints "$textField->Text" as:
> >
> > Win32::GUI::DialogBox=HASH(0x650b2c)->Text
> >
> > Aaron Dalton wrote:
> >
> > > Use the Text property...like so:
> > >
> > > my $textField = $window->AddTextField(
> > > -name => 'password',
> > > -left => 3,
> > > -top => 5,
> > > );
> > >
> > > if ($textField->Text eq $storedPassword)
> > > {}
> > >
> > > "Jeremy K. Truax" wrote:
> > > >
> > > > Ok I'm fairly new to Perl and its Win32 Module. I am trying to do
> > > > something simple like get a value off of the input from the user. So I
> > > > made a textfield in which they type in say their name....then I cannot
> > > > get the value to the point where I can actually use it.
> > > >
> > > > For example:
> > > >
> > > > # here the dialog box object is created
> > > >
> > > > $myDialogBox = new Win32::GUI::DialogBox(
> > > > -name => "DialogBox",
> > > > -title => "DialogBox",
> > > > -top => 150,
> > > > -left => 170,
> > > > -width => 300,
> > > > -height => 150,
> > > > -visible => 1);
> > > >
> > > > # here I add the text field to type into
> > > >
> > > > $myDialogBox->AddTextfield(
> > > > -name => "TextField",
> > > > -password => 0,
> > > > -top => 40,
> > > > -left => 70,
> > > > -width => 90,
> > > > -height => 20,
> > > > -visible => 1);
> > > >
> > > > # here is the button which they click when done typing
> > > >
> > > > $myDialogBox->AddButton(
> > > > -name => "MyButton",
> > > > -text => "OK",
> > > > -top => 60,
> > > > -left => 70,
> > > > -visible => 1);
> > > >
> > > > # and here is what happens when they do click the button.
> > > >
> > > > sub MyButton_Click {
> > > > print "Hello $myDialogBox::TextField\n";
> > > > }
> > > >
> > > > the last part is what I'm having trouble with. $myDialogBox::TextField
> > > > doesn't seem the correct way to express the value of the text field.
> > > > What do I use for this?
> > > > In JavaScript the value is expressed like:
> > > > "myDialogBox.TextField.value". But I don't know how to do that here.
> > > >
> > > > Please, let me know if you can help me....thanks.
> > > >
> > > > --
> > > > Jeremy K. Truax
> > > > [EMAIL PROTECTED]
> > > > http://start.at/trupoetry
> > > > =========================
> > > > TruPoet's Romantic Love Poetry Yahoo! Club
> > > > http://clubs.yahoo.com/clubs/trupoetsromanticlovepoetry
> > > > ----------------------------
> > > > A belief is just an idea a person possesses; it's an idea that possesses
> > > > a person.
> > >
> > > --
> > > -----BEGIN GEEK CODE BLOCK-----
> > > Version: 3.1
> > > GCS/IT d+ s+:+>: a->? C+++ ULC>+++ P++++$ L>+++ E-
> > > W++$ N++(+) o>+ K++ w-- O@ M-- V PS-- PE++ Y+ PGP+
> > > t+ 5+++ X+(++) R tv+ b+++ DI++(+++) D++ G e>+++
> > > h+>---- r y-
> > > ------END GEEK CODE BLOCK------
> >
> > --
> > Jeremy K. Truax
> > [EMAIL PROTECTED]
> > http://start.at/trupoetry
> > =========================
> > TruPoet's Romantic Love Poetry Yahoo! Club
> > http://clubs.yahoo.com/clubs/trupoetsromanticlovepoetry
> > ----------------------------
> > A belief is just an idea a person possesses; it's an idea that possesses a
> > person.
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/IT d+ s+:+>: a->? C+++ ULC>+++ P++++$ L>+++ E-
> W++$ N++(+) o>+ K++ w-- O@ M-- V PS-- PE++ Y+ PGP+
> t+ 5+++ X+(++) R tv+ b+++ DI++(+++) D++ G e>+++
> h+>---- r y-
> ------END GEEK CODE BLOCK------
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d+ s+:+>: a->? C+++ ULC>+++ P++++$ L>+++ E-
W++$ N++(+) o>+ K++ w-- O@ M-- V PS-- PE++ Y+ PGP+
t+ 5+++ X+(++) R tv+ b+++ DI++(+++) D++ G e>+++
h+>---- r y-
------END GEEK CODE BLOCK------