#! /usr/bin/env perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Useqq = 1; my $filename = shift || die "no file given.\n"; open my $fh, '<', $filename or die "$!\n"; my $line = <$fh>; if ( $line =~ m{^([^\r\n]*)} ) { print Data::Dumper->Dump( [ $line, $1 ], [ qw( *line *1 ) ] ); } close $fh;