由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Perl求助
相关主题
[合集] 两个经典面题Why Avoid array indexing. Use pointers.
perl array|hash questionRandomization of an array
请看看这个Perl random sampling code 有什么问题,a simple question
a question of perlA question about sharing data inside a C++ class
javascript请教改numpy array的dtype
python Q: create array from 10 to 1新版的 eclipse 有什么大的改进?
Perl: How to return 2 dimention array pls ?Python:请问如何把list变成structured array。
Perl 6 改动很大很恶心[转载] CS Algorithm Interview question
相关话题的讨论汇总
话题: perl话题: array话题: 第一列话题: 第二列话题: hash
进入Programming版参与讨论
1 (共1页)
d****i
发帖数: 4809
1
Perl里面,有一个数组如下:
@array=(
10 A
11 B
12 C
...);
就是$array[i]的第一列是数字,第二列是字母,请问有什么办法可以把array的每个
element的第一列和第二列分别提取出来?就是在indexing $array[i]的时候,要提取
第一列有什么办法?谢谢。
c**t
发帖数: 2744
2
if the numbers are different, you may cast the array to a hash, then the
keys are the first column, values will be the 2nd

【在 d****i 的大作中提到】
: Perl里面,有一个数组如下:
: @array=(
: 10 A
: 11 B
: 12 C
: ...);
: 就是$array[i]的第一列是数字,第二列是字母,请问有什么办法可以把array的每个
: element的第一列和第二列分别提取出来?就是在indexing $array[i]的时候,要提取
: 第一列有什么办法?谢谢。

d****i
发帖数: 4809
3
Thanks. Could you tell me how to cast the array to a hash? I'm a cai niao in
Perl. Thanks.

【在 c**t 的大作中提到】
: if the numbers are different, you may cast the array to a hash, then the
: keys are the first column, values will be the 2nd

1 (共1页)
进入Programming版参与讨论
相关主题
[转载] CS Algorithm Interview questionjavascript
size不固定的struct怎么定义呀?python Q: create array from 10 to 1
how to use array to simulate multi loopsPerl: How to return 2 dimention array pls ?
何谓 heap array?Perl 6 改动很大很恶心
[合集] 两个经典面题Why Avoid array indexing. Use pointers.
perl array|hash questionRandomization of an array
请看看这个Perl random sampling code 有什么问题,a simple question
a question of perlA question about sharing data inside a C++ class
相关话题的讨论汇总
话题: perl话题: array话题: 第一列话题: 第二列话题: hash