Skip to content

Instantly share code, notes, and snippets.

@vndmtrx
Created March 6, 2013 23:02
Show Gist options
  • Select an option

  • Save vndmtrx/5104027 to your computer and use it in GitHub Desktop.

Select an option

Save vndmtrx/5104027 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Nao foi possivel escrever $arg: $!\n";
print (FILE $msg);
close(FILE) || die "Nao foi possivel fechar $arg: $!\n";
}
} else {
print ($msg);
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment