#!/usr/bin/perl use strict; use warnings; use YAML::Tiny; my $file = shift @ARGV or &usage; do $file; my $yaml = YAML::Tiny->new; $yaml->[0] = $VAR1; print $yaml->write_string; sub usage { print "usage: pl2yml FILE\n"; }