Ask a Question related to PERL Miscellaneous, Design and Development.
-
Dan Jacobson #1
subroutines may be located anywhere in the main program
Perlsub says subroutines may be located anywhere in the main program;
and indeed,
$ perl -e 'if(0){sub x{print "wow"}};x;'
wow
Anything non ideal here?
Dan Jacobson Guest
-
Question about subroutines....
Hi, Is it possible to write a subroutine in Perl which accepts an open file handle as parameter? At the moment it seems hopeless, but is it? ... -
Making A Library of Perl Subroutines
I am writing several subroutines that I want to make available to other programs without directly including the code in those programs. Can anyone... -
DBConn.asp -- database subroutines
Hey guys :) I was just hoping a couple of you could let me know what you think about my DBConn.asp script on my website. you can view the code... -
using Getopt with subroutines
Hello, I have a subroutine that is contained within its own module and package. It currently takes 7 different arguments, but only 2 of them are... -
Undefined subroutines in my modules
I have three modules in my site_perl directory Vertigan::File, Vertigan::Template and Vertigan::Datafile. Both Template and Datafile call File... -
Tassilo v. Parseval #2
Re: subroutines may be located anywhere in the main program
Also sprach Dan Jacobson:
Readability perhaps. At least I'd be confused to see a subroutine> Perlsub says subroutines may be located anywhere in the main program;
> and indeed,
> $ perl -e 'if(0){sub x{print "wow"}};x;'
> wow
>
> Anything non ideal here?
declared in an if-branch.
Other than that, there is not much wrong with it as long as you don't
expect to impose a certain scope or visibility on your subroutines.
They'll always be globally accessible (within the same package) and Perl
doesn't know about inner functions or so.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest



Reply With Quote

