|
Revision 13, 1.5 kB
(checked in by scottmc, 3 years ago)
|
|
Added old perl modules
Starting to think maybe I should structure the new repository differently
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | use warnings FATAL => "all"; |
|---|
| 4 | use strict; |
|---|
| 5 | |
|---|
| 6 | use POE qw( Session::Magic ); |
|---|
| 7 | use MSTest; |
|---|
| 8 | |
|---|
| 9 | my %Scope; |
|---|
| 10 | |
|---|
| 11 | sub _stop : Object { |
|---|
| 12 | print $Scope{Test}; |
|---|
| 13 | print "Exiting..."; |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | sub ptest : Inline { |
|---|
| 17 | print Heap->{Test}; |
|---|
| 18 | print shift; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | require MSDynload; |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | sub foo : Inline { |
|---|
| 27 | print shift; |
|---|
| 28 | Heap->{Test} = "Testing Heap Passing"; |
|---|
| 29 | ptest "Testing Package States"; |
|---|
| 30 | |
|---|
| 31 | my $STest; |
|---|
| 32 | my $fokey; |
|---|
| 33 | |
|---|
| 34 | unless (defined $Scope{Spawned}) { |
|---|
| 35 | print "Testing Session duplication"; |
|---|
| 36 | $fokey = main->spawn; |
|---|
| 37 | print "The reference of fokey is ", ref $fokey; |
|---|
| 38 | |
|---|
| 39 | ptest "Is this dereferencing right?"; |
|---|
| 40 | main->ptest("\$fokey->ptest(\"This is a test\");"); |
|---|
| 41 | |
|---|
| 42 | $fokey->ptest("This is a test"); |
|---|
| 43 | $fokey->ptest("These object aliases aren't actually objects.."); |
|---|
| 44 | |
|---|
| 45 | unless ($fokey->can("ptest")) { |
|---|
| 46 | print "\$fokey = $fokey"; |
|---|
| 47 | print " .. But \$fokey cant ->ptest"; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | MSTest->spawn("JOKE"); |
|---|
| 51 | |
|---|
| 52 | $STest = JOKE->spawn; |
|---|
| 53 | $STest->test("This is a test of a object alias"); |
|---|
| 54 | JOKE->test("This tests a spawned package alias as a package method"); |
|---|
| 55 | JOKE->destroy; |
|---|
| 56 | |
|---|
| 57 | $Scope{Spawned} = 1; |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | sub _start : Inline { |
|---|
| 63 | print "Starting Up"; |
|---|
| 64 | foo "Running"; |
|---|
| 65 | |
|---|
| 66 | $Scope{Test} = "Scope test"; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | sub new { |
|---|
| 71 | print "New called"; |
|---|
| 72 | bless {}; |
|---|
| 73 | } |
|---|