Loading ...
Sorry, an error occurred while loading the content.

help Regareding perl references

Expand Messages
  • YogS
    Hello All, I am new to perl & I am not from any programming or software domain. I am learning perl just because I wanted it to. Now I have reached till
    Message 1 of 2 , Aug 6 10:42 PM
    • 0 Attachment
      Hello All,

      I am new to perl & I am not from any programming or software domain.
      I am learning perl just because I wanted it to.

      Now I have reached till references & dereferencing.
      So can anyone tell me the practical use of references.
      Since ordinary varibale can serve all the purpose, So why & when should one
      use references.

      Since I was not able to give this answer o myself, So I am a bit demotivated
      to learn references

      Regards
      Yogesh


      [Non-text portions of this message have been removed]
    • merlyn@stonehenge.com
      ... YogS I am new to perl & I am not from any programming or software domain. YogS I am learning perl just because I wanted it to. YogS Now I have reached
      Message 2 of 2 , Aug 7 12:12 AM
      • 0 Attachment
        >>>>> "YogS" == YogS <mail2yogs@...> writes:

        YogS> I am new to perl & I am not from any programming or software domain.
        YogS> I am learning perl just because I wanted it to.

        YogS> Now I have reached till references & dereferencing.
        YogS> So can anyone tell me the practical use of references.
        YogS> Since ordinary varibale can serve all the purpose, So why & when should one
        YogS> use references.

        An ordinary variable can hold an array or hash.

        But without references, you can't have a 2-dimensional array or hash, or a 3-diemnsional array or hash, or hash of arrays, or ...

        And you can't pass an array or hash to a subroutine as a single parameter,
        and you can't have the subroutine modify elements of the hash or array.

        References are cool.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      Your message has been successfully submitted and would be delivered to recipients shortly.