in reply to Parsing problem

split() delimiters can be any number of characters, so you could do
($desc, $username) = split("^`", $description);

A few notes unrelated to your question:

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: Parsing problem
by NetWallah (Canon) on Dec 11, 2004 at 01:14 UTC
    I believe that should be:
    ($desc, $username) = split("\^`", $description);
    since the first parameter to split is a RE, and the un-escaped ^ would indicate "start".

        ..."I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know, and that's a good thing. I think it's a very constructive exchange," --Donald Rumsfeld

      Actually, it should be:

      ($desc, $username) = split(/\^`/, $description);

      since the first parameter to split is a RE and not an interpolated string. ;-)

        Well - the documentation is not explicit on what acceptable delimeters are for this case. I know the quotes work because I tested them before posting. It would be my preference to use / as the pattern delimiter, but I was trying to get close to the OP's style. Anyway, here is why I think the quotes work:

        From the SPLIT function doc
        The pattern /PATTERN/ may be replaced with an expression to specify patterns that vary at runtime...

        If someone has a better explanation, or finds a stronger reason than tradition or performance for using /, please reply.

            ..."I don't know what the facts are but somebody's certainly going to sit down with him and find out what he knows that they may not know, and make sure he knows what they know that he may not know, and that's a good thing. I think it's a very constructive exchange," --Donald Rumsfeld


        Hi All,


        Thanks to all those who responded. Pretty much all
        replies worked and I did not think that it would be
        this simple. Hoping to become a perl guru soon!!!