![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3
![]() |
use strict and typeglobs
I am trying to experiment with using typglobs using the following code:
#!/indigoperl/bin/perl
#use warnings;
#use strict;
our ($spud,@spud);
$spud = "I am a scalar";
@spud = qw(I am an array);
sub spud
{
print "I am a sub routine;";
}
*potato = *spud;
print $potato;Quote:
__________________
Quote:
|
||
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jul 2008
Posts: 5
Rep Power: 0
![]() |
Re: use strict and typeglobs
Sure they can but you still have to declare your variables.
#!/indigoperl/bin/perl
use warnings;
use strict;
our ($spud,@spud,$potato);
$spud = "I am a scalar";
@spud = qw(I am an array);
sub spud
{
print "I am a sub routine;";
}
*potato = *spud;
print $potato; |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|