in reply to split and assign
$schema_username = ( split '=', $line )[1];
Note also that the first argument to split is a regex, not a string literal, even if you mean it to be. In particular, split '.', EXPR probably won't behave as you expect.
(In fact, split '\.', EXPR and split /\./, EXPR behave differently—I don't know why.
Oh, now I see. What I actually tested was split "\.", EXPR, and Perl regards "\." as a (pointless) escaping of ., so that it's read the same as "."—which, when interpreted as a regex, matches any single character. In split '\.', EXPR, no escaping is done, so everything's fine.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split and assign
by AnomalousMonk (Archbishop) on Aug 03, 2009 at 05:03 UTC | |
by JadeNB (Chaplain) on Aug 03, 2009 at 07:22 UTC | |
|
Re^2: split and assign
by chromatic (Archbishop) on Aug 03, 2009 at 09:03 UTC |