In a script like the following, is it possible without dropping 'my' to effectively declare 'var' only once and have it visible outside the BEGIN block?
echo -e "\n\n\n" | \
perl -lne 'BEGIN { my $var="declared & initialized once" } print $var'
Also, why declaring var without 'my' makes it visible outside the BEGIN block?