Skip to content

Instantly share code, notes, and snippets.

@xtetsuji
Created May 31, 2013 07:19
Show Gist options
  • Select an option

  • Save xtetsuji/5683377 to your computer and use it in GitHub Desktop.

Select an option

Save xtetsuji/5683377 to your computer and use it in GitHub Desktop.
"Markline", perl interepreter's magic comment(?), concept code.
#!/usr/bin/perl
use strict;
use warnings;
# ordinally comment.
sub foo {
print "foo\n";
}
print fo0(); # typo
exit;
__END__
Result of Execution:
$ ./markline-off.pl
Undefined subroutine &main::fo0 called at ./markline-off.pl line 11.
#!/usr/bin/perl
use strict;
use warnings;
#line 1 dummy.pl
sub foo {
print "foo\n";
}
print fo0(); # typo
exit;
__END__
Result of Execution:
$ ./markline-on.pl
Undefined subroutine &main::fo0 called at dummy.pl line 5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment