Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: sending a scalar to the interpreter as a command

by BrowserUk (Pope)
on Oct 08, 2012 at 23:28 UTC ( #997894=note: print w/ replies, xml ) Need Help??


in reply to Re^2: sending a scalar to the interpreter as a command
in thread sending a scalar to the interpreter as a command

#! perl -slw use strict; sub loops { map { my $n = $_; @_ ? map{ $n . '-' . $_ } loops( @_ ) : $n; } @{ shift() }; } my @arrays = map [ split ], <DATA>; print for loops( @arrays ); __DATA__ 67 42 99 28 15 14 92 12 45 57 16 41 99 67 28 15 57 12 45 14 92 12 92 42 67 28 15 45 57 16 12 99 14

Produces:

67-41-92 67-41-42 67-41-67 67-41-28 67-41-15 67-41-45 67-41-57 67-41-16 67-41-12 67-41-99 67-41-14 67-99-92 67-99-42 67-99-67 ... 16-92-12 16-92-99 16-92-14 16-12-92 16-12-42 16-12-67 16-12-28 16-12-15 16-12-45 16-12-57 16-12-16 16-12-12 16-12-99 16-12-14

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^3: sending a scalar to the interpreter as a command
Select or Download Code
Re^4: sending a scalar to the interpreter as a command
by silentq (Novice) on Oct 12, 2012 at 17:06 UTC

    My apologies to BrowserUK whose earlier post I missed somehow.

    Your solution seems to do everything I needed to do. I'll play around with it and let you know if I have any additional questions, but that seems to work for now. Thanks so much!

    Thanks to everyone else, too, for your excellent suggestions. Clearly, I need to pay more attention to glob and look for more opportunities to take advantage of its functionality.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (19)
As of 2014-09-02 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (25 votes), past polls