Illegal use of undefined subroutine..

2007-05-01 Thread Somu
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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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? Perhaps

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; its become just

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 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 =

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

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; my $l =

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=sub {