Skip to content
cccskills
FreePublished on GitHub

perl-validate

This skill should be used when the user asks to "validate Perl script", "check Perl syntax", "verify Perl code", "/perl-validate", or mentions script validation, compile check, security review, or best practice compliance for Perl code.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md4.3 KB
  • references/code-examples.md1.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Perl Script Validation

Comprehensive validation of Perl scripts for syntax, security, and best practices.

Validation Checklist

  1. Syntax check (perl -c)
  2. Essential pragmas verification
  3. Security pattern review
  4. Best practice compliance
  5. Documentation check

Syntax Validation

Basic Compile Check

# Check syntax
perl -c script.pl

# With warnings
perl -wc script.pl

# Check module
perl -c -I lib lib/MyApp/Module.pm

Expected Output

Success:

script.pl syntax OK

Failure:

syntax error at script.pl line 15, near "my $"
script.pl had compilation errors.

Essential Pragmas Check

Every production script MUST have:

#!/usr/bin/env perl
use strict;
use warnings;
use autodie;  # For scripts with file operations

Validation Pattern

# Check for strict
grep -l 'use strict' script.pl || echo "MISSING: use strict"

# Check for warnings
grep -l 'use warnings' script.pl || echo "MISSING: use warnings"

# Check shebang
head -1 script.pl | grep -q '^#!' || echo "MISSING: shebang line"

Security Validation

Critical Checks

IssuePattern to FindFix
Two-arg openopen\s+\w+,\s*[^<>]Use 3-arg open
Backticks with variables`.*\$`Use IPC::System::Simple
eval with stringeval\s+"Use eval block
No taint mode#!/.*perl\s*$Add -T flag

Security Check Commands

# Find two-argument open
grep -n 'open\s\+[A-Z]\+\s*,' script.pl

# Find unsafe backticks
grep -n '`.*\$' script.pl

# Find string eval
grep -n 'eval\s*"' script.pl

# Check for system with string
grep -n 'system\s*"' script.pl

Best Practices Validation

Variable Declarations

# Find undeclared variables (after perl -c passes)
# These would be caught by strict, but double-check:
grep -n '\$[a-z_][a-z0-9_]*\s*=' script.pl | head -20

Function Definitions

Check for proper function structure:

# Good pattern
sub function_name {
    my ($arg1, $arg2) = @_;
    # ...
}

# Check for named parameters
grep -n 'sub.*{' script.pl

Error Handling

# Find eval blocks without error check
grep -n 'eval\s*{' script.pl

# These should be followed by or do { } patterns

Documentation Validation

POD Check

# Validate POD syntax
podchecker script.pl

# Check for POD presence
perl -MPod::Usage -e 'pod2usage(-input => shift)' script.pl >/dev/null 2>&1 || echo "No POD documentation"

Required POD Sections

# Check for NAME section
grep -l '^=head1 NAME' script.pl || echo "MISSING: =head1 NAME"

# Check for SYNOPSIS
grep -l '^=head1 SYNOPSIS' script.pl || echo "MISSING: =head1 SYNOPSIS"

Comprehensive Validation Script

Run complete validation:

Code examples

Quick Validation Commands

Syntax only:

perl -wc script.pl

Pragmas check:

head -10 script.pl | grep -E 'use (strict|warnings|autodie)'

Security scan:

perlcritic --severity 5 script.pl

Full validation:

perl -wc script.pl && \
  grep -q 'use strict' script.pl && \
  grep -q 'use warnings' script.pl && \
  echo "Basic validation passed"

Fixing Common Issues

Missing strict/warnings

Add to top of script:

use strict;
use warnings;

Two-argument open

# Wrong
open FILE, $filename;

# Correct
open my $fh, '<', $filename;

Unsafe system calls

# Wrong
system("rm $file");
`ls $dir`;

# Correct
use IPC::System::Simple qw(system capture);
system('rm', $file);
my $output = capture('ls', $dir);

Missing error handling

# Wrong
open my $fh, '<', $file;

# Correct (with autodie)
use autodie;
open my $fh, '<', $file;

# Or explicit
open my $fh, '<', $file
    or die "Cannot open $file: $!";

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

The English summary is being prepared. Showing the original description.

Jamie-BitFlight/claude_skills67Updated Oct 20, 2026

See all skills by Jamie-BitFlight

Report a problem with this skill