hi,
I am new to this group...... i preferred to join here for
getting
answers for my doubts, ....
#! /usr/local/bin/perl -Tw
sub foo {
my $data = shift;
if ($data =~ /^([-w.]*)$/) {
return $1;
}
return $data;
}
my $line = <STDIN>;
$line = foo($line);
Question When is code similar to the above code used in a
perl program?
Choice 1
When preparing a function that will eventually check data
for
specific criteria
Choice 2
When running setuid perl scripts that must securely use
user-supplied
data
Choice 3
When any string data must contain at least one character
Choice 4
When wanting to have a function return a string form of a
parameter
Choice 5
When most data is required as a scalar
------------------------------------------------------
while (my ($key,$value) = each(%main: ) {
local(*gl) = $value;
print "$key - $gln";
}
Question What does the above sample code print?
Choice 1
The names and scalar contents of all variables in the main
namespace
Choice 2
A list of all packages contained underneath the main
namespace
Choice 3
The current script indexed by line numbers
Choice 4
A list of all globs contained in the main namespace
Choice 5
The names and definitions of all subroutines in the main
namespace
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://g
roups.yahoo.com/group/Perl_Official/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http
://groups.yahoo.com/group/Perl_Official/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:Perl_Official-digest@yahoogroups.com
mailto:Perl_Official-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
Perl_Official-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|