X11::XCB::Rect - represents a rectangle
my $rect = X11::XCB::Rect->new(x => 0, y => 0, width => 300, height => 400);
But in most cases, you should be able to coerce a rect from an arrayref:
my $window = $x->root->create_child( rect => [0, 0, 300, 300], class => WINDOW_CLASS_INPUT_OUTPUT, );
To install X11::XCB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm X11::XCB
CPAN shell
perl -MCPAN -e shell install X11::XCB
For more information on module installation, please visit the detailed CPAN module installation guide.