I've read http://www.perl101.org/subroutines.html but I just don't understand optional parameters.
I want to call the following sub in PDF::API2. The doc says "-indent" is an option. How exactly do I pass a parameter for indent of 20?
This is what I'm passing at the moment:
$txt->section($str, $contentwidth,$heightmax);
This is the sub
sub section { my ($self,$text,$width,$height,%opts)=@_; my $overflow = ''; foreach my $para (split(/\n/,$text)) { if(length($overflow) > 0) { $overflow .= "\n" . $para; next; } ($para,$height) = $self->paragraph($para,$width,$height,%opts); $overflow .= $para if (length($para) > 0); } if (wantarray) { return ($overflow,$height); } return $overflow; }