select the correct answer

A

Alexander Jack

I came across this question in my office ,Im having my own idea
regarding this , so please tell your views and explanation if
possible


#! /usr/local/bin/perl -Tw

sub foo {
my $data = shift;
if ($data =~ /^([-\w.]*)$/) {
return $1;
} else {
die "Bad data in $data\n";
}
}
my $line = <STDIN>;
$line = foo($line);


Question: When is code similar to the above code used in a perl
program ?

Choices:
a. When most data is required as a scalar
b. When running setuid perl scripts that must securely use user-
supplied data
c. When preparing a function that will eventually check data for
specific criteria
d. When wanting to have a function return a string form of a parameter
e. When any string data must contain at least one character
 
A

ace

Alexander said:
Choices:
a. When most data is required as a scalar
b. When running setuid perl scripts that must securely use user-
supplied data
c. When preparing a function that will eventually check data for
specific criteria
d. When wanting to have a function return a string form of a parameter
e. When any string data must contain at least one character

c
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top