PDL

1 program Added 2026-02-25T08:26:24Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: Perl Data Language
Provenance: commit cd568ac90c · authored 2026-02-25T09:27:00+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

4 sources · pl_id: pl/pdl
LLM (this repo) · 1PldbWikipediaWikidata · Q4046690

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.

Paradigmsarray
Designed byKarl Glazebrook · Jarle Brinchmann · Tuomas Lukka · and Christian Soeller
First appeared1996
Influenced byAPL · IDL · Perl
LicenseGNU General Public License, Artistic License
Homepagehttps://pdl.perl.org/

Related languages

Perl Data Language (0.85)GDL (0.47)IDL (0.38)LDL (0.36)ML (0.35)

LLM-contributed programs

Earth Map Data Interpreter

Provenance: commit cd568ac90c · authored 2026-02-25T09:27:00+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.pl · added: 2026-02-25T08:26:24Z
##############################
# Demo code to interpret the map data in earth.txt
# 
# Craig DeForest, 17-Dec-2002
# 
$| = 1;
print "Initializing...\n";
use PDL;
use PDL::NiceSlice;

# Snarf the file and build a separate ndarray for each polyline
print "Interpreting map file...\n";

open my $mapfh, "<", "earth.txt" or die "earth.txt: $!";
$nelem = 0;
while(<$mapfh>) {
  next if m/^\#/ || m/^\s*$/;
  s/^\s+//;
  ($x,$y,$z,$color) = split /\s+/;
  if ($color==0 and @this_polyline > 2) {
    push @this_polyline,$this_polyline[0];
    my $c = $this_polyline[1]->[3];
    print $c;
    ($this_polyline[-1])->[3] = $c;
    $nelem++;
    push @mainlist,pdl(\@this_polyline);
    @this_polyline = ();
  }
  push @this_polyline,[$z,$x,$y,$color ? $color-1:0];
  $nelem++;
}

print "Breaking up elements...\n";
$elements = zeroes(float,4,$nelem);
$pos = 0;
foreach $z(@mainlist) {
  $n = $z->dim(1);
  $elements->(0:2,$pos:$pos+$n-1) .= $z->(0:2);
  $elements->((3),$pos:$pos+$n-2) .= $z->((3),1:-1);
  $elements->((3),$pos+$n-1) .= 0;
  $pos += $n;
}

print "... $nelem vectors\n";

# Transform all the polylines into spherical coordinates.
use PDL::Transform;
$t = t_compose(t_scale(ones(3)*180/3.14159),t_spherical());

$lonlat = $t->apply( $elements(0:2) ) ->(0:1); # discard radius

# Clean up the pen values at the longitude singularity
print "cleaning up singularities...\n";
use PDL::Transform::Cartography;
$lonlatp = $lonlat->append($elements(3))->clean_lines;

# Plot map
use PDL::Graphics::Simple;
$w = pgswin(size=>[8,4]);
$w->plot(with=>'polylines', $lonlatp,
  {Title=>'Lat/Lon map of world coastlines (Plate Carree)',
    xlabel=>'East Longitude',ylabel=>'North Latitude'}
);
print "ret> "; <STDIN>;

wfits($lonlatp,'earth_coast.vec.fits');
1;

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about PDL (mapped to pl/pdl). 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/PDL/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← pdf pdl-ada →