Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

need line $2 to merge at teh beginning of line $1

by diamondsandperls (Beadle)
on Jul 04, 2012 at 22:12 UTC ( #979927=perlquestion: print w/replies, xml ) Need Help??
diamondsandperls has asked for the wisdom of the Perl Monks concerning the following question:

I have a file that has multiple instances where line $2 is http://myurl and line $1 is /this/is/my/request

my goal is to have http://myurl/this/is/my/request

  • Comment on need line $2 to merge at teh beginning of line $1

Replies are listed 'Best First'.
Re: need line $2 to merge at teh beginning of line $1
by davido (Archbishop) on Jul 04, 2012 at 22:20 UTC
Re: need line $2 to merge at teh beginning of line $1
by choroba (Chancellor) on Jul 05, 2012 at 08:46 UTC
    You can profit from interpolation:
    $url = "$2$1";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://979927]
Approved by davido
help
Chatterbox?
[ambrus]: Corion: re stops the timer, sure, but stopping won't erase events already queued, right?
[ambrus]: really I don't know how it works
[marto]: good morning all, TCIF

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-12-09 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.