Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: regular expression trouble

by NetWallah (Canon)
on May 31, 2013 at 14:39 UTC ( #1036257=note: print w/replies, xml ) Need Help??


in reply to regular expression trouble

In addition to this, for the case when the key starts with "-" ( if (/^-/) ),
You are not appending to $names.

The "for" loop and "chop"s could be replaced by:

my $names = join ",\n", map {s/^-//; $_ } keys %data; my $values= join ",\n", map { m/$-/ ? $data{$_} : $dbh->quote($data{$_ +} } keys %data;
(I have made some assumptions on what you want done when the key starts with "-".)

             "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
        -- Dr. Cox, Scrubs

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1036257]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-12-09 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?