Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Scalar joining, concatenation, involving varying text

by crenz (Priest)
on Jun 27, 2005 at 20:40 UTC ( #470381=note: print w/replies, xml ) Need Help??


in reply to Scalar joining, concatenation, involving varying text

I'd try something like this:

my %values = ( a => 1, b => 0, c => 1); my $combined = ''; foreach (sort keys %values) { $combined .= "$_=$values{$_} " if $values{$_}; }

Once you understand the above solution, you can try to replace it with using map and grep. Even though I'm very familiar with both, I'd just leave it like that, though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-01-25 03:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (65 votes). Check out past polls.

    Notices?