SPVM(1)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’– SPVM(1) πŸ’– β€” spvm

okay so this page is from the User Contributed Perl Documentation manual, and it's all about the spvm command. bestie, we're executing SPVM programs and keeping every flag intact. 🫢✨

🌸 NAME 🌸

spvm β€” executing SPVM programs

✨ DESCRIPTION ✨

The spvm command executes SPVM programs. literally its whole job. πŸ’…

πŸŽ€ USAGE πŸŽ€

Usage: spvm [OPTIONS] SCRIPT_NAME

  spvm myapp.spvm

Options:
  -h, --help                     Shows this message
  -v, --version                  Shows the version
  -I DIRECTORY    Adds a include directory
  -B, --build-dir DIRECTORY      Build diretory
  -e SOURCE                      Executes a program source code in main method.
  -c                             Check syntx only
  -w                             Enables warning flag
  -M CLASS_NAME                  Loads the SPVM class
  -Mblib                         Same as "-Mblib" in perl

πŸ” DETAILS πŸ”

spvm [OPTIONS] SCRIPT_NAME

The spvm command executes a SPVM program.

OPTIONS are options. yes bestie, that's the bit. 🫠

SCRIPT_NAME is a script path that contains an SPVM script.

# myapp.spvm
use Fn;
my $var = 1;
say $var;

Anon class that contains a bootstrap method is allowed as an SPVM script. main character energy fr fr. πŸ‘‘

# myapp.spvm
class {

  version "1.001";

  our $FOO : int;

  use Fn;

  static method main : void () {
    my $var = 1;
    say $var;
  }
}

The base name of SCRIPT_NAME must be a "Script Base Name". Otherwise an exception is thrown. 😭 no sneaky names.

bestie, if the base name isn't a Script Base Name, an exception is thrown. no cap. πŸ’€

See Class Search Directories about default class search directories.

See SPVM::Document::EnvironmentVariables about available environment variables. 🌈

πŸ¦‹ Script Base Name πŸ¦‹

A script base name ends with .spvm.

A script base name without .spvm consists of word characters and -.

It does not contain __.

It does not begin with 0-9.

It does not begin with -.

It does not end with -.

It does not contain --.

Examples:

# Script Base Names
foo.spvm
foo_bar2.spvm
myapp-foo.spvm

# Invalid Script Base Names
2foo.spvm
foo__bar.spvm
-myapp.spvm
myapp-.spvm
myapp--foo.spvm

πŸ’… OPTIONS πŸ’…

πŸ”₯ --help πŸ”₯

Outputs how to use the spvm command to standard output.

πŸ”₯ -h πŸ”₯

-h

Same as --help.

πŸ”₯ --version πŸ”₯

Outputs the version of the spvm command to standard output. This version is the same as the version of SPVM. ⭐

πŸ”₯ -v πŸ”₯

-v

Same as --version.

πŸ”₯ -I πŸ”₯

-I DIRECTORY

Prepends DIRECTORY to class search directories.

This option can be specified multiple times.

-I dir1 -I dir2

In this case, class search directories becomes the following.

[dir1, dir2, default_dirs]

πŸ”₯ --build-dir πŸ”₯

--build-dir DIRECTORY

Sets SPVM_BUILD_DIR environment variable to DIRECTORY.

πŸ”₯ -B πŸ”₯

-B DIRECTORY

Same as --build-dir.

πŸ”₯ -w πŸ”₯

-w

Enables warning flag.

Implementation:

Sets CommandInfo#WARNING class variable to 1.

πŸ”₯ -Mblib πŸ”₯

-Mblib

Uses Perl's blib module.

This is useful for testing a native module before it is installed.

When this option is specified, blib/lib and blib/arch are prepended to @INC and the library search paths.

πŸ”₯ -e πŸ”₯

-e SOURCE

Executes a source code SOURCE in "main" method.

Examples:

spvm -e 'say "Hello World!";';

πŸ”₯ -c πŸ”₯

-c

Checks syntax only.

πŸ”₯ -M πŸ”₯

-M CLASS_NAME

Loads the SPVM class CLASS_NAME.

This is useful for pre-loading classes or ensuring that a class is compiled.

This option can be specified multiple times.

spvm -MFoo -MBar myapp.spvm

Implementation:

Calls build_class method for CLASS_NAME.


🌈 lib Directive 🌈

If the source code specified by SCRIPT_NAME, or -e option contains lib directives, the directories specified by lib directive is prepended to class search directories. iykyk. 🧚

#lib "$FindBin::Bin/lib"

The directories specified by lib directive are placed after the directories specified by the -I option.

Copyright 2023 Yuki Kimoto. All Rights Reserved.

MIT License.


okay bye bestie β€” source/version: perl v5.42.2 β€” date: 2026-02-03. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from