Skip to content

Instantly share code, notes, and snippets.

@prufrock
Last active December 16, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prufrock/5509157 to your computer and use it in GitHub Desktop.
Save prufrock/5509157 to your computer and use it in GitHub Desktop.
A simple function to print out the contents a perl array on a single line.
sub oneLineArray
{
my $a = shift @_;
my @array = @$a;
print "(";
foreach(@array){
print " " . $_;
if($_ ne $array[$#array]){
print ",";
}
}
print " )\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment