Skip to content

Instantly share code, notes, and snippets.

@atulsingh0
Created April 24, 2013 13:24
Show Gist options
  • Save atulsingh0/5452098 to your computer and use it in GitHub Desktop.
Save atulsingh0/5452098 to your computer and use it in GitHub Desktop.
Perl Code To Print the 1st character of a file
#!/usr/bin/perl
open (FILEHANDLE, "< new.pl") or die "oops: $!";
@each = FILEHANDLE;
my $char = getc $each[0];
print $char;
close(FILEHANDLE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment