Perl

1 program Added 2025-10-22T09:36:25Z Model: meta-llama/llama-3.1-70b-instructTemp: 0.4 Evidence Report issue View issues
Aliases: Perl 5
Provenance: commit f7515bc145 · authored 2025-10-22T11:36:25+02:00 · model meta-llama/llama-3.1-70b-instruct

Sources mentioning this language

9 sources · pl_id: pl/perl
LLM (this repo) · 1PldbLinguistPygmentsWikipediaEsolangHyperpolyglotRosettacodeWikidata · Q42478

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm
Typingdynamic
Designed byLarry Wall
First appeared1987
Influenced byAWK · BASIC · C · C++ · Lisp · sed · Unix shell
LicenseArtistic 1.0 or GNU General Public License version 1 or any later version
Implemented inC
Homepagehttps://www.perl.org/

Extensions claimed by this language

23 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.pllinguistprimary5.4M files
.plpygmentsprimary5.4M files
.allinguistsecondary472.0K files
.cgilinguistsecondary461.7K files
.fcgilinguistsecondary11.6K files
.perllinguistsecondary46.2K files
.perlpygmentssecondary46.2K files
.phlinguistsecondary57.7K files
.plxlinguistsecondary31.1K files
.pmlinguistsecondary10.0M files
.pmpygmentssecondary10.0M files
.psgilinguistsecondary16.8K files
.tlinguistsecondary2.7M files
.tpygmentssecondary2.7M files
.cgiwikipediaproposed461.7K files
.plwikidatadeprecated5.4M files
.plswikipediaproposed31.4K files
.plxwikipediaproposed31.1K files
.pmwikidatadeprecated10.0M files
.podwikipediaproposed495.4K files
.psgiwikipediaproposed16.8K files
.twikipediaproposed2.7M files
.xswikipediaproposed165.7K files

Related languages

Perl 6 (0.29)Perl6 (0.25)PDL (0.22)XS (0.21)Perlito (0.20)

LLM-contributed programs

Acme::MetaSyntactic

Provenance: commit f7515bc145 · authored 2025-10-22T11:36:25+02:00 · model meta-llama/llama-3.1-70b-instruct · Temp 0.4
code.pm · license: Artistic License 2.0 · added: 2025-10-22T09:36:25Z
package Acme::MetaSyntactic;

our $VERSION = 1.000;

1;

Real programs from Software Heritage

4 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
resultset_overload.t · 543 B · ext .t · seen 1858× in SWH
via heuristicrule h/linguist/.t/0
swh:1:cnt:c5ecce87432c6b1e8465269cb9b15902fe0dc302;origin=https://github.com/st3fan/osx-10.9;anchor=swh:1:rev:9f8135f87c2ba27b1e76a514464b823812effd45;path=/CPANInternal-140/DBIx-Class/t/resultset_overload.t
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
use strict;
use warnings;  

use Test::More;
use lib qw(t/lib);
use DBICTest;

my $schema = DBICTest->init_schema();

plan tests => 6;

{
  my $rs = $schema->resultset("CD")->search({});

  ok $rs->count;
  is $rs, $rs->count, "resultset as number with results";
  ok $rs,             "resultset as boolean always true";
}

{
  my $rs = $schema->resultset("CD")->search({ title => "Does not exist" });
  
  ok !$rs->count;
  is $rs, $rs->count, "resultset as number without results";
  ok $rs,             "resultset as boolean always true";
}
IssuingRules.pm · 7958 B · ext .pm · seen 1695× in SWH
via heuristicrule h/linguist/.pm/0
swh:1:cnt:6023671522ebe2915fc8348a5353e5d2dab14084;origin=https://github.com/laurenthdl/koha-biblibre;anchor=swh:1:rev:489bd948a04a9efeba23e903ca069d2cc2ec439d;path=/C4/IssuingRules.pm
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
package C4::IssuingRules;

# Copyright 2009 BibLibre SARL
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

use strict;
use warnings;
use C4::Context;
use C4::Koha;
use C4::SQLHelper qw( SearchInTable InsertInTable UpdateInTable DeleteInTable );
use Memoize;

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

BEGIN {

    # set the version for version checking
    $VERSION = 3.0.5;
    @ISA     = qw(Exporter);
    @EXPORT  = qw(
      &GetIssuingRule
      &GetIssuingRulesByBranchCode
      &GetIssuingRules
      &AddIssuingRule
      &ModIssuingRule
      &DelIssuingRule
    );
}

=head1 NAME

C4::IssuingRules - Koha issuing rules module

=head1 SYNOPSIS

use C4::IssuingRules;

=head1 DESCRIPTION

The functions in this module deal with issuing rules.

=head1 FUNCTIONS

=head2 GetIssuingRule

Compute the issuing rule for an itemtype, a borrower category and a branch.
Returns a hashref from the issuingrules table.

my $rule = &GetIssuingRule($categorycode, $itemtype, $branchcode);

The rules are applied from most specific to less specific, using the first found in this order:
    * same library, same patron type, same item type
    * same library, same patron type, default item type
    * same library, default patron type, same item type
    * same library, default patron type, default item type
    * default library, same patron type, same item type
    * default library, same patron type, default item type
    * default library, default patron type, same item type
    * default library, default patron type, default item type

The values in the returned hashref are inherited from a more generic rules if undef.

=cut

#Caching GetIssuingRule
memoize('GetIssuingRule');

sub GetIssuingRule {
    my ( $categorycode, $itemtype, $branchcode ) = @_;
    $categorycode ||= "*";
    $itemtype     ||= "*";
    $branchcode   ||= "*";

    # This configuration table defines the order of inheritance. We'll loop over it.
    my @attempts = (
        [ "*",           "*",       "*" ],
        [ "*",           $itemtype, "*" ],
        [ $categorycode, "*",       "*" ],
        [ $categorycode, $itemtype, "*" ],
        [ "*",           "*",       $branchcode ],
        [ "*",           $itemtype, $branchcode ],
        [ $categorycode, "*",       $branchcode ],
        [ $categorycode, $itemtype, $branchcode ],
    );

    # This complex query returns a nested hashref, so we can access a rule using :
    # my $rule = $$rules{$categorycode}{$itemtype}{$branchcode};
    # this will be usefull in the inheritance computation code
    my $dbh   = C4::Context->dbh;
    my $rules = $dbh->selectall_hashref(
        "SELECT * FROM issuingrules where branchcode IN ('*',?) and itemtype IN ('*', ?) and categorycode IN ('*',?)",
        [ "branchcode", "itemtype", "categorycode" ],
        undef, ( $branchcode, $itemtype, $categorycode )
    );

    # This block is for inheritance. It loops over rules returned by the
    # previous query. If a value is found in a more specific rule, it replaces
    # the old value from the more generic rule.
    my $oldrule;
    for my $attempt (@attempts) {
        if ( my $rule = $$rules{ @$attempt[2] }{ @$attempt[1] }{ @$attempt[0] } ) {
            if ($oldrule) {
                for ( keys %$oldrule ) {
                    if ( defined $rule->{$_} ) {
                        $oldrule->{$_} = $rule->{$_};
                    }
                }
            } else {
                $oldrule = $rule;
            }
        }
    }
    if ($oldrule) {
        return $oldrule;
    } else {
        return {
            'itemtype'         => $itemtype,
            'categorycode'     => $categorycode,
            'branchcode'       => $branchcode,
            'holdspickupdelay' => 0,

            #     'maxissueqty'       => 0,
            'renewalsallowed'   => 0,
            'firstremind'       => 0,
            'accountsent'       => 0,
            'reservecharge'     => 0,
            'fine'              => 0,
            'restrictedtype'    => 0,
            'rentaldiscount'    => 0,
            'chargename'        => 0,
            'finedays'          => 0,
            'holdrestricted'    => 0,
            'allowonshelfholds' => 0,
            'reservesallowed'   => 0,
            'chargeperiod'      => 0,

            #     'issuelength'       => 0,
            'renewalperiod' => 0,
        };
    }
}

=head2 GetIssuingRulesByBranchCode
  
  my @issuingrules = &GetIssuingRulesByBranchCode($branchcode);

  Retruns a list of hashref from the issuingrules Koha table for a given 
  branchcode.
  Each hashref will contain data from issuingrules plus human readable names of 
  patron and item categories.

=cut

sub GetIssuingRulesByBranchCode {
    my $dbh = C4::Context->dbh;
    my $sth = $dbh->prepare( "
        SELECT issuingrules.*, itemtypes.description AS humanitemtype, categories.description AS humancategorycode
        FROM issuingrules
        LEFT JOIN itemtypes
            ON (itemtypes.itemtype = issuingrules.itemtype)
        LEFT JOIN categories
            ON (categories.categorycode = issuingrules.categorycode)
        WHERE issuingrules.branchcode = ?
        ORDER BY humancategorycode, humanitemtype
    " );
    $sth->execute(shift);

    my $res = $sth->fetchall_arrayref( {} );

    return @$res;
}

=head2 GetIssuingRules
  
  my @issuingrules = &GetIssuingRules({
      branchcode   => $branch, 
      categorycode => $input->param('categorycode'), 
      itemtype     => $input->param('itemtype'),
  });

  Get an issuing rule from Koha database.
  An alias for SearchInTable, see C4::SQLHelper for more help.

=cut

sub GetIssuingRules {
    my $res = SearchInTable( 'issuingrules', shift );
    return @$res;
}

=head2 AddIssuingRule

  my $issuingrule = {
      branchcode      => $branch,
      categorycode    => $input->param('categorycode'),
      itemtype        => $input->param('itemtype'),
      maxissueqty     => $maxissueqty,
      renewalsallowed => $input->param('renewalsallowed'),
      reservesallowed => $input->param('reservesallowed'),
      issuelength     => $input->param('issuelength'),
      fine            => $input->param('fine'),
      finedays        => $input->param('finedays'),
      firstremind     => $input->param('firstremind'),
      chargeperiod    => $input->param('chargeperiod'),
  };
  
  &AddIssuingRule( $issuingrule );

  Adds an issuing rule to Koha database.
  An alias for InsertInTable, see C4::SQLHelper for more help.

=cut

sub AddIssuingRule { InsertInTable( 'issuingrules', shift ); }

=head2 ModIssuingRule
  
  &ModIssuingRule( $issuingrule );

  Update an issuing rule of the Koha database.
  An alias for UpdateInTable, see C4::SQLHelper for more help.

=cut

sub ModIssuingRule { UpdateInTable( 'issuingrules', shift ); }

=head2 DelIssuingRule
  
  DelIssuingRule({
      branchcode   => $branch, 
      categorycode => $input->param('categorycode'), 
      itemtype     => $input->param('itemtype'),
  });

  Delete an issuing rule from Koha database.
  An alias for DeleteInTable, see C4::SQLHelper for more help.

=cut

sub DelIssuingRule { DeleteInTable( 'issuingrules', shift ); }

1;

=head1 AUTHOR

Koha Developement team <info@koha.org>

Jean-André Santoni <jeanandre.santoni@biblibre.com>

=cut
82cascade_copy.t · 742 B · ext .t · seen 1360× in SWH
via heuristicrule h/linguist/.t/0
swh:1:cnt:5f8a542ec72e10adf0a8a65206139081baffdc20;origin=https://github.com/st3fan/osx-10.9;anchor=swh:1:rev:9f8135f87c2ba27b1e76a514464b823812effd45;path=/CPANInternal-140/DBIx-Class/t/82cascade_copy.t
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
use strict;
use warnings;  

use Test::More;
use lib qw(t/lib);
use DBICTest;

my $schema = DBICTest->init_schema();

plan tests => 4;
my $artist = $schema->resultset('Artist')->find(1);
my $artist_cds = $artist->search_related('cds');

my $cover_band = $artist->copy;

my $cover_cds = $cover_band->search_related('cds');
cmp_ok($cover_band->id, '!=', $artist->id, 'ok got new column id...');
is($cover_cds->count, $artist_cds->count, 'duplicated rows count ok');

#check multi-keyed
cmp_ok($cover_band->search_related('twokeys')->count, '>', 0, 'duplicated multiPK ok');

#and check copying a few relations away
cmp_ok($cover_cds->search_related('tags')->count, '==',
   $artist_cds->search_related('tags')->count , 'duplicated count ok');

put_https3.al · 322 B · ext .al · seen 155× in SWH
via default-rulerule h/linguist/.al/1
swh:1:cnt:d9f16d16e120f7f0517ac8016932ee5305dec318;origin=https://github.com/jlord/git-it-electron;anchor=swh:1:rev:bde235f3467e3efda09c8ce3c693d6591153092a;path=/assets/PortableGit/usr/lib/perl5/vendor_perl/auto/Net/SSLeay/put_https3.al
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
# NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;

#line 1371 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_https3.al)"
sub put_https3  { do_httpx3(PUT  => 1, @_) }
# end of Net::SSLeay::put_https3
1;

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.pl/1.plpredicates[{"kind": "not_any", "regexes": ["^\\s*use\\s+v6\\b"]}, {"kind": "any", "regexes": ["\\buse\\s+(?:strict\\b|v?5\\b)", "^\\s*use\\s+(?:constant|overload)\\b", "^\\s*(?:\\*|(?:our\\s*)?@)EXPORT\\s*=", "
h/linguist/.pm/0.pmpredicates[{"kind": "not_any", "regexes": ["^\\s*use\\s+v6\\b"]}, {"kind": "any", "regexes": ["\\buse\\s+(?:strict\\b|v?5\\b)", "^\\s*use\\s+(?:constant|overload)\\b", "^\\s*(?:\\*|(?:our\\s*)?@)EXPORT\\s*=", "
h/linguist/.al/1.aldefault[]
h/linguist/.t/0.tpredicates[{"kind": "not_any", "regexes": ["^\\s*use\\s+v6\\b"]}, {"kind": "any", "regexes": ["\\buse\\s+(?:strict\\b|v?5\\b)", "^\\s*use\\s+(?:constant|overload)\\b", "^\\s*(?:\\*|(?:our\\s*)?@)EXPORT\\s*=", "

Contribute — propose a file extension

Tell us where to find evidence about Perl (mapped to pl/perl). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Perl/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← peridot Perl 6 →