Skip to content

Commit

Permalink
Fix examples in the POD
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jan 17, 2024
1 parent 40c7b89 commit 6ca8c82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/CGI/Info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ constructor.
# ...
my $info = CGI::Info->new();
my $allowed = {
'foo' => qr(^\d*$), # foo must be a number, or empty
'bar' => undef,
'xyzzy' => qr(^[\w\s-]+$), # must be alphanumeric
foo => qr/^\d*$/, # foo must be a number, or empty
bar => undef,
xyzzy => qr/^[\w\s-]+$/, # must be alphanumeric
# to prevent XSS, and non-empty
# as a sanity check
};
Expand Down Expand Up @@ -822,7 +822,7 @@ be thrown:
use CGI::Info;
my $allowed = {
'foo' => qr(\d+),
foo => qr/\d+/
};
my $xyzzy = $info->params(allow => $allowed);
my $bar = $info->param('bar'); # Gives an error message
Expand Down

0 comments on commit 6ca8c82

Please sign in to comment.