Re: Illegal use of undefined subroutine..

2007-05-02 Thread Randal L. Schwartz
> "Somu" == Somu <[EMAIL PROTECTED]> writes: Somu> Actually, that was just an example to explain my problem. I am facing Somu> this problem when i use Tk. Any subroutine associated with the Somu> -command option of a button widget. Somu> use Tk; Somu> my $mw = MainWindow->new; Somu> my $b =

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote: Actually, that was just an example to explain my problem. I am facing this problem when i use Tk. Any subroutine associated with the -command option of a button widget. use Tk; my $mw = MainWindow->new; my $b = $mw->Button(-text=>'hello',-command=>su

Re: Illegal use of undefined subroutine..

2007-05-01 Thread John W. Krahn
Somu wrote: > Actually, that was just an example to explain my problem. I am facing > this problem when i use Tk. Any subroutine associated with the > -command option of a button widget. > > use Tk; > my $mw = MainWindow->new; > my $b = $mw->Button(-text=>'hello',-command=>sub { &welcome })->pack;

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Somu
Because if define it, it says 'Global variable "$l" needs...' what do i do? Actually, i am not happy nor sad that the subroutine needed a declaration before use.. I'm using ActivePerl 5.8.8 on Windows XP -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Somu
Actually, that was just an example to explain my problem. I am facing this problem when i use Tk. Any subroutine associated with the -command option of a button widget. use Tk; my $mw = MainWindow->new; my $b = $mw->Button(-text=>'hello',-command=>sub { &welcome })->pack; my $l = $mw->Label(-text

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote: my $s = <>; my $t = <>; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? It works allright only after add an extra line at the top, that is sub conc; its become just like C Your code works just fine for me (no errors)

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Chas Owens
On 5/1/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 5/1/07, Somu <[EMAIL PROTECTED]> wrote: > my $s = <>; > my $t = <>; > conc ( $s , $t ); > sub conc { > my $str = $_[0].$_[1]; > print $str; > } > > > Why? It works allright only after add an extra line at the top, that is > sub conc; >

Re: Illegal use of undefined subroutine..

2007-05-01 Thread Tom Phoenix
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote: my $s = <>; my $t = <>; conc ( $s , $t ); sub conc { my $str = $_[0].$_[1]; print $str; } Why? Why not? It works allright only after add an extra line at the top, that is sub conc; its become just like C Are you asking a question? Per