You could do it a couple of ways the way I would go about it is My(@arr1,@arr2,@arr3); mol2_read($opts{m},[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]);
sub mol2_read { My($opt_m,$arr1,$arr2,$arr3)[EMAIL PROTECTED]; # # code to do what you want with the above # return; } -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 12:54 To: beginners@perl.org Subject: Problems with arrays Hi everybody, I got a problem with handling sub-routines and arrays. Here is an example of the code: #!/usr/bin/perl -w (@old_header,@old_atoms,@old_bonds) = mol2_read($opts{m}); sub mol2_read { return ([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); } Ok, now the problem: If I want to print the elements of the arrays @old_header, @old_atoms and @old_bonds i see, that all arrays, that come from the sub mol2_read are stored in only one array; in @old_header. I want to know, how it would be possible to store every @mol-array in the right @old-array? Thanks for your help Best regards German -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ This e-mail is from the PA Group. For more information, see www.thepagroup.com. This e-mail may contain confidential information. Only the addressee is permitted to read, copy, distribute or otherwise use this email or any attachments. If you have received it in error, please contact the sender immediately. Any opinion expressed in this e-mail is personal to the sender and may not reflect the opinion of the PA Group. Any e-mail reply to this address may be subject to interception or monitoring for operational reasons or for lawful business practices. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/