gpt4 book ai didi

知道接收器类型的 Perl 函数

转载 作者:行者123 更新时间:2023-12-04 22:49:23 44 4
gpt4 key购买 nike

我有一个文本文件,以及一个从该文本文件中检索的函数:

@thefile = read_file( 'somepathfile' );

我希望根据接收信息的类型对 read_file 函数进行不同的实现。

所以如果我写:

%thefile = read_file( 'somepathfile' );

然后将执行不同的函数。

我该怎么做?

最佳答案

同时 draegtun's answer说明了一种很好的技术,我将推荐清晰度。例如:

@thefile = read_file_lines( 'somepathfile' );

%thefile = read_file_pairs( 'somepathfile' );

关于知道接收器类型的 Perl 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3308149/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com