Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
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 (Abbot) 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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2014-09-17 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (70 votes), past polls