The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Devel::Hints - Access compile-time hints at runtime

VERSION

This document describes version 0.01 of Devel::Hints, released January 30, 2003.

SYNOPSIS

    use Devel::Hints ':all';

    LABEL:
    print cop_label();      # 'LABEL'

    print cop_seq();        # some integer

    $[ = 10;
    print cop_arybase();    # 10

    #line 100
    print cop_line();       # 100

    use warnings;
    print cop_warnings();   # same as compile-time ${^WARNING_BITS}

    use open IO => ':utf8';
    print cop_io();         # same as compile-time ${^OPEN}

DESCRIPTION

This module exports the cop struct as individual functions; callers can call them to find out the lexical-scoped hints that its block is compiled under.

No functions are exported by default.

CAVEATS

The two other members (cop_stashpv and cop_file under ithreads, cop_stash and cop_filegv otherwise) are not exported.

ACKNOWLEDGMENTS

Thanks to Rafael Garcia-Suarez for demonstrating how to do this with the elegant Inline.pm-based code on p5p, which I adapted to this less elegant XS implementation.

AUTHORS

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

Copyright 2003 by Autrijus Tang <autrijus@autrijus.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html