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

Re: [PBML] new member needs help!

Expand Messages
  • jpitchko@sgi.sk.ca
    Congratulations on all your accomplishments and welcome to the list. I m sure you will find that everyone here is friendly and quite helpful. But let me answer
    Message 1 of 1 , Aug 30, 2002
    • 0 Attachment
      Congratulations on all your accomplishments and welcome to the list. I'm sure you will find that everyone here is friendly and quite helpful.

      But let me answer your questions.

      1) The split function takes a string, scans it for specified delimiters, and then splits the string into substrings, returning the resulting data to a scalar or array. For example, say you have a string $alpha that contains "The cat in the hat". You could then go @beta = split / /, $alpha; which would split the string on the spaces and store the data in an array called beta. So beta would look like
      $beta[0] = "The"
      $beta[1] = "cat"
      $beta[2] = "in"
      $beta[3] = "the"
      $beta[4] = "hat"

      split can split on any delimiter, including regex's. Let me know if this is still unclear to you.

      2) It's pretty simple. If you want to call a sub called gamma with arguments $delta and $epsilon, you would go gamma($delta, $epsilon). Pretty standard like in other C-like languages.

      To access these arguments in the sub:
      sub gamma
      {
      my ($localDelta, $localEpsilon) = @_;
      ..
      ..
      ..
      }

      What happens is that the arguements are attached to Perl's ARG array ( @_ ) when the sub is called. So to access these elements, just take them off that array.

      Again, I hope this all makes sense. Programmers rarely make the best teachers, so let us know if you are still confused.

      Good luck!


      John Pitchko
      Data Services
      Saskatchewan Government Insurance

      >>> perlpro@... 08/29/02 11:00pm >>>
      Hi all the listers,
      This is Krishnakant Mane from India Mumbai. I am a new member on the list and am very glad to be here.
      Let me introduce my self.
      I am yet another programmer and work on all streams of programming. I hold the national record of being the first visually impaired IT Professional to own a software firm and work on all the streams of programming viz the backend (database design and development), front end design and development and web programming. Not to mention I have just started to use perl an certainly have some questions.
      I am quite an intermediate programmer and not so advanced. But I promice to help any one where ever I can and once I become an expert I will also be able to help more programmers.
      I use a screen reader to read the screen and so I have to depend a lot on electronic documentation. It is really time consuming. Please help me out on the following issues.
      1. I did not get the use of split function. Please give me some hint or example as to how it is used and what is its application.
      2. How do parameters or arguments work with a perl sub routine. I mean how do we pass the arguments and get them back.
      I suppose this is done with a list but how to do it.
      Thanks in advance,
      Krishnakant Mane
      Chairman, Compact Software Solutions.
      -------------------------------------------------
      Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
      Know more at http://mail.sify.com

      Want to get into IIM? Take the Sify Mock CAT now!
      http://education.sify.com/mockcat


      Yahoo! Groups Sponsor
      ADVERTISEMENT



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.