#perl - Sun 11 Mar 2007 between 12:15 and 12:31



ayrnieuand how it exports Foo, and how it gets use'd.
alobodigeMish: I'll give that a shot, thanks
eMishayrnieu, it just defines sub Foo {}
dazjorzand then the pc crashed.
xandnoob.
what OS is that?
ayrnieuemish - then nothing special happens.
eMishit's rhinocerOs
bpalmer`Hmm, I wonder if the perl vars that are always in package main count as global variables?
eMishayrnieu, but is that Foo() in the global scope of the code that's including the XYZ ?
ayrnieuemish - no, there is no global scope. Foo is only in XYZ.
nanonymeheh, one reason why it would be bad if you could make hard links to directories would be if some dumbass decided to do ln / /foo/bar and then run find :/
find would go to an infinite loop
ayrnieuemish - the use'er of XYZ can still invoke it through that package, as in XYZ::Foo(@args)
eMishayrnieu, and if I do 'use XYZ qw{Foo}', then it is usable directly ?
bpalmer`eMish: if the package XYZ is set up as a module, it can automatically "export" that function Foo into the namespace of the thing that did "use XYZ"
ayrnieunano - logically, you are by that only restricted from having more than one hard link for a directory.
eMishbpalmer`, do you talk about 'exporting' ?
bpalmer`eMish: perldoc Exporter
eMish: I do
ayrnieuemish - perldoc perlmod
eMishwhere can I get 90% of knowledge for 10% of time, please ?
ayrnieuemish - you can look at a few modules off of CPAN.
But given how much time you wasted just failing to ask this question, you should read perl's documentation. It's quite good. You'll gain XP, and possibly a level.
eMishbut what if i happen to look at shitty modules ? I hear they happen
ayrnieuemish - nothing special will happen in that case.
eMishayrnieu, why do maintain that there is no global scope in perl ?
ayrnieuemish - because there is not.
eMishis there toplevel scope ?
main scope ?
ayrnieuIt isn't unusual to lack global scope; even C lacks global scope.
eMishC lacks global scope ?
wow that's news
ayrnieuTo someone who spends his time not reading documentation, sure.
eMishayrnieu, does perl has global variables ?
ayrnieuemish - if it had them, it would have global scope.
eMishs/has/have/
perl docs has ~18 times mention of 'global variables'
why do you insist they do not exist ?
ayrnieuemish - because they do not.

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 

IrcArchive