in reply to Split into array in a somewhat unconventional manner
will do what you want. Here, let's test that supposition:split(/"|'/,<your funny string goes here)
prints#! /usr/local/bin/perl use strict; use warnings; my $str =qq(jfjsa as,.n d"fdsafjl"jop'fdsjklf fds'457"fjdsklaoir"jkl45 +;fs ier987543" fsdjkal"); my @arr = split(/'|"/,$str); print("Number of bits: ", scalar(@arr),"\n"); print("Resultant array: " , join(' ', @arr), "\n"); exit(0)
Resultant array: jfjsa as,.n d fdsafjl jop fdsjklf fds 457 fjdskl +aoir jkl45;fs ier987543 fsdjkal
----
I Go Back to Sleep, Now.
OGB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split into array in a somewhat unconventional manner
by johngg (Canon) on Aug 18, 2009 at 21:37 UTC | |
by ikegami (Patriarch) on Aug 18, 2009 at 22:10 UTC |