dominix has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellowmonks, I've recently discovered the System.gc in a script, and it was the first time I saw this function. So I imediately typed a
perldoc -f System.gc No documentation for perl function `System.gc' found perl -c -e 'System.gc;' -e syntax OK
I'm curious about that, can someone explain what this does ? where it come from ? it look like a call to Garbage collector, but how do I use it ?
Thanks
--
dominix

Replies are listed 'Best First'.
Re: what about System.gc
by Corion (Patriarch) on Jun 28, 2005 at 09:26 UTC

    You're likely looking at a script not written in or for Perl. If you use warnings, Perl will tell you what it sees instead:

    perl -we "System.gc" Useless use of a constant in void context at -e line 1.

    What Perl sees here is the concatenation of two bareword strings:

    perl -we "print System.gc" Unquoted string "gc" may clash with future reserved word at -e line 1. Systemgc

    Perl has no garbage collector, as it uses reference counting only.

      Indeeed, the code is likely Java.

      lol, thanks Corion.
      I learn about perl everyday and so I was too curious what this was about, to think it was not Perl. :)
      thanks for the quick response.
      --
      dominix