[26024] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8237 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 9 09:05:31 2005

Date: Sat, 9 Jul 2005 06:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 9 Jul 2005     Volume: 10 Number: 8237

Today's topics:
        Event Can't call method GetValue by thicking dynamicly  <rbcs@gmx.net>
        In basic I say Dim var$(50,50), how to make 2 dimension <max@xxxxxxx.xxx>
    Re: In basic I say Dim var$(50,50), how to make 2 dimen <1usa@llenroc.ude.invalid>
    Re: In basic I say Dim var$(50,50), how to make 2 dimen <max@xxxxxxx.xxx>
    Re: In basic I say Dim var$(50,50), how to make 2 dimen <jurgenex@hotmail.com>
    Re: In basic I say Dim var$(50,50), how to make 2 dimen <nobull@mail.com>
    Re: Net::FTP problem <notvalid@cox.net.invalid>
    Re: Problems understanding and implementing process man <notvalid@email.com>
    Re: Problems understanding and implementing process man <amheiserbush@yahoo.com.au>
    Re: Problems understanding and implementing process man <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 09 Jul 2005 12:29:25 +0200
From: RBCS <rbcs@gmx.net>
Subject: Event Can't call method GetValue by thicking dynamicly createt checkbox
Message-Id: <42cfa729$1_2@news.tiscalinet.ch>

Hello

I would like to create CheckBox and Radiobuttons dynamicly this works 
fine like this:

    # Create a Checkbox
    my $i;
    my $ypos = 100;
    my (@chkbox);
    my (@radiobox);
    for ($i=$Printer_ID; $i>0; $i-=1){
      $ypos =$ypos + $i*20;
      $chkbox[$i] = Wx::CheckBox->new( $this, -1, "Printer $i HP", [10, 
$h-$ypos] );
      $chkbox[$i]->SetValue( 0 );
      $chkbox[$i]->SetToolTip( "Click here to disable the $i Printer" );
      $radiobox[$i] = Wx::RadioButton->new( $this, -1, "Set Printer $i 
as Default", [300, $h-$ypos],wxDefaultSize );
      EVT_CHECKBOX( $this, $chkbox[$i], \&OnRadioButtons_Enable );
    }
    $radiobox[1]->SetValue( 1 );
    $this;
}

sub OnRadioButtons_Enable {
  my( $this, $event, $switchradio) = @_;
  $event->Enable( $switchradio->GetValue > 0 );
}

When I call the EVT_CHECKBOX  It crashes when I thck the box with the 
folowing error:
*
Can't call method "GetValue" on an undefined value at 
D:\unattended\install\Laureate\laureate.pl line 422.*

How can I correct this Function?

Many Thanks for your help

Roman


------------------------------

Date: Sat, 9 Jul 2005 08:25:24 +0200
From: "max" <max@xxxxxxx.xxx>
Subject: In basic I say Dim var$(50,50), how to make 2 dimensional aray in Perl?
Message-Id: <danqkk$p3$1@ss405.t-com.hr>

In basic language I say
Dim var$(50,50)
or
Dim var$(50,50,50)
, how to make 2 or 3 dimensional array in Perl?

Thanks




------------------------------

Date: Sat, 09 Jul 2005 08:28:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: In basic I say Dim var$(50,50), how to make 2 dimensional aray in Perl?
Message-Id: <Xns968E2D723DB84asu1cornelledu@127.0.0.1>

"max" <max@xxxxxxx.xxx> wrote in news:danqkk$p3$1@ss405.t-com.hr:

> , how to make 2 or 3 dimensional array in Perl?

perldoc perldsc

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Sat, 9 Jul 2005 11:28:20 +0200
From: "max" <max@xxxxxxx.xxx>
Subject: Re: In basic I say Dim var$(50,50), how to make 2 dimensional aray in Perl?
Message-Id: <dao5bk$ger$1@ss405.t-com.hr>

> > In basic language I say
> > Dim var$(50,50)
> > or
> > Dim var$(50,50,50)
> > , how to make 2 or 3 dimensional array in Perl?
>
> perldoc perldsc

I'm not sure that I understand.
In Perl I must use "arrays of arrays" to make multidimensional array?

Is that mean:

In Perl
$array[3][3]

In Basic is
DIM array (3,3)

?






------------------------------

Date: Sat, 09 Jul 2005 12:55:03 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: In basic I say Dim var$(50,50), how to make 2 dimensional aray in Perl?
Message-Id: <HOPze.4817$xB6.452@trnddc03>

max wrote:
>>> In basic language I say
>>> Dim var$(50,50)
>>> or
>>> Dim var$(50,50,50)
>>> , how to make 2 or 3 dimensional array in Perl?
>>
>> perldoc perldsc
>
> I'm not sure that I understand.
> In Perl I must use "arrays of arrays" to make multidimensional array?

Correct. Or rather almost correct because "array of array" is actually a 
sloppy term for "array of references to arrays".

> Is that mean:
>
> In Perl
> $array[3][3]
>
> In Basic is
> DIM array (3,3)

No. $array[3][3] is one individual/specific element of a nested array (it 
just happens to be the third element in the third array). Your Basic 
statement on the other hand declares a multidimensional array with 3x3 
elements. Two completely different things.

The closest corresponding Perl code would be
    my @array;
but that neither indicates the size (the size of Perl arrays is dynamic) nor 
that the values will be references to arrays (Perl doesn't care).

jue




------------------------------

Date: Sat, 09 Jul 2005 11:09:13 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: In basic I say Dim var$(50,50), how to make 2 dimensional aray in Perl?
Message-Id: <dao7og$4mt$1@slavica.ukpost.com>



max wrote:

>>>In basic language I say
>>>Dim var$(50,50)
>>>or
>>>Dim var$(50,50,50)
>>>, how to make 2 or 3 dimensional array in Perl?
>>
>>perldoc perldsc
> 

And perllol too!

> I'm not sure that I understand.
> In Perl I must use "arrays of arrays" to make multidimensional array?

Yes (as in many (most?) languages).

> Is that mean:
> 
> In Perl
> $array[3][3]
> 
> In Basic is
> DIM array (3,3)

Perl's inbuilt array type is not of fixed dimention.  Just use it as you 
want.  Thanks to a little thing we call autovivifiction simply referring 
to $array[2][2] will automagically create an new anonymous array and 
store a reference (pointer) to it in $array[2].

If you really want to prepopulate...

my @array = map {[(undef) x 3 ]} 1..3; # 3x3 array of undef

But usually there's no reason to prepopulate...

my @array; # Empty array use it as you want



------------------------------

Date: Sat, 09 Jul 2005 01:11:35 -0400
From: John Mason Jr <notvalid@cox.net.invalid>
Subject: Re: Net::FTP problem
Message-Id: <11cun4a2g9kqn7f@news.supernews.com>

lain wrote:
> Hi all,
> 
> I have big trouble on Net::FTP, could you please give me some idea??
> 
> My ftp server is on Win2K Prof, IIS.
> 
> First, I tried ftp on my linux server , it works fine.
> 
> Then I created a cgi script, run the script manually on linux server,
> to get the file from that Win2K and put on my linux server, it works
> fine too.
> 
> However, while i was on my php web system, submit the php POST to the
> cgi-script, it show me the internal error.
> I go to error log, it shows me the error:
>     cant open the file, permission denied.
> 
> I really do not know what's wrong, is it my ftp problem? coding
> problem or network prob??
> 
> 1. i have set the full permission on ftp folder in win2k.
> 2. chmod 777 on my cgi-script
> 3. the ftp folder located in C://inetpub/ftproot/test (created as
> virtual directory)
> 
> any suggestions, comments, helps are all welcomed.
> I'm going to try an alternative to do the task.
> 
> Thanks a lot!!


Make sure your directory listing style is Unix not MS-DOS on the IIS FTP
server


John


------------------------------

Date: Fri, 08 Jul 2005 23:14:42 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Problems understanding and implementing process management
Message-Id: <CNDze.3335$6%2.1524@newssvr21.news.prodigy.com>

James Calivar wrote:
> "Ala Qumsieh" <notvalid@email.com> wrote in message
> 
>>What GUI library are you using? If Tk, then perhaps you can use the
>>Tk::fileevent method, as described in its pods.
> 
> Tk is what I'm using.  The GUI part is all done; it's just this last one
> command that kicks off another process that is driving me nuts.

Ok, I can suggest two ways to proceed:

1. Use Tk::fileevent. I have done exactly the same thing before, but 
it's a bit tedious since you have to keep track of many things.

2. Use Tk::ExecuteCommand (available from CPAN) that is just a nice 
wrapper around Tk::fileevent that allows you to do cool things like:

  $ec = $mw->ExecuteCommand(...)->pack;
  $ec->execute_command;
  $ec->kill_command;

I would go with #2.

--Ala


------------------------------

Date: Sat, 09 Jul 2005 05:08:29 GMT
From: James Calivar <amheiserbush@yahoo.com.au>
Subject: Re: Problems understanding and implementing process management
Message-Id: <hZIze.19925$eM6.2785@newsread3.news.atl.earthlink.net>

A. Sinan Unur wrote:
> "James Calivar" <amheiserbush@yahoo.com.au> wrote in
> news:damkjv$k5k$1@home.itg.ti.com: 
> 
> 
>>Here is the code, 
> 
> 
> Please make an effort not to use extra comment lines that wrap when 
> pasted, and format you source code nicely. Consider running it through a 
> code beautifier even if you are not willing to follow the recommendations 
> given in perldoc perlstyle.
> 

OK - did I exceed some magic column number?

What is a code beautifier?

> I have been trying to run your code for the last 15 minutes, but it won't 
> due to various problems.
> 
> Sinan

Can you tell me what are the "various problems"?

Thanks

James


------------------------------

Date: Sat, 09 Jul 2005 08:24:34 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Problems understanding and implementing process management
Message-Id: <Xns968E2CDB26DECasu1cornelledu@127.0.0.1>

James Calivar <amheiserbush@yahoo.com.au> wrote in
news:hZIze.19925$eM6.2785@newsread3.news.atl.earthlink.net: 

> A. Sinan Unur wrote:
>> "James Calivar" <amheiserbush@yahoo.com.au> wrote in
>> news:damkjv$k5k$1@home.itg.ti.com: 
>> 
>> 
>>>Here is the code, 
>> 
>> 
>> Please make an effort not to use extra comment lines that wrap when 
>> pasted, and format you source code nicely. Consider running it
>> through a code beautifier even if you are not willing to follow the
>> recommendations given in perldoc perlstyle.
>> 
> 
> OK - did I exceed some magic column number?

I am not sure if it is magic, but I hope you can see the problem with

#-----------------------------------------------------------------------
-----------------#

which is 90 characters wide. 

> What is a code beautifier?

See, for example, <URL:http://perltidy.sourceforge.net/>
 
>> I have been trying to run your code for the last 15 minutes, but it
>> won't due to various problems.
 ...
> Can you tell me what are the "various problems"?

Well, when you have lines like the one above, perl does not just say, 
oh, the line was too long, it just spilled over to the next line, and 
created some weird thing. It says:

Number found where operator expected at D:\Home\gui.pl line
102, near "0"
        (Missing semicolon on previous line?)
Number found where operator expected at D:\Home\gui.pl line
108, near "0"
        (Missing semicolon on previous line?)
Can't modify negation (-) in predecrement (--) at D:\Home\gui.pl line 
18, near "$VERSION ="
syntax error at D:\Home\gui.pl line 102, near "0"
syntax error at D:\Home\gui.pl line 108, near "0"
syntax error at D:\Home\gui.pl line 130, near "sub startDaem
on "
syntax error at D:\Home\gui.pl line 136, near "}"
Execution of D:\Home\gui.pl aborted due to compilation errors.

Then, it is not clear at first sight, what is causing these problems. 
Then, after some time, I realized the long, vanity comments. At that 
point, I had no more motivation to try anything.

I am glad Ala was able to help you (and I learned something from his 
post). But the next time, I won't even see your post.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8237
***************************************


home help back first fref pref prev next nref lref last post