Skip to content

Instantly share code, notes, and snippets.

@Xliff
Created April 18, 2017 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xliff/4bdd5ba8533488df8d9fc00802640af8 to your computer and use it in GitHub Desktop.
Save Xliff/4bdd5ba8533488df8d9fc00802640af8 to your computer and use it in GitHub Desktop.

Why the hell am I getting this?

Use of Nil in numeric context

at:

$idx = $idx + 1

in the following loop:

for %bp<materials>.list -> $i {
		my $count := $i[1];
		my $minVol= $count / 10;
		my $idx = 0;

		while ($count > 0) {
			my $k = $i[0];
			unless %market{$k}<sell>[$idx]<vol_remain> > $minVol {
				$idx = $idx + 1;
				next;
			}

			my $o = {
				count =>
					%market{$k}<sell>[$idx]<vol_remain> > $count
					??
					$count !! %market{$k}<sell>[$idx]<vol_remain>,
				unit_price  => %market{$k}<sell>[$idx]<price>,
				station     => %market{$k}<sell>[$idx++]<station_name>
			};
			$o<subtotal> = $o<unit_price> * $o<count>;
			%cart{ %inv{$k} }.push: $o;
			$count -= $o<count>;
		}
	}

???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment