1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Firdavs [7]
3 years ago
11

Write a perl program that reads from a file containing a list of names and then displays that list to a user. The program should

then ask the user if they want to sign up on the list. If they say yes, then the program should get the name of the user and add it to the file containing the list of names. If the user does not want to sign up then the program should exit.
Computers and Technology
1 answer:
Alekssandra [29.7K]3 years ago
4 0

Answer:

#!/usr/bin/perl

use warnings;

use strict;

my $file = 'File1';

my $name;

my %h = ( ansy => 'Yes', ansn => 'No' );

open(Handle, '>>$file') or die $!;

while(<Handle>){

  print $_;

}

print "Do you want to enter your name ? \n";

my $answer = <STDIN>;

chomp $answer;

print "You have entered input as '$answer' \n" ;

my %h = ( ansy => 'Yes', ansn => 'No' );

if( $answer eq $h{ansy} ) {

  # if condition is true then print the following

  printf "Please enter your name ? \n";

  my $answer1 = <STDIN>;

  chomp $answer1;

  printf "Your have entered '$answer1' and it will be added to list \n";

  print Handle '$answer1';

} elsif( $answer eq $h{ansn} ) {

  # if condition is true then print the following

  printf "You have entered No and we will exit";

  exit();

} else {

  # if none of the above conditions is true

  printf "please enter either Yes or No \n";

}

close(Handle);

Explanation:

Above Code will work as per requirements. File1 is the path of your file.

You might be interested in
What is a geotag?
Angelina_Jolie [31]

Answer:

It helps to give the geographic location of photos.

Explanation:

A geotag is added into the photography information when it's taken.  That info is part of the EXIF information of a photo that lists a bunch of data related to the photo, like the camera brand, model, the aperture, the speed, the ISO, and so on.

That's assuming the GPS info is available of course, but if it's taken by a phone, it has the GPS info.  Most mid-range and upper-range cameras have it too.

That information is used for example by Google Maps to present photos taken at a specific location.

6 0
3 years ago
Giusp minfg gấp vs ạ đáp án thôi nhé
Umnica [9.8K]

Answer:

5 c

6 a

Explanation:

kết thúc phiên là thoát ra nên chọn exit

nháy đúp chuột trái lên biểu tượng là mở chương trình

3 0
3 years ago
The interactive process through which people learn the basic skills, values, beliefs, and behavior patterns of a society.
irina1246 [14]
The answer is : Socialization

the interactive process through which people learn the basic skills, values, beliefs, and behavior patterns of a society is called Socialization
During socialization process, a person tend to understand what is acceptable in the society and which is not. During the process, a person could also discover various unique characteristics from each individual
6 0
3 years ago
Come up with a system, using only
masha68 [24]

Explanation:

material

3 balões de erlenmeyer. .balanca

funil. . carbonato de

. rolha

. tubo abdutor

. seringa

8 0
3 years ago
Switched Ethernet, similar to shared Ethernet, must incorporate CSMA/CD to handle data collisions. True False
valentinak56 [21]

Answer:

False

Explanation:

The Carrier-sense multiple access with collision detection (CSMA/CD) technology was used in pioneer Ethernet to allow for local area networking.  Carrier-sensing aids transmission while the collision detection feature recognizes interfering transmissions from other stations and signals a jam. This means that transmission of the frame must temporarily stop until the interfering signal is abated.

The advent of Ethernet Switches resulted in a displacement of the CSMA/CD functionality.

4 0
3 years ago
Other questions:
  • If you use the ___ template, as opposed to a formatted theme, you must make all design decisions?
    15·1 answer
  • The organization of logistics activities within a firm depends on a number of factors, including the number and location of cust
    10·1 answer
  • What feature should an administrator use to meet these requirements?
    8·1 answer
  • The amount you pay your insurer for your insurance plan is which of the following?
    14·1 answer
  • When communicating with a server on another subnet, which of the following settings is used to determine which direction it need
    6·1 answer
  • What are the problems encountered in traditional approach tosystem development.
    9·1 answer
  • The one who will defeat me in this typing race I will mark the one brainliest:
    5·2 answers
  • Only the one dose audio editors and video editors know this
    9·2 answers
  • Write a statement that takes a variable named file_object that contains a file object and reads its contents into a Python list
    7·1 answer
  • 9. How much is gaming and video game streaming predicted to grow from 2018-2026?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!