Using strict and warnings in embedded perl

S

Suresh Govindachar

" Hello,
"
" Where do messages from "use strict; use warnings;" in
" embedded perl code go to? Specifically, how can I see
" such messages from the perl embedded in the VIM editor?
" Similar question for messages from syntax errors. Here's
" sample code for VIM's perl that runs correctly with "my"
" but fails silently when the "my" is removed. Also, it
" fails silently when a syntax error (such as missing ";")
" is introduced.
"
" Thanks,
"
" --Suresh
"
perl << EOMessage

# my $foo = 1; # OK
my $foo = 1; # NOT-ok because it is NOT STRICT

my $file ='the_file';

open (OUT, ">>$file") or die("Unable to open $file for writing: $!\n");
print OUT $foo;
close OUT;

VIM::Msg("Done! -- won't be seen with missing 'my' or syntax errors!");

EOMessage
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top