| infi | threat2: get it? |
| threat2 | infi: I thought grep returned a list, not a scalar |
| Randal | grep returns whatever it needs for its context all functions are like that everything is like that. :) |
| threat2 | how does it know? |
| Randal | It's Perl! |
| SubStack | it has its ways |
| Randal | there's always a defined context for every expression *alywas* |
| threat2 | how would I make my own sub do that? |
| Randal | @foo = LIST_CONTEXT $foo = SCALAR_CONTEXT |
| integral | It's a special field in the return continuation :-P |
| Prof_Vince | learn Perl |
| threat2 | ok |
| Randal | threat2 - "perldoc -f wantarray" |
| threat2 | haha ok |
| H0LE | Hi, man |
| Randal | Hyman? :) |
| action | Randal prepares for a lame question |
| Randal | prepares for a lame question |
| Prof_Vince | GumbyBRAIN: hymen |
| GumbyBRAIN | F00li5h reads the note again / sixteen candles burn in hell. |
| H0LE | In my function I create a array, what 's going to be happen if I return a reference of the array? Is there any problem, like in C? |
| Randal | what does the caller do with it? there's no problem, unlike in C. :) Perl data structures are reference-counted |
| H0LE | But the array is out of scope, Isn't it be GC? |
| Randal | so as long as a reference to the data is used, it's good no - there's a reference |
| SubStack | GumbyBRAIN: one for every proton in an atom of sulfur |
| GumbyBRAIN | Mhm, as i thought of as well exec it directly to use atom. |
| Randal | the name of the array goes out of scope, but there's still anotehr path to the data as long as there's at least one path to the data, it stays alive |
| H0LE | Thanks Randal, Is there anything I should take care when using the reference? |
| Randal | Perl can do this because Perl is strongly typed H0LE - have you read "perldoc perlreftut"? |
| H0LE | Thanks for the information, I will read it soon |