K
kwoody
I know what I want to accomplish here but can not figure it out. Open a
file from disk, it has two lines:
messages in queue: 268
messages in queue but not yet preprocessed: 0
Those two lines stored in @xxx, hence a:
print $xxx[0] prints out: messages in queue: 268
print $xxx[1] prints out: messages in queue but not yet preprocessed: 0
Before when it only had one line I'd just use a split(). Now Ive got
two lines so a:
($a,$b,$c,$num) = split(/\s+/);
wont work with the second line, only the first.
I'd like to get the number at the end of each line and put it into a
scalar so I can do something with it.
Ive tried various iterations of split/splice and a few others but just
cant figure this one.
Anyone have a suggestion?
Thanks,
Keith
file from disk, it has two lines:
messages in queue: 268
messages in queue but not yet preprocessed: 0
Those two lines stored in @xxx, hence a:
print $xxx[0] prints out: messages in queue: 268
print $xxx[1] prints out: messages in queue but not yet preprocessed: 0
Before when it only had one line I'd just use a split(). Now Ive got
two lines so a:
($a,$b,$c,$num) = split(/\s+/);
wont work with the second line, only the first.
I'd like to get the number at the end of each line and put it into a
scalar so I can do something with it.
Ive tried various iterations of split/splice and a few others but just
cant figure this one.
Anyone have a suggestion?
Thanks,
Keith