Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Try pattern matching for the following:
1) 10.111.23.11
2) /root/abc/cde/fgg/ac.xml --> Get file name without
extention.
3) /root/abc/ac.xml/fgg/ac.xml --> Get file name without
extention.
4) What does "DIE" meant in PERL?
5) chomp
6) "This is saturday" --> Print the weekday number.
7) 11-2-2009 --> Print the name of the month.
8) Reverse the string without using func in C.

Answer Posted / kiruthikau

Try the following code for getting weekday number.
[code]
use strict;
use warnings;

my %days=("Sunday"=>1,
"Monday"=>2,
"Tuesday"=>3,
"Wednesday"=>4,
"Thursday"=>5,
"Friday"=>6,
"Saturday"=>7,);
my $str="This is Saturday";
my @day=split(' ',$str);
print "\tWeekday Number of $day[-1] is:",$days{$day[-1]};
[/code]

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is perl unshift array function?

1045


What are scalar data and scalar variables?

1125


What is hash?

1082


What does last statement do in perl?

1023


Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?

930


List the data types that Perl can handle?

1068


Explain '->' in perl?

934


Define say() function in perl?

972


Write syntax to add two arrays together in perl?

934


How the interpreter is used in Perl?

954


what are the two ways to get private values inside a subroutine or block?

943


What is automatic error handling in perl?

1060


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

926


what are steps to do to lock the sony ericsson mobile with password?

2207


How can you use Perl warnings and what is the importance to use them?

975