[poe-commits] poe/lib/POE Kernel.pm,1.323,1.324
Brought to you by:
rcaputo
From: <rc...@us...> - 2005-09-08 16:26:53
|
Update of /cvsroot/poe/poe/lib/POE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1621/lib/POE Modified Files: Kernel.pm Log Message: Applied Philip Gwyn's patch to skip IO::Poll if it doesn't define a constant we need. Index: Kernel.pm =================================================================== RCS file: /cvsroot/poe/poe/lib/POE/Kernel.pm,v retrieving revision 1.323 retrieving revision 1.324 diff -C2 -d -r1.323 -r1.324 *** Kernel.pm 22 Aug 2005 17:34:24 -0000 1.323 --- Kernel.pm 8 Sep 2005 16:26:44 -0000 1.324 *************** *** 470,521 **** if (defined $used_first) { load_loop($used_first); } - else { - foreach my $file (keys %INC) { - next if (substr ($file, -3) ne '.pm'); - my @split_dirs = File::Spec->splitdir($file); ! # Create a module name by replacing the path separators with ! # dashes and removing ".pm" ! my $module = join("_", @split_dirs); ! substr($module, -3) = ""; ! # Skip the module name if it isn't legal. ! next if $module =~ /[^\w\.]/; ! # Try for the XS version first. If it fails, try the plain ! # version. If that fails, we're up a creek. ! $module = "POE/XS/Loop/$module.pm"; ! unless (find_loop($module)) { ! $module =~ s|XS/||; ! next unless (find_loop($module)); ! } ! if (defined $used_first and $used_first ne $module) { ! die( ! "*\n", ! "* POE can't use multiple event loops at once.\n", ! "* You used $used_first and $module.\n", ! "* Specify the loop you want as an argument to POE\n", ! "* use POE qw(Loop::Select);\n", ! "* or;\n", ! "* use POE::Kernel { loop => 'Select' };\n", ! "*\n", ! ); ! } ! $used_first = $module; } ! unless (defined $used_first) { ! $used_first = "POE/XS/Loop/Select.pm"; ! unless (find_loop($used_first)) { ! $used_first =~ s/XS\///; ! } } - substr($used_first, -3) = ""; - $used_first =~ s|/|::|g; - load_loop($used_first); } } --- 470,523 ---- if (defined $used_first) { load_loop($used_first); + return; } ! foreach my $file (keys %INC) { ! next if (substr ($file, -3) ne '.pm'); ! my @split_dirs = File::Spec->splitdir($file); ! # Create a module name by replacing the path separators with ! # underscores and removing ".pm" ! my $module = join("_", @split_dirs); ! substr($module, -3) = ""; ! # Skip the module name if it isn't legal. ! next if $module =~ /[^\w\.]/; ! # Try for the XS version first. If it fails, try the plain ! # version. If that fails, we're up a creek. ! $module = "POE/XS/Loop/$module.pm"; ! unless (find_loop($module)) { ! $module =~ s|XS/||; ! next unless (find_loop($module)); ! } ! if (defined $used_first and $used_first ne $module) { ! die( ! "*\n", ! "* POE can't use multiple event loops at once.\n", ! "* You used $used_first and $module.\n", ! "* Specify the loop you want as an argument to POE\n", ! "* use POE qw(Loop::Select);\n", ! "* or;\n", ! "* use POE::Kernel { loop => 'Select' };\n", ! "*\n", ! ); } ! $used_first = $module; ! } ! ! # No loop found. Default to our internal select() loop. ! unless (defined $used_first) { ! $used_first = "POE/XS/Loop/Select.pm"; ! unless (find_loop($used_first)) { ! $used_first =~ s/XS\///; } } + + substr($used_first, -3) = ""; + $used_first =~ s|/|::|g; + load_loop($used_first); } |