Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

need help in writing aperl script

by jag194u (Initiate)
on May 27, 2015 at 02:58 UTC ( [id://1127921]=perlquestion: print w/replies, xml ) Need Help??

jag194u has asked for the wisdom of the Perl Monks concerning the following question:

HI all..iam new to perl i have a multiple lines like the below in a file write_x("string1",one,two,"string2"); i need to modify the above line to writing.reg("string1").write(two,one); i want to give a file name as input to the script and let the script parse through the file to find the line and change it. Any help would be greatly appreciated. Thanks.

Replies are listed 'Best First'.
Re: need help in writing aperl script
by Anonymous Monk on May 27, 2015 at 03:03 UTC
      I have started writing the script to open a file and parse through the lines.but iam troubling with pattern matching and insert the words in the resulting line.
      open my $file ,"+<","reg" or die $!; while (my $line = <$file>) { chomp $line; print "$line\n" }

        I have started writing the script to open a file and parse through the lines.but iam troubling with pattern matching and insert the words in the resulting line.

        Ok then, then look here :)

Re: need help in writing aperl script
by ww (Archbishop) on May 27, 2015 at 11:32 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found