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

Use Split with Scalar Pattern?

Expand Messages
  • Mike Dillinger
    Hello, Can I use the split function where my pattern is a scalar variable? For instance: my $splitPattern = | ; my( $data1, $data2 ) = split(
    Message 1 of 1 , Jul 19, 2004
    • 0 Attachment
      Hello,

      Can I use the split function where my pattern is a scalar variable? For
      instance:

      my $splitPattern = '|' ;
      my( $data1, $data2 ) = split( /$splitPattern/, $someData ) ;

      I can't seem to get it to work. If I hard code the pattern in the split
      function call, it works fine.

      Thanks,
      -MikeD

      (Resent to correct silly errors - sorry)
    Your message has been successfully submitted and would be delivered to recipients shortly.