in reply to Re^4: Parsing problem
in thread Parsing problem
I know the quotes work because I tested them before posting.
Really? So did I and it did not work. The "stronger reason" is that most people forget that double qoutes interpolate and the forward slashes do not. See for yourself.
#!/usr/bin/perl use strict; use warnings; no warnings 'uninitialized'; # prevents a warning on line 8 my $description = "Some descriptive text here^`my_username"; my ($desc, $username) = split("\^`", $description); print "desc: $desc\n"; print "username: $username\n"; ($desc, $username) = split(/\^`/, $description); print "desc: $desc\n"; print "username: $username\n"; ($desc, $username) = split("\\^`", $description); print "desc: $desc\n"; print "username: $username\n"; __DATA__ desc: Some descriptive text here^`my_username username: desc: Some descriptive text here username: my_username desc: Some descriptive text here username: my_username
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Parsing problem
by NetWallah (Canon) on Dec 12, 2004 at 07:01 UTC |