1 #!/usr/bin/perl 2 use warnings; 3 use strict; 4 use Data::Dumper; 5 6 use MyTest; 7 8 # Create some session variables, variables that can be used like any scalar, 9 # but the value will be saved in the session, that way we can save and reload 10 # the session for persistance. 11 tsvars( 12 my $a => 'a' => 'A', 13 my $b => 'b' => 'B', 14 # Lets tie another variable to the same session variable, kinda silly, but 15 # it may be needed to access the session variable in different scopes. 16 my $a2 => 'a' => undef, 17 # Same as above, but give it a new value, should warn us. 18 my $b2 => 'b' => 'B2', 19 ); 20 21 print Dumper( $a, $b, $a2 ); 22 23 #Try changing a session variable. 24 $a = "bob"; 25 26 print Dumper( $a, $b, $a2 );