split function that handles quoting.. 
Author Message
 split function that handles quoting..

Howdy. Has (have?) anyone written a subroutine similar to &split,
which handles strings like this:

   Field1 "This is field 2" Field3

Similar to what the shell does for commandline arguments..
--
Stig Jacobsen



Mon, 13 Mar 1995 02:03:46 GMT  
 split function that handles quoting..
: Howdy. Has (have?) anyone written a subroutine similar to &split,
: which handles strings like this:
:
:    Field1 "This is field 2" Field3
:
: Similar to what the shell does for commandline arguments..

;# shellwords.pl
;#
;# Usage:
;#      require 'shellwords.pl';

;#      or

;#      or

Larry



Mon, 13 Mar 1995 15:53:49 GMT  
 split function that handles quoting..

Quote:

>Howdy. Has (have?) anyone written a subroutine similar to &split,
>which handles strings like this:
>   Field1 "This is field 2" Field3
>Similar to what the shell does for commandline arguments..

See shellwords.pl, which is distributed with Perl.

Michael.



Mon, 13 Mar 1995 21:48:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to use split function to split on a backslash

2. Problem with join function (and split function)

3. How to make split() ignore quoted delimeters?

4. Avoiding split matching inside quotes?

5. handling quotes and wrapping strings/dates in sybperl

6. quoteSplit - Split string into array with embedded quotes

7. split with quoted strings

8. Dealing with split() and quotes

9. How can split ignore quoted characters?

10. Quoting and Splitting

11. Quoting delimiters in split

12. Avoid splitting quoted strings?

 

 
Powered by phpBB® Forum Software