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 tk?

909


What are the arguements we normally use for perl interpreter?

904


What is goto statement in perl?

888


What are perl variables?

873


How to get help for perl?

936


Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.

1002


What are stdin, stdout and stderr?

1008


Is perl a case sensitive language?

1048


How many types of primary data structures in Perl and what do they mean?

1328


Differentiate between use and require, my and local, for and foreach and exec and system

838


What are the different instances used in cgi overhead?

925


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

980


How to access parameters passed to a subroutine in perl?

900


Explain join function in perl?

882


Explain the various characteristics of perl.

897