Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Perl 中
@array=qw/this is a line and a new one then a new one ...... ........./;
将导致将每个“单词”分配给@array 变量。我怎样才能将每个“行”分配给@array 变量,即 $a[0]="this is a line" 而不是 $a[0]="this"
这是一种方法:
my @array = split / *\n */, qq/this is a line and a new one and another/;