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

Explain chop?

966


What is the difference between die and exit in perl?

1055


Where do we require ‘chomp’ and what does it mean?

1055


What happens in dereferencing?

1109


What exactly is grooving and shortening of the array?

1065


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

961


Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.

1076


Differentiate use and require?

1002


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

1039


What does undef function in perl?

1003


What are the various uses of perl?

1094


Explain the difference between "my" and "local" variable scope declarations. ?

1143


Explain socket programming in perl?

963


How can the user execute a long command repeatedly without typing it again and again?

981


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

963