On Mon, Mar 10, 2008 at 1:49 AM, Rodrick Brown <[EMAIL PROTECTED]> wrote:
snip
> For example if you we're only interested in fields 1,3, and 5 you
> could do something like
> ($field1,undef,$field3,undef,$field5) = split/.../;
>
> Or you can do something like (split//...)[3]
snip
You can also
On Mon, Mar 10, 2008 at 1:37 PM, igotux igotux <[EMAIL PROTECTED]> wrote:
>I tried
> split(/\s+/,$var)[1] which is not working as i expected.
You may be moving from python,:)
In perl you should say,
(split /\s+/,$var)[1];
because split /\s+/$var returns a list, use () to enclose the list's sco
On Mon, Mar 10, 2008 at 1:37 AM, igotux igotux <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to extract values from split without defining an array. Say i want to
> access second element in the split output :- split (/\s+/,$var) . I tried
> split(/\s+/,$var)[1] which is not working as i expected. C
Hi,
I want to extract values from split without defining an array. Say i want to
access second element in the split output :- split (/\s+/,$var) . I tried
split(/\s+/,$var)[1] which is not working as i expected. Can someone please
correct me on this ?
Thanks,
IGotux