Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/perlonjava/core/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public final class Configuration {
* Automatically populated by Gradle/Maven during build.
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String gitCommitId = "bebebd07e";
public static final String gitCommitId = "517239c4e";

/**
* Git commit date of the build (ISO format: YYYY-MM-DD).
Expand All @@ -48,7 +48,7 @@ public final class Configuration {
* Parsed by App::perlbrew and other tools via: perl -V | grep "Compiled at"
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String buildTimestamp = "Apr 29 2026 12:11:44";
public static final String buildTimestamp = "Apr 29 2026 13:50:07";

// Prevent instantiation
private Configuration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,14 @@ public RuntimeArray keys() {
public RuntimeArray values() {
// Reset the each iterator when values() is called
this.eachIteratorIndex = null;
return this;
// Return a new RuntimeArray that aliases the elements but carries
// scalarContextSize so values() in scalar context yields the count
// (matching real Perl). We do not set scalarContextSize on `this`
// because that would persist and corrupt later scalar(@arr) results.
RuntimeArray result = new RuntimeArray();
result.elements.addAll(this.elements);
result.scalarContextSize = this.elements.size();
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,8 @@ public RuntimeArray values() {
isKey = !isKey;
}
hashIterator = null; // keys resets the iterator
// Set scalarContextSize so that values() in scalar context returns the count
list.scalarContextSize = list.elements.size();
return list;
}

Expand All @@ -936,6 +938,8 @@ public RuntimeArray values() {
list.elements.add(value); // push an alias to the value (direct reference, not a copy)
}
hashIterator = null; // values resets the iterator
// Set scalarContextSize so that values() in scalar context returns the count
list.scalarContextSize = list.elements.size();
return list;
}

Expand Down