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

Variable in split function

Expand Messages
  • Sumit
    Hi all, Can we use a variable in the /PATTERN/ argument of the split function. I tried it but was not able to get it to work. Is there something I am missing??
    Message 1 of 1 , Dec 30, 2002
    • 0 Attachment
      Hi all,
      Can we use a variable in the /PATTERN/ argument of the split function. I tried it but was not able
      to get it to work. Is there something I am missing??

      $pattern = ":";
      @Arr = split(/$pattern/, $Line);

      puts the whole $Line as the first element in the array without splitting.

      Thanks in advance and a
      Happy New Year.


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