Chris Wagner wrote:
At 04:32 PM 4/7/05 -0400, John Deighan wrote:

calls) in our code. It's completely impracticle to expect us to add "main::" or "&" or "use subs" in all of this code. I doubt that anyone is


I *always* call my own defined functions/subroutines with the & prefix.
It's just good practice. Allowing the & to be omitted just encourages bad
programming practices.

You do know about the side effects of &, don't you? And you also know that it circumvents prototype checking, of course (but then again, who uses those?).


#!/usr/bin/perl

some(1,2);

sub some {
    print "some sees @_$/";
    my $this = shift;
    print "some shifts $this$/";
    &other;
    my $that = shift;
    print "some shifts $that, but it's gone :($/";
}

sub other {
    my $that = shift;
    print "other shifts $that, but we didn't pass any arguments to it!!!!$/";
}

__END__
some sees 1 2
some shifts 1
other shifts 2, but we didn't pass any arguments to it!!!!
some shifts , but it's gone :(



Rhesa
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to