Question
1. Write a PERL subroutine or function named Greetings that displays a simple hello message. Demonstrate that the function works by invoking it to show
1. Write a PERL subroutine or function named Greetings that displays a simple hello message. Demonstrate that the function works by invoking it to show its output.
2. In Linux, the PATH (Sobell, page 308) keyword variable specifies the directories in the order Bash should search them when it searches for a script or program you run from the command line. In PERL, what would be the value of your PATH variable? What happens when you put the statement echo $PATH in the PERL Subroutine created in the previous question, such as in BASH as shown below.
3. Re-write the BASH script below in PERL and run your program to show if your output works properly. The script copies a given file name into itself (same name) followed by an extension of .bak, such as file-1 to file-1.bak when you call the script with file-1 as the first argument (source file) and file-1 as the second argument (the destination file). Before trying to copy the source file into the destination file, it first checks if the file exists in the directory and is writable and displays the appropriate message for each operation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started