Thanks a lot Japhy, that's exactly the key I want =) Assign the value at first, replace it when match... That's very great !!!
Smiley Connie =) > > sub getQuery { > my %ret = ( > user => 'system', > book => 'index', > page => 0, > ); > > my $query = shift or return %ret; > > if ($query =~ m{^(\w+)(?:\.(\w+)(?:&p=(\d+))?)?$}) { > $ret{user} = $1; > $ret{book} = $2 if $2; > $ret{page} = $3 if $3; > } > > return %ret; > } > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]