fglock / PerlOnJava

An implementation of the Perl programming language designed to run on the Java platform
Other
20 stars 1 forks source link

When running under windows it fails in the RuntimeScalar.java #3

Closed gitterbitjc closed 1 day ago

gitterbitjc commented 1 week ago

Line: 1705 The below change fixes the issue in my local repo fullName = Paths.get(resource.getPath().substring(resource.getPath().indexOf(":") + 2)); //Paths.get(resource.getPath());

Edited:

Looks like the code had changed a bit..

            String path = resource.getPath();
            // Remove leading slash if on Windows
            if (System.getProperty("os.name").toLowerCase().contains("win") && path.startsWith("/")) {
                path = path.substring(1);
            }
            fullName = Paths.get(path);

not sure if this new change fixes the previous issue at old-code:1705

also I added this: if (fullName == null && code == null) { GlobalContext.setGlobalVariable("main::!", "No such file or directory"); return new RuntimeScalar(); }

not sure if && code == null was necessary (forgot)

does this work on windows now..

gitterbitjc commented 1 week ago

BTW this is Great! what you are doing.. I wish I could help - not a comp.sc guy -- just love perl.. :)

Any starter book? that can give an idea and concepts may help.. or links

fglock commented 1 week ago

Thank you for the detailed input!

Could you confirm if the latest main branch resolves the Windows compatibility issue in your setup? Any additional insights would be very helpful!

And thank you for the kind words—it’s fantastic to see your enthusiasm for Perl and this project! Your Windows-related findings and fixes are much appreciated. If you're interested in exploring or testing further, every contribution counts toward improving cross-platform handling.

For learning resources, Modern Perl by chromatic is a solid start, while Programming Perl by Wall, Christiansen, and Orwant dives deeper into Perl internals. For compiler design, Engineering a Compiler by Cooper & Torczon, or Appel’s Modern Compiler Implementation in Java, could be particularly relevant for PerlOnJava.

Please feel free to explore the codebase and ask questions along the way. Looking forward to collaborating!

fglock commented 1 day ago

Status: Resolved ✅

Verification Results:

Additional Details:

Please reopen if you notice any regression or have questions.