Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Merge the difference between two files

by hippo (Bishop)
on Jun 17, 2017 at 09:02 UTC ( [id://1193011]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Merge the difference between two files
in thread Merge the difference between two files

You are correct, I should remove the lines "used File::Copy? Or Cwd:" since I don't know what they mean.

Perl is one of those long-established languages which has very extensive documentation. Your installation should have the perldoc command which will help but if it is not there you can use the online version instead (see how the word perldoc looks like a link? It is one!). The customary place to start is with perlintro but you can follow the "use" link in my previous post which explains in a rather dry way what that command does. You have lots of reading ahead of you!

I was copy the template from other blogs and forgot to remove them.

It's tempting when learning a new language to just copy code from somewhere else and hack it about to make it do something slightly different. However, it does pay to understand the code you are copying before you start to hack it about.

I want to use the "my $dir.." because I want to verify and make the files that I am working on are in the same directory as the Perl scrip.

Fine, but you are not using it in this example. The principle of an SSCCE is to reduce the example code to the minimum required (the first S stands for "Short"). It's a distraction to you and us so you may as well remove it for now. $dir isn't doing what you think anyway.

I used sub main because I need to the script to do multiple tasks after it is merging.

OK, but be careful about scoping. And try to avoid the particular word "main" since that's also a built-in package name in Perl and as a beginner you may get confused between warnings/errors which relate to either your "main" sub or the main package.

Keep at it - you are at the beginning of a long, winding, fascinating and ultimately fulfilling path. We all started where you are now.

  • Comment on Re^3: Merge the difference between two files

Log In?
Username:
Password:

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

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

    No recent polls found