strict-subs revision 7c478bd95313f5f23a4c958a745db2134aa03244
f743002678eb67b99bbc29fee116b65d9530fec0wroweCheck strict subs functionality
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# no strict, should build & run ok.
4da61833a1cbbca94094f9653fd970582b97a72etrawick$b = "fred" ;
4789804be088bcd86ae637a29cdb7fda25169521jailletcuse strict qw(refs vars);
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrinuse strict ;
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrinno strict 'subs' ;
0a0df13b7f1f4f1a74fe295253d89ca3911b301aylavic# strict subs - error
0a0df13b7f1f4f1a74fe295253d89ca3911b301aylavicuse strict 'subs' ;
69301145375a889e7e37caf7cc7321ac0f91801erpluemBareword "Fred" not allowed while "strict subs" in use at - line 4.
69301145375a889e7e37caf7cc7321ac0f91801erpluemExecution of - aborted due to compilation errors.
506bfe33206b2fece40ef25f695af39dd4130facjkaluza# strict subs - error
506bfe33206b2fece40ef25f695af39dd4130facjkaluzause strict 'subs' ;
d58a848a016d401b965111e50ef829e1641f7834minfrinBareword "Z" not allowed while "strict subs" in use at - line 4.
d58a848a016d401b965111e50ef829e1641f7834minfrinBareword "A" not allowed while "strict subs" in use at - line 4.
2e6f4d654c96c98b761fb012fd25c5d5b1558c44sfExecution of - aborted due to compilation errors.
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavic# strict subs - error
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicuse strict 'subs' ;
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicBareword "Y" not allowed while "strict subs" in use at - line 4.
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicBareword "B" not allowed while "strict subs" in use at - line 4.
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicExecution of - aborted due to compilation errors.
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic# strict subs - error
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavicuse strict ;
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavicBareword "Fred" not allowed while "strict subs" in use at - line 4.
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavicExecution of - aborted due to compilation errors.
d7205b1a86c51c27b71a2c458dc453fd53a261c1covener# strict subs - no error
d7205b1a86c51c27b71a2c458dc453fd53a261c1coveneruse strict 'subs' ;
5d1ba75b8794925e67591c209085a49279791de9covener# Check compile time scope of strict subs pragma
5d1ba75b8794925e67591c209085a49279791de9coveneruse strict 'subs' ;
032982212dbcc7c3cce95bf89c503bb56e185ac7kbrand no strict ;
032982212dbcc7c3cce95bf89c503bb56e185ac7kbrand my $a = Fred ;
caad2986f81ab263f7af41467dd622dc9add17f3ylavicmy $a = Fred ;
caad2986f81ab263f7af41467dd622dc9add17f3ylavicBareword "Fred" not allowed while "strict subs" in use at - line 8.
caad2986f81ab263f7af41467dd622dc9add17f3ylavicExecution of - aborted due to compilation errors.
f7317ff316c2b141feea31bddb74d5d3fa1584edjorton# Check compile time scope of strict subs pragma
a34684a59b60a4173c25035d0c627ef17e6dc215rpluem use strict 'subs' ;
1e2d421a36999d292042a5539971070d54aa6c63ylavic my $a = Fred ;
1e2d421a36999d292042a5539971070d54aa6c63ylavicmy $a = Fred ;
fa7ed98b9dc94c5845cf845aea0a44ecacd290c9humbedoohBareword "Fred" not allowed while "strict subs" in use at - line 6.
fa7ed98b9dc94c5845cf845aea0a44ecacd290c9humbedoohExecution of - aborted due to compilation errors.
0b67eb8568cd58bb77082703951679b42cf098actrawick# Check compile time scope of strict vars pragma
0b67eb8568cd58bb77082703951679b42cf098actrawickuse strict 'vars' ;
fb1985a97912b25ec6564c73e610a31e5fc6e25fcovener no strict ;
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavicVariable "$joe" is not imported at - line 8.
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavicGlobal symbol "$joe" requires explicit package name at - line 8.
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavicExecution of - aborted due to compilation errors.
e466c40e1801982602ee0200c9e8b61cc148742djailletc# Check compile time scope of strict vars pragma
457468b82e59d01eba00dd9d0817309c8f5e414ejim use strict 'vars' ;
457468b82e59d01eba00dd9d0817309c8f5e414ejim $joe = 1 ;
15660979a30d251681463de2e0584853890082accovenerGlobal symbol "$joe" requires explicit package name at - line 6.
15660979a30d251681463de2e0584853890082accovenerExecution of - aborted due to compilation errors.
cfd9415521847b2f9394fad04fb701cfb955f503rjung# Check runtime scope of strict refs pragma
cfd9415521847b2f9394fad04fb701cfb955f503rjunguse strict 'refs';
28c31fb73c1264bd1d0ff932573677030b024c7dwrowemy $b = "fred" ;
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe no strict ;
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe my $a = $$b ;
8491e0600f69b0405e156ea8a419653c065c645bcovenermy $a = $$b ;
63b9f1f5880391261705f696d7d65507bbe9ace3covenerCan't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 10.
49dacedb6c387b786b7911082ff35121a45f414bcovener# Check runtime scope of strict refs pragma
3c990331fc6702119e4f5b8ba9eae3021aea5265jimmy $b = "fred" ;
3c990331fc6702119e4f5b8ba9eae3021aea5265jim use strict 'refs' ;
3c990331fc6702119e4f5b8ba9eae3021aea5265jim my $a = $$b ;
fc42512879dd0504532f52fe5d0d0383dda96a1eniqmy $a = $$b ;
0451df5dc50fa5d8b3e07d92ee6a92e36a1181a5niqCan't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 8.
da0442c0440caef34706e2c2f3af05cb65921cc0jailletc# Check runtime scope of strict refs pragma
da0442c0440caef34706e2c2f3af05cb65921cc0jailletcmy $b = "fred" ;
06b8f183140c8e02e0974e938a05078b511d1603covener use strict 'refs' ;
06b8f183140c8e02e0974e938a05078b511d1603covener $a = sub { my $c = $$b ; }
259878293a997ff49f5ddfc53d3739cbdc25444ecovenerCan't use string ("fred") as a SCALAR ref while "strict refs" in use at - line 8.
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrinuse strict 'subs' ;
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrinmy $a = Fred ;
65967d05f839dbf27cf91d91fa79585eeae19660minfrinBareword "Fred" not allowed while "strict subs" in use at - line 3.
65967d05f839dbf27cf91d91fa79585eeae19660minfrinExecution of - aborted due to compilation errors.
8152945ae46857b170cb227e79bb799f4fc7710dminfrin--FILE-- abc
8152945ae46857b170cb227e79bb799f4fc7710dminfrinmy $a = Fred ;
75f5c2db254c0167a0e396254460de09b775d203trawickuse strict 'subs' ;
75f5c2db254c0167a0e396254460de09b775d203trawickrequire "./abc";
5716f9c6daa92dde5f2f9d11ed63f7c9549c223atrawick--FILE-- abc
5716f9c6daa92dde5f2f9d11ed63f7c9549c223atrawickuse strict 'subs' ;
54d750a84a175d8e338880514d440773eb986b50covenerrequire "./abc";
54d750a84a175d8e338880514d440773eb986b50covenermy $a = Fred ;
54d750a84a175d8e338880514d440773eb986b50covener--FILE-- abc
54d750a84a175d8e338880514d440773eb986b50coveneruse strict 'subs' ;
7a3aa12f0eda24793ee26d6a179bd53132e9dae8covenermy $a = Fred ;
4e30ef014533a7e93c92d88306291f5e49c9692ftrawickrequire "./abc";
5f066f496cd9f20a2a701255bc67d44e7cb46daetrawickBareword "Fred" not allowed while "strict subs" in use at ./abc line 2.
5f066f496cd9f20a2a701255bc67d44e7cb46daetrawickCompilation failed in require at - line 2.
2e15620d724fb8e3a5be183b917359a2fd6e9468coveneruse strict 'subs' ;
2e15620d724fb8e3a5be183b917359a2fd6e9468covenermy $a = Fred ;
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovenerBareword "Fred" not allowed while "strict subs" in use at abc.pm line 2.
b8efdc95bec9cf089aa1be0bfd07d46aa1137a7acovenerCompilation failed in require at - line 2.
f06e7c4b1bce6b6491e5de0b7998d3f5696b293dchrisdBEGIN failed--compilation aborted at - line 2.
179565be4043d7e5f9161aa75271fa0a001866d9covener# Check scope of pragma with eval
111436a32ba1254291e4883292fb116d15fe8f64covener my $a = Fred ;
fce4949fb0b309a5744afcd503c6ed2d35621ee2covenerprint STDERR $@;
fce4949fb0b309a5744afcd503c6ed2d35621ee2covenermy $a = Fred ;
ccc20788c1e5fc973f36df634399c89acb70deaejerenkrantz# Check scope of pragma with eval
273e512f20f262e5e2aa8e0e83371d1929fb76adjkaluza use strict 'subs' ;
273e512f20f262e5e2aa8e0e83371d1929fb76adjkaluza my $a = Fred ;
efe780dcf13b2b95effabf897d694d8f23feac74trawickprint STDERR $@;
fe83f60b41477b14a37edcfcd1f7f5c5a1ebfe44minfrinmy $a = Fred ;
fe83f60b41477b14a37edcfcd1f7f5c5a1ebfe44minfrinBareword "Fred" not allowed while "strict subs" in use at - line 6.
993d1261a278d7322bccef219101220b7b4fb8c5jkaluzaExecution of - aborted due to compilation errors.
ba050a6f942b9fa0e81ed73437588005c569655ccovener# Check scope of pragma with eval
ba050a6f942b9fa0e81ed73437588005c569655ccoveneruse strict 'subs' ;
ba050a6f942b9fa0e81ed73437588005c569655ccovener my $a = Fred ;
135ddda3a989215d2bedbcf1529bfb269c3eda23niqprint STDERR $@;
135ddda3a989215d2bedbcf1529bfb269c3eda23niqmy $a = Fred ;
001a44c352f89c9ec332ffd3e0a6927dcd19432chumbedoohBareword "Fred" not allowed while "strict subs" in use at - line 5.
001a44c352f89c9ec332ffd3e0a6927dcd19432chumbedoohBareword "Fred" not allowed while "strict subs" in use at - line 8.
efe780dcf13b2b95effabf897d694d8f23feac74trawickExecution of - aborted due to compilation errors.
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecovener# Check scope of pragma with eval
9b0076ddd1103e5fa9c1f9bafde4b06ce244fbaecoveneruse strict 'subs' ;
249d09d51808cb7981af99762c3b3736ca126cd5jkaluza no strict ;
249d09d51808cb7981af99762c3b3736ca126cd5jkaluza my $a = Fred ;
249d09d51808cb7981af99762c3b3736ca126cd5jkaluzaprint STDERR $@;
56589be3d7a3e9343370df240010c6928cc78b39jkaluzamy $a = Fred ;
56589be3d7a3e9343370df240010c6928cc78b39jkaluzaBareword "Fred" not allowed while "strict subs" in use at - line 9.
77ca16c5676da23155311e13cee61e7eaba9fa3ejailletcExecution of - aborted due to compilation errors.
77ca16c5676da23155311e13cee61e7eaba9fa3ejailletc# Check scope of pragma with eval
4d12805e6c18253040223ea637acd6b3b3c18f60jorton'; print STDERR $@ ;
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener# Check scope of pragma with eval
cb666b29f81df1d11d65002250153353568021fccovener use strict 'subs' ;
cb666b29f81df1d11d65002250153353568021fccovener]; print STDERR $@;
1c2cab00d988fc48cbe59032cf76cc0bab20d6f7covenerBareword "Fred" not allowed while "strict subs" in use at (eval 1) line 3.
75a230a728338d84dcfe81edd375352f34de22d0covener# Check scope of pragma with eval
75a230a728338d84dcfe81edd375352f34de22d0coveneruse strict 'subs' ;
1f50dc34ae069adeed20b2986e5ffdefa5c410e0covener'; print STDERR $@ ;
63a5ea80bddcc84a462e40f402b4f330e0e05411covenerBareword "Fred" not allowed while "strict subs" in use at (eval 1) line 2.
65a4e663b82f8bce28ac22ab2edfd7502de36998sf# Check scope of pragma with eval
65a4e663b82f8bce28ac22ab2edfd7502de36998sfuse strict 'subs' ;
65a4e663b82f8bce28ac22ab2edfd7502de36998sf no strict ;
c7de1955eb0eaeabf7042902476397692672d549sf my $a = Fred ;
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrin'; print STDERR $@;
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrinmy $a = Fred ;
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrinBareword "Fred" not allowed while "strict subs" in use at - line 8.
a511a29faf2ff7ead3b67680154a624effb31aafminfrinExecution of - aborted due to compilation errors.
a511a29faf2ff7ead3b67680154a624effb31aafminfrin# see if Foo->Bar(...) etc work under strictures
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrinpackage Foo; sub Bar { print "@_\n" }
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrinFoo->Bar('a',1);
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrinBar Foo ('b',2);
deec48c67d4786bc77112ffbf3a4e70b931097edminfrinFoo->Bar(qw/c 3/);
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrinBar Foo (qw/d 4/);
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrinFoo::->Bar('A',1);
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrinBar Foo:: ('B',2);
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrinFoo::->Bar(qw/C 3/);
684e0cfc200f66287a93bbd1708d1dd8a92a7eefcovenerBar Foo:: (qw/D 4/);