Hello there.

I got frustrated a little bit with my problem. I feel totally stuck as well so I hope to find some help here...

Here is my problem: I am using Win32::GUI module to create custom log viewer. This is great as finally I can have functionality all available viewers don't: I want to load a huge log file in the main window and then reload it in other window but filtered with regular expression entered in the main window. The new window is created in the following manner:

${"Window".$WindowCount} = new Win32::GUI::Window ( -name => "Window$WindowCount", -title => "RegExp$WindowCount", -pos => [100, 100], -size => [400, 400], -onTerminate => \&Buffer_OnQuit ) or die "new Window"; ${"Window".$WindowCount}->AddTextfield( -name => "RegExp", -pos => [10, 0], -size => [300, 21], -keepselection => 1 , -prompt => [ "RegExp Filter : ", 75] );
$WindowCount is the global counter which increases everytime new window is created. I need to have many windows opened! Each of them has editbox (for regexp text).
For the example above if $WindowCount == 1 I can get the regexp text like this: $var = $Window1->RegExp->Text but I CANNOT GET it like this:
$counter = 1; $var = ${"Window".$counter}->RegExp->Text
nor like this:
$var = ${"Window"."1"}->RegExp->Text
I get an error: "Can't call method "RegExp" on an undefined value..." Can someone explain it to me?


In reply to win32 perl module usage problem by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.