[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] RE: wrong
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
<quote who="Patrick Sean Baker">
> I actually like your new way:
> ($lname, $fname) = m#^(.*?)[,/]\s+(.*)$#;
Wouldn't this work the same (and save one byte golfing...):
($lname, $fname) = m#^(.*?)[,/ ]+(.*)$#;
On Aug 26, 2004, at 11:35 AM, Jay Hannah wrote:
> my ($lname, $fname) = ($res->get_gst_name =~ /^(\w+)(,|\/)(\w+)$/);
This would have worked modifying the left side of the "=", right?
my ($lname, $foo, $fname) = ($res->get_gst_name =~ /^(\w+)(,|\/)(\w+)$/);
(Then just ignore $foo...)
$ cat /tmp/d.pl
#!/usr/bin/perl
$_ = "Linder, Dan";
($lname, $fname) = m#^(.*?)[,/]\s+(.*)$#;
print "[$lname][$fname]\n";
$_ = "Linder, Dan";
($lname, $fname) = m#^(.*?)[,/ ]+(.*)$#;
print "[$lname][$fname]\n";
$ /tmp/d.pl
[Linder][Dan]
[Linder][Dan]
Dan
- - - - -
"I do not fear computer,
I fear the lack of them."
-- Isaac Asimov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFBL6F1NiBNyqUzGb8RAt++AJ9u59omqvArlbAEllWohMcyov0/XQCfQxPv
wQHHVTjQ+Zs/D1sRuEEV+3M=
=/JJC
-----END PGP SIGNATURE-----