in reply to Trying to split on '?'
The problem I suspect you're encountering is that the variables $1, $2, $3, etc. have special meanings in Perl -- they refer to portions captured within the parentheses of a pattern match. Try this instead:
($one, $two, $three) = split quotemeta($delimiter);
where $delimiter is ASCII 215 or whatever you're intending to use. The quotemeta will escape any characters that might have special meanings when used in a regular expression. (To be more precise, it escapes any non-"word" character.)
Also note that split used in this fashion is implicitly operating on the contents of the $_ variable. If you're not familiar with the use of $_, you can sometimes make your life easier by explicitly indicating what variable you want to split:
($one, $two, $three) = split quotemeta($delimiter), $stuff_to_split;
Good luck!
|
|---|