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 (Cardinal) on Jul 04, 2012 at 22:20 UTC
Re: need line $2 to merge at teh beginning of line $1
by choroba (Cardinal) on Jul 05, 2012 at 08:46 UTC
    You can profit from interpolation:
    $url = "$2$1";