de2425 has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks!
I was wondering if anyone could give me some quick help with a split problem I'm having. I actually don't even know if what I'm wanting to do will work but I hope someone can help.
What I'm wanting to do is to split by a variable that is a string that changes with each new read through of a file. I've tried:
@line=split(/$variable/,$_);
but this doesn't seem to be giving me what I'm needing. Is there another way to specify a split based on a variable that is not constant?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split Help
by ikegami (Patriarch) on Mar 16, 2009 at 20:47 UTC | |
|
Re: Split Help
by Sandy (Curate) on Mar 16, 2009 at 20:32 UTC | |
by de2425 (Sexton) on Mar 16, 2009 at 20:50 UTC | |
by shmem (Chancellor) on Mar 16, 2009 at 22:03 UTC | |
by jwkrahn (Abbot) on Mar 16, 2009 at 21:38 UTC | |
|
Re: Split Help
by bellaire (Hermit) on Mar 16, 2009 at 20:33 UTC | |
|
Re: Split Help
by Marshall (Canon) on Mar 17, 2009 at 01:03 UTC |