Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: precedence: two functions on one line

by kingman (Scribe)
on Jul 27, 2001 at 18:59 UTC ( [id://100325]=note: print w/replies, xml ) Need Help??


in reply to Re: precedence: two functions on one line
in thread precedence: two functions on one line

I can't change the data as this is part of a larger application that expects $tracker to be a scalar. However, This variation on what you posted does exactly what I want, and on a single line too!
@files = map { "$path$_" } split /<br>\n/, $tracker;
Must go meditate on the mysteries of the map function. Thanks!

Replies are listed 'Best First'.
Re: Re: Re: precedence: two functions on one line
by andye (Curate) on Jul 27, 2001 at 19:14 UTC
    map's great. Here's another example, to aid the old meditations:
    $tracker = join "", map {"$_.html<br>\n"} ('a'..'f');
    - although frankly it's more readable as a here doc!

    andy.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-23 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found