Hi Lee,
On Fri, 28 Jun 2013 15:15:27 +0200
lee wrote:
> timothy adigun <2teezp...@gmail.com> writes:
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
> }
>
>
> my $counter = 0;
> while($counter < 5) {
>
timothy adigun <2teezp...@gmail.com> writes:
use strict;
use warnings;
sub test {
print $counter . "\n";
}
my $counter = 0;
while($counter < 5) {
test();
$counter++;
}
It says "Global symbol "$counter"
On 27/06/2013 15:44, Shawn H Corey wrote:
On Thu, 27 Jun 2013 15:07:58 +0200
"Dr.Ruud" wrote:
On 27/06/2013 12:58, lee wrote:
Ok, so perl has a totally broken design with variables :(
No, your understanding is broken. Can you come back after you fixed
it?
That is rude. The reason this li
On Thu, Jun 27, 2013 at 11:22 AM, Rob Dixon wrote:
> Something like this may help you
>
> use strict;
> use warnings;
>
> do_something({ title => 'TEST', value => 42 });
>
> sub do_something {
> my ($params) = @_;
> print $params->{title}, "\n";
> do_something_el
On 27/06/2013 11:58, lee wrote:
Shlomi Fish writes:
lee wrote:
the following example doesn't compile:
use strict;
use warnings;
sub test {
print $counter . "\n";
}
my $counter = 0;
while($counter < 5) {
test();
$counter++;
}
It says "Global symbol "$counter" requires exp
On Thu, Jun 27, 2013 at 12:58:38PM +0200, lee wrote:
> The subroutine is never called before $counter is declared, so
> it is always available to the subroutine. There should be an
> error only for instances when the subroutine is called before
> $counter is declared.
Much like in C or C++ (and m
> That is rude. The reason this list exists is to help people, not to
> tell them to go away. No wonder Perl is not a popular language.
Agreed. Dr. Ruud, that was uncalled for. You're not obligated to
respond to posters, and if that's the best response you have, not
responding would be a better ch
On Thu, 27 Jun 2013 15:07:58 +0200
"Dr.Ruud" wrote:
> On 27/06/2013 12:58, lee wrote:
>
> > Ok, so perl has a totally broken design with variables :(
>
> No, your understanding is broken. Can you come back after you fixed
> it?
>
That is rude. The reason this list exists is to help people, no
Hi,
On 6/27/13, lee wrote:
> Shlomi Fish writes:
>
>> Hi Lee,
>>
>> On Wed, 26 Jun 2013 10:18:44 +0200
>> lee wrote:
>>
>>> Hi,
>>>
>>> the following example doesn't compile:
>>>
>>>
>>> use strict;
>>> use warnings;
>>>
>>>
>>> sub test {
>>> print $counter . "\n";
>>> }
>>>
>>>
>>> my $cou
On 27/06/2013 12:58, lee wrote:
Ok, so perl has a totally broken design with variables :(
No, your understanding is broken. Can you come back after you fixed it?
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http:/
On Thu, 27 Jun 2013 12:58:38 +0200
lee wrote:
> Ok, so perl has a totally broken design with variables :( What's the
> solution to this problem?
The usual technique is to declare the configuration variables at the
top, followed by the file-scoped variables. It is convention that these
variable
Shlomi Fish writes:
> Hi Lee,
>
> On Wed, 26 Jun 2013 10:18:44 +0200
> lee wrote:
>
>> Hi,
>>
>> the following example doesn't compile:
>>
>>
>> use strict;
>> use warnings;
>>
>>
>> sub test {
>> print $counter . "\n";
>> }
>>
>>
>> my $counter = 0;
>> while($counter < 5) {
>> te
Hi
On 26 Jun 2013 09:49, "lee" wrote:
>
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
The variable $counter is not known here
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
Hi Lee,
On Wed, 26 Jun 2013 10:18:44 +0200
lee wrote:
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
>
> It says "Gl
Scope?
On Wednesday, June 26, 2013, lee wrote:
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
>
> It says "Global symbol "$cou
Hi,
the following example doesn't compile:
use strict;
use warnings;
sub test {
print $counter . "\n";
}
my $counter = 0;
while($counter < 5) {
test();
$counter++;
}
It says "Global symbol "$counter" requires explicit package name ...".
When I put the subroutine after the 'whil
16 matches
Mail list logo