in reply to Split a Line
You'll notice $x had trailing spaces removed. If you want to keep trailing spaces, use "a" instead of "A" in the unpack format string. Read perldoc perlpacktut for more.my ($x, $y, $z) = unpack "A10 A3 A*", "example 987testing 1, 2, 3"; # $x = "example" # $y = 987 # $z = "testing 1, 2, 3"
|
|---|