write a Perl script to find a particular word in a paragraph???
Answer / guest
[code]
my $pat;
$pat='Using push we can add multiple items into an array in
a single instance.
If we are trying to add a module or library files in
our program using require or use statement then it will
search that module or library files in the Perl\'s default
search path.
The statement use lib is used to add the directories
to default search path.
So if the module or library file is not located in
the Perl\'s default search path then it will find the
library files in the path we have given with the use lib
$path.';
if($pat=~/push/)
{
print "Pattern push get matched\n";
}
[/code]
| Is This Answer Correct ? | 7 Yes | 0 No |
What is the use of '>>' in perl?
How to read multi lines from a file in perl?
Packing and Unpacking. Hi, I want to get output as 0x23400000345.... in the below example How to get? i tried out, but unable to get the answer $r=0x234; $t=0x345; $y=pack('L L',$t,$r); $x1=unpack('L!',pack('P',$y)); printf("\nThe value is $x1"); I didn't get constant output
How does polymorphism work in perl? Give an example.
what is Polymorphism in Perl?
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
Define dynamic scoping.
What do you mean by context of a subroutine?
Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode combination.
Explain the meaning of subroutine?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
How to read a directory in perl?