2006/01/03

[comp] perl - 處理字串中的字元

1. @array = split //, $string;

2. @array = unpack "C*", $string;

3.
while (/(.)/g) { # . is never a newline here
# do something with $1
}