Thursday, August 27, 2020

Testing Your Perl Installation

Testing Your Perl Installation So as to test our new establishment of Perl, well need a straightforward Perl program. The principal thing most new software engineers learn is the manner by which to make the content make proper acquaintance World. Lets take a gander at a basic Perl content that does only that. #!/usr/container/perl print Hello World. ; The principal line is there to tell the PC where the Perl mediator is found. Perl is a deciphered language, which implies that instead of gathering our projects, we utilize the Perl mediator to run them. This first line is normally #!/usr/receptacle/perl or #!/usr/nearby/canister/perl, yet relies upon how Perl was introduced on your framework. The subsequent line advises the Perl translator to print the words Hello World. followed by a newline (a carriage return). In the event that our Perl establishment is working effectively, at that point when we run the program, we should see the accompanying yield: Hi World. Testing your Perl establishment is diverse relying upon the kind of framework you are utilizing, yet well investigate the two most basic circumstances: Testing Perl on Windows (ActivePerl)Testing Perl on *nix Systems The main thing youll need to do is ensure youve followed the ActivePerl Installation tutorialâ and introduced ActivePerl and the Perl Package Manager on your machine. Next, make an envelope on your C: drive to store your contents in for the instructional exercise, well call this folderâ perlscripts. Duplicate the Hello World program into C:perlscripts and ensure the filename isâ hello.pl. Getting a Windows Command Prompt Presently we have to get to a Windows order brief. Do this by tapping on the Start menu and choosing the item Run.... This will spring up the run screen that contains the Open: line. From here, just typeâ cmdâ into the Open: field and press the Enter key. This will open (one more) window which is our Windows order brief. You should see something like this: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:Documents and SettingsperlguideDesktop We have to change to the index (cd) that contains our Perl contents by composing in the accompanying order: compact disc c:perlscripts That should cause our brief to mirror the adjustment in the way like so: C:perlscripts Presently that were in a similar index as the content, we can run it basically by composing its name at the order brief: hello.pl On the off chance that Perl is introduced and running accurately, it should yield the expression Hello World., and afterward return you to the Windows order brief. A substitute technique for testing your Perl establishment is by running the mediator itself with theâ -vâ flag: perl - v On the off chance that the Perl mediator is working effectively, this should yield a lot of data, including the current adaptation of Perl you are running. Testing Your Installation On the off chance that you are utilizing a school or work Unix/Linux server, odds are Perl is as of now introduced and running if all else fails, simply ask your framework chairman or specialized staff. There are a couple of ways we can test our establishment, above all, you should finish two primer steps.​ In the first place, you should duplicate your Hello World program to your home index. This is generally practiced by means of FTP. When your content has been replicated to your server, you should get to aâ shell promptâ on the machine, as a rule through SSH. At the point when you have arrived at the order brief, you can change into yourâ homeâ directory by composing the accompanying order: album ~ Once there, testing your Perl establishment is fundamentally the same as testing on a windows framework with one additional progression. All together toâ executeâ the program, you should initially tell the working framework that the record is OK to execute. This is finished by setting the authorizations on the content with the goal that anybody can execute it. You can do this by utilizing theâ chmodâ command: chmod 755 hello.pl Once youve set the authorizations, you would then be able to execute the content by just composing its name. hello.pl On the off chance that that doesnt work, you probably won't have your home index in your present way. For whatever length of time that you are in a similar catalog as the content, you can advise the working framework to run the program (in the current registry) like so: ./hello.pl On the off chance that Perl is introduced and running effectively, it should yield the expression Hello World., and afterward return you to the Windows order brief. A substitute strategy for testing your Perl establishment is by running the translator itself with theâ -vâ flag: perl - v In the event that the Perl translator is working accurately, this should yield a considerable amount of data, including the current variant of Perl you are running.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.