Skip to content

Commit

Permalink
[doc] Select.pm: Scope Examples
Browse files Browse the repository at this point in the history
By adding `my` where appropriate
  • Loading branch information
rwp0 authored and mauke committed Nov 24, 2023
1 parent 7496960 commit 2e59d4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dist/IO/lib/IO/Select.pm
Expand Up @@ -382,14 +382,14 @@ listening for more connections on a listen socket
use IO::Select;
use IO::Socket;
$lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080);
$sel = IO::Select->new( $lsn );
my $lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080);
my $sel = IO::Select->new( $lsn );
while(@ready = $sel->can_read) {
foreach $fh (@ready) {
while(my @ready = $sel->can_read) {
foreach my $fh (@ready) {
if($fh == $lsn) {
# Create a new socket
$new = $lsn->accept;
my $new = $lsn->accept;
$sel->add($new);
}
else {
Expand Down

0 comments on commit 2e59d4b

Please sign in to comment.