<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl question in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270312#M72232</link>
    <description>hey ,Stuart.Thanks for your reply.&lt;BR /&gt;My problem is kinda more complex.&lt;BR /&gt;$a specifies a button.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$a = $mw -&amp;gt; Checkbutton ('-indicator'=&amp;gt;off, '-activebackground'=&amp;gt;green, '-border'=&amp;gt;15, '-text'=&amp;gt;green, -command=&amp;gt;\&amp;amp;action, '-variable'=&amp;gt;\$buta)-&amp;gt; place ( -x=&amp;gt;10, -y=&amp;gt;10, -height=&amp;gt;40, -width=&amp;gt;40);&lt;BR /&gt;&lt;BR /&gt;I wish to destroy this button if someone clicks on it.Of course it's simple if there's only one button.&lt;BR /&gt;But I wish to destroy a specific button if someone clicks on it....&lt;BR /&gt;</description>
    <pubDate>Fri, 07 May 2004 01:46:07 GMT</pubDate>
    <dc:creator>Alexander Chuzhoy</dc:creator>
    <dc:date>2004-05-07T01:46:07Z</dc:date>
    <item>
      <title>Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270310#M72230</link>
      <description>I want to be able to work with variable's value that's another variable's name.For example:&lt;BR /&gt; &lt;BR /&gt;%all=("\$a"=&amp;gt;$buta,"\$b"=&amp;gt;$butb);&lt;BR /&gt; for $temp(keys %all) {&lt;BR /&gt;                if ($all{$temp} eq 1) {&lt;BR /&gt;                            $temp-&amp;gt;destroy;&lt;BR /&gt;                             last;&lt;BR /&gt;                                        }                 &lt;BR /&gt;                   }&lt;BR /&gt;How can I achieve this?</description>
      <pubDate>Fri, 07 May 2004 01:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270310#M72230</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-07T01:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270311#M72231</link>
      <description>Umm, simpler than that.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;use strict;&lt;BR /&gt;my $a = "test";&lt;BR /&gt;my $b = "test2";&lt;BR /&gt;&lt;BR /&gt;my $adata = 'one';&lt;BR /&gt;my $bdata = 'two';&lt;BR /&gt;&lt;BR /&gt;my %hash = (&lt;BR /&gt;        $a =&amp;gt; $adata,&lt;BR /&gt;        $b =&amp;gt; $bdata&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;for my $key (keys %hash) {&lt;BR /&gt;        printf( "Got here with %s and %s\n", $key, $hash{$key} );&lt;BR /&gt;}</description>
      <pubDate>Fri, 07 May 2004 01:37:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270311#M72231</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-05-07T01:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270312#M72232</link>
      <description>hey ,Stuart.Thanks for your reply.&lt;BR /&gt;My problem is kinda more complex.&lt;BR /&gt;$a specifies a button.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$a = $mw -&amp;gt; Checkbutton ('-indicator'=&amp;gt;off, '-activebackground'=&amp;gt;green, '-border'=&amp;gt;15, '-text'=&amp;gt;green, -command=&amp;gt;\&amp;amp;action, '-variable'=&amp;gt;\$buta)-&amp;gt; place ( -x=&amp;gt;10, -y=&amp;gt;10, -height=&amp;gt;40, -width=&amp;gt;40);&lt;BR /&gt;&lt;BR /&gt;I wish to destroy this button if someone clicks on it.Of course it's simple if there's only one button.&lt;BR /&gt;But I wish to destroy a specific button if someone clicks on it....&lt;BR /&gt;</description>
      <pubDate>Fri, 07 May 2004 01:46:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270312#M72232</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-07T01:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270313#M72233</link>
      <description>Why don't you just pass the reference to the button to the "action" function and delete the button there?</description>
      <pubDate>Fri, 07 May 2004 01:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270313#M72233</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-05-07T01:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270314#M72234</link>
      <description>Hey,Mark!&lt;BR /&gt;Because this way I'll have to define different function for each button.&lt;BR /&gt;I'll do that if there's no choice, but I wish to make the program as smaller as possible. &lt;BR /&gt;Ego issues :)</description>
      <pubDate>Fri, 07 May 2004 02:01:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270314#M72234</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-07T02:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270315#M72235</link>
      <description>Try wrapping the destroy call in an eval:&lt;BR /&gt;&lt;BR /&gt;eval "$temp-&amp;gt;destroy";&lt;BR /&gt;&lt;BR /&gt;Also, the "if ($all{$temp} eq 1)" looks a&lt;BR /&gt;bit fishy; perhaps it should be&lt;BR /&gt;"if ($app{$temp})".&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;</description>
      <pubDate>Fri, 07 May 2004 14:44:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270315#M72235</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2004-05-07T14:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270316#M72236</link>
      <description>&lt;BR /&gt;You won't need a seperate function for each button.  define the command as&lt;BR /&gt;&lt;BR /&gt;[ \&amp;amp;action,$a ] for the first button&lt;BR /&gt;[ \&amp;amp;action,$b ] for the second button and so on.&lt;BR /&gt; &lt;BR /&gt;In you action function, destroy $_[0]</description>
      <pubDate>Sat, 08 May 2004 04:12:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270316#M72236</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-05-08T04:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270317#M72237</link>
      <description>Can't you use ${$temp}-&amp;gt;destroy ?&lt;BR /&gt;&lt;BR /&gt;I've not done much OO in perl.</description>
      <pubDate>Sat, 08 May 2004 19:11:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270317#M72237</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-05-08T19:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270318#M72238</link>
      <description>Hi,Gregory!&lt;BR /&gt;Thanks for the eval tip.&lt;BR /&gt;Regarding your second advise:&lt;BR /&gt;Also, the "if ($all{$temp} eq 1)" looks a&lt;BR /&gt;bit fishy; perhaps it should be&lt;BR /&gt;"if ($app{$temp})".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I specifically do&lt;BR /&gt; "if ($all{$temp} eq 1)" &lt;BR /&gt;because there's also&lt;BR /&gt; "if ($all{$temp} eq 2)" &lt;BR /&gt;&lt;BR /&gt;so:&lt;BR /&gt;"if ($app{$temp})" won't be good enough</description>
      <pubDate>Sun, 09 May 2004 07:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270318#M72238</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-09T07:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270319#M72239</link>
      <description>Stuart, in this particular case -I can't.&lt;BR /&gt;I probably miss something...</description>
      <pubDate>Sun, 09 May 2004 07:53:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270319#M72239</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-09T07:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270320#M72240</link>
      <description>Hey,Mark.Your last advice seems nice-although I can't make it work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here's a sample:&lt;BR /&gt;$a=$mw-&amp;gt;Checkbutton('-indicator'=&amp;gt;off,'-activebackground'=&amp;gt;green,'-border'=&amp;gt;15,'-text'=&amp;gt;green,-command=&amp;gt;sub {&amp;amp;action,$a},'-variable'=&amp;gt;\$buta)-&amp;gt;place(-x=&amp;gt;10,-y=&amp;gt;10,-height=&amp;gt;40,-width=&amp;gt;40);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub action {&lt;BR /&gt;destroy $_[0];&lt;BR /&gt;}&lt;BR /&gt;I guess the sintax isn't correct.But what exactly?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 09 May 2004 08:41:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270320#M72240</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-05-09T08:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270321#M72241</link>
      <description>I don't think you'll get away with an anonymous function in this case.  You'll need an "action" function and pass parameters to it as an array as in "-command =&amp;gt; [ \&amp;amp;action,$a ]"&lt;BR /&gt; &lt;BR /&gt;Then you need your destroy in the "action" subroutine.</description>
      <pubDate>Mon, 10 May 2004 05:14:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270321#M72241</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-05-10T05:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270322#M72242</link>
      <description>You could always ask the perlmonks.&lt;BR /&gt;&lt;A href="http://www.perlmonks.org" target="_blank"&gt;http://www.perlmonks.org&lt;/A&gt;</description>
      <pubDate>Thu, 03 Jun 2004 16:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-question/m-p/3270322#M72242</guid>
      <dc:creator>Sheldon Plankton</dc:creator>
      <dc:date>2004-06-03T16:45:13Z</dc:date>
    </item>
  </channel>
</rss>

