in reply to Ghostly subroutine variables haunting me in subsequent calls

sub complete_inchi_parse { my $inchi = shift; my @inchibits = split(@/@,$inchi);
Whatever problem you're really experiencing, it seems hard to believe that "this routine works the first time". Indeed it would be sensible to at least post code that compiles. What do you mean that @/@ to really be?!?

More on topic wrt your actual question, I see that you both push into a @pileofinchis variable that's not lexically scoped to your sub and return a reference to it. There's something strange in this modus operandi. I would probably gather a "local" @pile and return it, pushing the return value of this sub into a suitably "global" @pileofinchis.

HTH

Replies are listed 'Best First'.
Re^2: Ghostly subroutine variables haunting me in subsequent calls
by moonunit (Initiate) on Oct 26, 2005 at 11:57 UTC
    Whoops, had a brain failure there. I was trying to make a /\// clearer for your ease of reading in the manner of a normal regex which is of course inappropriate in a split call. Corrected.
      You still can use alternate delimiters "in the manner of a normal regex". But you have to be explicit about the operator:
      $ perl -le 'print for split m@/@, "foo/bar/baz"' foo bar baz