Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Parentheses' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Parentheses
Authored by: escowles on Sep 23, '04 12:33:49PM

If you use parens in your location names like I do (e.g., "Work (Airport)" or "Work (Ethernet)"), you'll want to do something like this:


#!/usr/bin/perl -w
use strict;

foreach (`scselect 2>&1`) {
    next unless /^\s*\*/;
    s/.*?\(//;
    s/\)$//;
    print;
    exit;
}

print "dunno\n";

This handles the nested parens properly.

-Esme



[ Reply to This | # ]