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

How do I send e-mail from a Perl/CGI program on a Unix system?

992


Explain returning values from subroutines?

922


How to check the status of airplane mode (enable/disable) in perl for Android mobile?

3071


Explain goto label?

903


What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)

923


what is Perl one liner?

882


You want to download the contents of a url with perl. How would you do that?

863


What are some of the key features of objects in perl?

921


What's the difference between /^Foo/s and /^Foo/?

1163


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

911


Is there any way to add two arrays together?

953


What does undef function in perl?

925


What is a chomp() function in perl?

1005


There are some duplicate entries in an array and you want to remove them. How would you do that?

891


What is the usage of -i and 0s options?

965