Whoops... that was supposed to go to the list...
--Art
: Here's the problem, I made a mistake in my previous e-mail, I
: know how to
: split an array by a certian character...for example
:
: $foo = "3.2.1";
: @FOO_NEW;
: ($FOO_NEW[0],$FOO_NEW[1]) = split (/\./, $foo); #Voila I have
: my first and
: second position
Of course, you could just do
@FOO_NEW = split ( etc...)
You don't have to assign it to the first two array elements
explicitly.
: The mistake I made is $foo doesn't contain "." separated
: values it's more
: like this:
:
: $foo = "321";
: or it could be
: $foo = "3214";
:
: So I want the first 2 values which will change depending on
: what $foo is set
: as. I wondered if I could split in between characters? Suggestions?
You can split on any regular expression. Other than that, I'm
not sure exactly what you're asking. If you just want to put
the individual digits of $foo into an array, you could do
something like
@FOO_NEW = /(\d)/g;
There's probably a dozen different ways to do it but I'm not
sure exactly what you're trying to do.
--Art
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl