From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > I need to put each string prior to a space into a seperate > variable. Here is my string: > > 05-Dec-01.10:00:50 activity011204.221111 CLUNGU "(31246)" > > Here is my command to dump the variables: > $Activity_Date,$Activity_ID,$Activity_Owner,$Activity_Name = > split (/\s+/,$Activity_Detail_Line); > > It is returning: > Results of the split is: Date: ID: Owner: Name:4
The "split" command returns an array of results. You are basically saying this: $string1, $string2, $string3, $string4 = @array; Which is more or less equivalent to this: $string4 = @array; This results in $string4 containing the number of elements in the array. What you want to do is this: ($string1, $string2, $string3, $string4) = @array; or, in your case: ($Activity_Date,$Activity_ID,$Activity_Owner,$Activity_Name) = split (/\s+/,$Activity_Detail_Line); Bowie _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
