An object is certainly the answer to your question about how to create your own variable type, however you could also meet your needs by using the existing types if your program is a one off that only you will edit/maintain/read and you'd like to get to a solution prior to digging into perltoot for the first time (although you really should read this).
You could use an arrayref for your variable and push the Boolean value onto the first spot in the array, then push the int onto the second. You then access these later knowing that the Boolean is always first and the int second. Incidentally this could be a model for your future object.
my $foo = [ ]; push @{$foo}, 1; push @{$foo}, 23; my $boolean = ${$foo}[0]; my $int = ${$foo}[1];
In reply to Re^2: Creating a unique variable type (an object)
by osler
in thread Creating a unique variable type
by tfredett
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |