my $lfh; open($lfh, '<', $load_fn) or die "Unable to open file $load_fn : $!"; $rstring = <$lfh>; # Char speeds ($c_speed[0], $c_speed[1], $c_speed[2], $c_speed[3]) = sscanf("%d %d + %d %d", $rstring);
The simple answer is:
open( my $lfh, '<', $load_fn ) or die "Unable to open file $load_fn : $!"; my @c_speed = split ' ', <$lfh>; # Char speeds
In reply to Re: Reading into array with sscanf
by jwkrahn
in thread Reading into array with sscanf
by colintu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |