Permalink
Browse files

mosh Perl wrapper: Downgrade Perl regex to avoid named capture

(Failed on Perl 5.8 with OS X 10.5)
  • Loading branch information...
1 parent 4668dc5 commit c6a8427d61de9db26a55eb844307f7c6e83abe5f @keithw keithw committed Mar 11, 2013
Showing with 8 additions and 7 deletions.
  1. +8 −7 scripts/mosh
View
15 scripts/mosh
@@ -127,16 +127,17 @@ if ( defined $predict ) {
}
if ( defined $port_request ) {
- if ( $port_request =~ m{^(?<low>\d+)(:(?<high>\d+))?$} ) {
+ if ( $port_request =~ m{^(\d+)(:(\d+))?$} ) {
+ my ( $low, $clause, $high ) = ( $1, $2, $3 );
# good port or port-range
- if ( $+{low} <= 0 or $+{low} >= 65535 ) {
- die "$0: Server-side (low) port ($+{low}) must be within valid range [0..65535].\n";
+ if ( $low <= 0 or $low > 65535 ) {
+ die "$0: Server-side (low) port ($low) must be within valid range [1..65535].\n";
}
- if ( defined $+{high} ) {
- if ( $+{high} <= 0 or $+{high} >= 65535 ) {
- die "$0: Server-side high port ($+{high}) must be within valid range [0..65535].\n";
+ if ( defined $high ) {
+ if ( $high <= 0 or $high > 65535 ) {
+ die "$0: Server-side high port ($high) must be within valid range [1..65535].\n";
}
- if ( $+{low} > $+{high} ) {
+ if ( $low > $high ) {
die "$0: Server-side port range ($port_request): low port greater than high port.\n";
}
}

0 comments on commit c6a8427

Please sign in to comment.