{"id":20559821,"url":"https://github.com/cxw42/perl-vars-i","last_synced_at":"2026-06-06T00:31:30.918Z","repository":{"id":56831098,"uuid":"177600098","full_name":"cxw42/Perl-vars-i","owner":"cxw42","description":"vars::i - Perl pragma to declare and simultaneously initialize global variables.","archived":false,"fork":false,"pushed_at":"2019-09-18T01:22:57.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T19:02:07.077Z","etag":null,"topics":["compile-time","declarations","initialization","perl","variables"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/vars::i","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cxw42.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-25T14:14:04.000Z","updated_at":"2019-09-18T01:22:56.000Z","dependencies_parsed_at":"2022-09-09T17:11:33.977Z","dependency_job_id":null,"html_url":"https://github.com/cxw42/Perl-vars-i","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FPerl-vars-i","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FPerl-vars-i/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FPerl-vars-i/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FPerl-vars-i/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cxw42","download_url":"https://codeload.github.com/cxw42/Perl-vars-i/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242166327,"owners_count":20082648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compile-time","declarations","initialization","perl","variables"],"created_at":"2024-11-16T03:52:19.167Z","updated_at":"2025-12-07T00:02:13.252Z","avatar_url":"https://github.com/cxw42.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MetaCPAN Release](https://badge.fury.io/pl/vars-i.svg)](https://metacpan.org/release/vars-i) [![Build Status](https://travis-ci.org/cxw42/Perl-vars-i.svg?branch=master)](https://travis-ci.org/cxw42/Perl-vars-i)\n# NAME\n\nvars::i - Perl pragma to declare and simultaneously initialize global variables.\n\n# SYNOPSIS\n\n    use Data::Dumper;\n    $Data::Dumper::Deparse = 1;\n\n    use vars::i '$VERSION' =\u003e 3.44;\n    use vars::i '@BORG' =\u003e 6 .. 6;\n    use vars::i '%BORD' =\u003e 1 .. 10;\n    use vars::i '\u0026VERSION' =\u003e sub(){rand 20};\n    use vars::i '*SOUTH' =\u003e *STDOUT;\n\n    BEGIN {\n        print SOUTH Dumper [\n            $VERSION, \\@BORG, \\%BORD, \\\u0026VERSION\n        ];\n    }\n\n    use vars::i [ # has the same effect as the 5 use statements above\n        '$VERSION' =\u003e 3.66,\n        '@BORG' =\u003e [6 .. 6],\n        '%BORD' =\u003e {1 .. 10},\n        '\u0026VERSION' =\u003e sub(){rand 20},\n        '*SOUTH' =\u003e *STDOUT,\n    ];\n\n    print SOUTH Dumper [ $VERSION, \\@BORG, \\%BORD, \\\u0026VERSION ];\n\n# DESCRIPTION\n\nFor whatever reason, I once had to write something like\n\n    BEGIN {\n        use vars '$VERSION';\n        $VERSION = 3;\n    }\n\nor\n\n    our $VERSION;\n    BEGIN { $VERSION = 3; }\n\nand I really didn't like typing that much.  With this package, I can say:\n\n    use vars::i '$VERSION' =\u003e 3;\n\nand get the same effect.\n\nAlso, I like being able to say\n\n    use vars::i '$VERSION' =\u003e sprintf(\"%d.%02d\", q$Revision: 1.3 $ =~ /: (\\d+)\\.(\\d+)/);\n\n    use vars::i [\n     '$VERSION' =\u003e sprintf(\"%d.%02d\", q$Revision: 1.3 $ =~ /: (\\d+)\\.(\\d+)/),\n     '$REVISION'=\u003e '$Id: GENERIC.pm,v 1.3 2002/06/02 11:12:38 _ Exp $',\n    ];\n\nLike with `use vars;`, there is no need to fully qualify the variable name.\nHowever, you may if you wish.\n\n# NOTES\n\n- Specifying a variable but not a value will succeed silently, and will **not**\ncreate the variable.  E.g., `use vars::i '$foo';` is a no-op.\n\n    Now, you might expect that `use vars::i '$foo';` would behave the same\n    way as `use vars '$foo';`.  That would not be an unreasonable expectation.\n    However, `use vars::i qw($foo $bar);` has a very different\n    effect than does `use vars qw($foo $bar);`!  In order to avoid\n    subtle errors in the two-parameter case, `vars::i` also rejects the\n    one-parameter case.\n\n- Trying to create a special variable is fatal.  E.g., `use vars::i '$@', 1;`\nwill die at compile time.\n- The sigil is taken into account (context sensitivity!)  So:\n\n        use vars::i '$foo' =\u003e [1,2,3];  # now $foo is an arrayref\n        use vars::i '@bar' =\u003e [1,2,3];  # now @bar is a three-element list\n\n# SEE ALSO\n\nSee [vars](https://metacpan.org/pod/vars), [\"our\" in perldoc](https://metacpan.org/pod/perldoc#our), [\"Pragmatic Modules\" in perlmodlib](https://metacpan.org/pod/perlmodlib#Pragmatic-Modules).\n\n# VERSIONING\n\nSince version 1.900000, this module is numbered using\n[Semantic Versioning 2.0.0](https://semver.org),\npacked in the compatibility format of `vX.Y.Z -\u003e X.00Y00Z`.\n\nThis version supports Perl 5.6.1+.  If you are running an earlier Perl:\n\n- Perl 5.6:\n\n    Use version 1.10 of this module\n    ([CXW/vars-i-1.10](https://metacpan.org/pod/release/CXW/vars-i-1.10/lib/vars/i.pm)).\n\n- Pre-5.6:\n\n    Use version 1.01 of this module\n    ([PODMASTER/vars-i-1.01](https://metacpan.org/pod/release/PODMASTER/vars-i-1.01/lib/vars/i.pm)).\n\n# DEVELOPMENT\n\nThis module uses [Minilla](https://metacpan.org/pod/Minilla) for release management.  When developing, you\ncan use normal `prove -l` for testing based on the files in `lib/`.  Before\nsubmitting a pull request, please:\n\n- make sure all tests pass under `minil test`\n- add brief descriptions to the `Changes` file, under the `{{$NEXT}}` line.\n- update the `.mailmap` file to list your PAUSE user ID if you have one, and\nif your git commits are not under your `@cpan.org` email.  That way you will\nbe properly listed as a contributor in MetaCPAN.\n\n# AUTHORS\n\nD.H. \u003cpodmaster@cpan.org\u003e\n\nChristopher White \u003ccxw@cpan.org\u003e\n\n## Thanks\n\nThanks to everyone who has worked on [vars](https://metacpan.org/pod/vars), which served as the basis for\nthis module.\n\n# SUPPORT\n\nPlease report any bugs at [https://github.com/cxw42/Perl-vars-i/issues](https://github.com/cxw42/Perl-vars-i/issues).\n\nYou can also see the old bugtracker at\n[http://rt.cpan.org/NoAuth/Bugs.html?Dist=vars-i](http://rt.cpan.org/NoAuth/Bugs.html?Dist=vars-i) for older bugs.\n\n# LICENSE\n\nCopyright (c) 2003--2019 by D.H. aka PodMaster, and contributors.\nAll rights reserved.\n\nThis module is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxw42%2Fperl-vars-i","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcxw42%2Fperl-vars-i","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxw42%2Fperl-vars-i/lists"}