in reply to Snippet explanation please
The key uses here are the regex (perldoc perlre) and the ternary operation (perldoc perlop).my $tempport; # declare var if( $args{DOUBLE_BYTE} =~ /y/i ) # try to match with a regex # regex is just looking for 'y' # the /i means case-insensitive { $tempport = DB_CATPORT; # Set to DB_CATPORT } else { $tempport = SB_CATPORT; # Set to SB_CATPORT }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Snippet explanation please
by Errto (Vicar) on Jul 04, 2005 at 21:37 UTC |