|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I've made a script which read directory info and puts it in
an array. The example content of the array is: 8407 Bush - Letting The Cables Sleep - Guitar Tab.tab (inode number followed by filename) I want to create a new array containing two fields; an inode number field and a filename field. I did this by splitting the array on using " " (a space char) as a delimiter. Printing the inode number is easy but how do i print the filename in one piece (because it's now split in 9)? I tried things like print $arrayname[1-] and $arrayname[1*] but they return errors. Any ideas? Thanks in advance, d0g1e |
|
#2
|
|||
|
|||
|
$first_element=unshift(@array);
foreach $element (@array){$rest_array=$rest_array." ".$element} $hash{$first_element}=$rest_array; Havn't tired that (and am not sure what you really want). But that might work for what you want. %hash would have name=value of inode=the rest. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > printing the remaining data fields of an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|