Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Why am I getting "premature end of script header"? - eval { use }

by lokiloki (Beadle)
on Nov 27, 2006 at 22:59 UTC ( #586355=note: print w/replies, xml ) Need Help??


in reply to Re^3: Why am I getting "premature end of script header"? - &subroutine calling style
in thread Why am I getting "premature end of script header"?

thank you... so the takeaway message is that I should call subroutines via subroutine; and not &subroutine;? this must be a new thing? because the Perl book I have (admittedly the first edition o'reilly one) says that i should call subroutines with the ampersand...?

Replies are listed 'Best First'.
Re^5: Why am I getting "premature end of script header"? - eval { use }
by imp (Priest) on Nov 27, 2006 at 23:21 UTC
    Aye, the &subroutine; style is optional in any modern perl. I can't recall what version that changed in, but it was a fairly long time ago.
      I suppose using the & was helpful to me also because it let me know when I was calling something i had personally created, versus calling a builtin function or something from another module...
        Calling it with the ampersand disables the function's prototype. That's one reason to avoid using the ampersand.
Re^5: Why am I getting "premature end of script header"? - eval { use } (&sub...)
by tye (Sage) on Nov 28, 2006 at 00:49 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://586355]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-08-17 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?