perl interview questions

2011-04-20 Thread Jyoti
Hello All,

Please give me any link or any tutorial which will be helpful for
preparation of PERL interview.

Thanks in advance.



Jyoti


Time Subroutine

2010-10-26 Thread Jyoti
Hello Everyone,

Can anyone tell me about the subroutine that returns current time please.
Is there much difference if we output current time or uptime ?

Many Thanks,
Jyo


Tags Help

2010-10-22 Thread Jyoti
Hello Everyone,

My script contains:







 


 





I do get all the tags one below the other using perl below code:
while ($flag){
my $start = index($temp_contents, '') +
length('');
if ($start >0){
my $temp_message = substr($temp_contents, $start,
($end-$start));
push @messages, $temp_message;
$flag =0;
} else{
$flag = 0;
}
}
Similarly for other tags as well. The problem is 

New
Subroutine




This returns
date

 
 

Name one


Name two

  
  

  
At present, according to my code, I get the first  tag with
its contents.
Can anyone please tell me how to get rest of the message tags as well.

Many Thanks,
Jyo


Regular Expresion - Urgent

2010-10-20 Thread Jyoti
Hi,

Can anyone please help me to parse WSDL file using Regular expression.

The file starts like this:


and ends

with 

How to write regualar expression for the above please.

Thanks,
Jyo


String Handlers

2010-10-20 Thread Jyoti
Hello Everyone,

Can anyone tell me how to use string handlers in perl (join function). I
tried it to get a list of words.
But i actually want to combine all the similar tags from one file and get it
one below the other in a new file.

For example : My file looks like this now: (Combines 2-3 files)




 




 








 








Now i want all the similar tags to be one below the other like :

 


 


 


 


 


 


I have to store one tag in array and display its contents.
Hope its clear what I mean.

Please help !

Cheers,
Jyo


perl for systemadministration

2010-10-20 Thread Jyoti
Hi Folk,

I need your help. Please tell me a good book for perl for system
administration.


Subroutine

2010-10-11 Thread Jyoti
Hello,

Can anyone help me out to call all subroutines from different .pm files in a
specific directory please ?

Many Thanks,
Jyoti


Calling all methods (URGENT)

2010-10-11 Thread Jyoti
Hello All,

I need an urgent help.
I have got .pm files in a directory. All .pm files have subroutines with
different methods. At present, I am getting an output of list of all .pm
files.
But I want it to take all methods from all .pm files and give and output
with all the subroutine (methods) from each file.
Can anyone help me with this please ?

Many Thanks,
Jyoti


Perl, WSDL, SOAP web services

2010-10-05 Thread Jyoti
Hello everyone,

Does anyone of you know how to generate WSDL files using Perl script ?
I want to generate WSDL files which I done with Pod::WSDl module. But it
generates for only one method at a time.
I want to execute two or more methods but it should all be displayed in one
WSDL file.

Please help!

Many Thanks,
Jyo


Re: Urgent Request

2010-10-05 Thread Jyoti
Does anyone of you know how to generate WSDL files using Perl script ?
I want to generate WSDL files which I done with Pod::WSDl module. But it
generates for only one method at a time.
I want to execute two or more methods but it should all be displayed in one
WSDL file.

Please help!

Many Thanks,
Jyo

On Tue, Oct 5, 2010 at 3:03 PM, Jyoti  wrote:

> Ok got it now :)
>
> Thank You all :)
>
> Cheers,
> Jyoti
>
>  2010/10/5 Jeff Peng 
>
>> > Sorry doesnt work.
>>
>> >
>> > Error is :
>> >
>> > Can't locate object method "perl" in 'filename'...
>> >
>>
>>  what's the content of the script?
>>
>>
>>
>>
>


Re: Urgent Request

2010-10-05 Thread Jyoti
Ok got it now :)

Thank You all :)

Cheers,
Jyoti

2010/10/5 Jeff Peng 

> > Sorry doesnt work.
> >
> > Error is :
> >
> > Can't locate object method "perl" in 'filename'...
> >
>
> what's the content of the script?
>
>
>
>


Re: Urgent Request

2010-10-05 Thread Jyoti
Sorry doesnt work.

Error is :

Can't locate object method "perl" in 'filename'...

Also

2010/10/5 Jeff Peng 

> > Hello,
> >
> > Can anyone please tell me how to save output (what we get after running a
> > perl script) as an external file?
> >
>
> run it under a unix shell?
> try:
>
> perl a.pl > a.txt 2>&1
>
> save all the output of a.pl to a.txt.
>
> 2>&1 means to capture the script's error output also.
>
>


Urgent Request

2010-10-05 Thread Jyoti
Hello,

Can anyone please tell me how to save output (what we get after running a
perl script) as an external file?

Many Thanks,
Jyoti


SOAP and WSDL

2010-09-16 Thread Jyoti
Hello,

Can anyone help me generate WSDL files via a Perl code. I am learning to
develop a web service using SOAP. I need to write a code, which generates
WSDL file structure.
Something like

sub WSDLTypes {
}

sub WSDLMessages {
}

sub WSDLPortType {
}

sub WSDLBinding{
}

Many Thanks,
Jyo


script for shutdown remote machine

2010-09-03 Thread Jyoti
Dear All,
Give me name of CPAN modules to write down perl script for shudown remote
machines.


Re: Imp

2010-08-30 Thread Jyoti
Yep in CPAN ! Not Databases.

Thanks.
Jyo

On Mon, Aug 30, 2010 at 6:16 PM, Shawn Rynearson
wrote:

> To get queries and responses in CPAN?  Or are you talking about MySQL?  If
> your talking about SQL, use DBI.  http://dbi.perl.org/
>
> On Aug 30, 2010, at 3:34 AM, Jyoti wrote:
>
>  Hello everyone,
>>
>> Can anyone please guide me with specific CPAN perl libraries/modules, to
>> send queries and get responses. I tried looking in CPAN,but I am still a
>> learner, so not able to get properly.
>> Can anyone reply me for the same please?
>>
>> Many Thanks.
>> Jyoti
>>
>
>


Re: Imp

2010-08-30 Thread Jyoti
HI everyone,

Sorry about previous incomplete question. Yes, I am looking for CPAN modules
to send network queries and get responses (HTTP queries.). To be more
specific, these modules should be used in Web Services, (using SOAP).

Many Thanks.
Jyo

Are you looking for CPAN modules to send
network queries (e.g: HTTP queries, SQL queries, etc.) and get responses?

On Mon, Aug 30, 2010 at 11:00 AM, Ramprasad Prasad
wrote:

>
>
> On Mon, Aug 30, 2010 at 3:04 PM, Jyoti  wrote:
>
>> Hello everyone,
>>
>> Can anyone please guide me with specific CPAN perl libraries/modules, to
>> send queries and get responses. I tried looking in CPAN,but I am still a
>> learner, so not able to get properly.
>> Can anyone reply me for the same please?
>>
>> Many Thanks.
>> Jyoti
>>
>
> Please be specific.
> Which perl module are you using.
>
>
> --
> Thanks
> Ram
>   <http://www.netcore.co.in/>
>
>
>
>
> n <http://pragatee.com>
>
>


Imp

2010-08-30 Thread Jyoti
Hello everyone,

Can anyone please guide me with specific CPAN perl libraries/modules, to
send queries and get responses. I tried looking in CPAN,but I am still a
learner, so not able to get properly.
Can anyone reply me for the same please?

Many Thanks.
Jyoti


error while installing win32::Registry module

2010-03-29 Thread Jyoti
Dear All,
 I was trying to run my script getip.pl . But when i run this script it
gives following error

C:\strawberry\perl\Test>perl GETIP.pl
Can't locate Win32/Registry.pm in @INC (@INC contains:
C:/strawberry/perl/lib C:
/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) at GETIP.pl line
1.
BEGIN failed--compilation aborted at GETIP.pl line 1.

To resolve this error I downloaded module Win32-DriveInfo-0.06  from
cpan.org  and used following steps to install but again shows the same
problem.


C:\strawberry\perl>cd Win32-DriveInfo-0.06

C:\strawberry\perl\Win32-DriveInfo-0.06>perl Makefile.pl
Writing Makefile for Win32::DriveInfo

C:\strawberry\perl\Win32-DriveInfo-0.06>dmake install
cp DriveInfo.pm blib\lib\Win32\DriveInfo.pm
Installing C:\strawberry\perl\site\lib\Win32\DriveInfo.pm
Appending installation info to C:\strawberry\perl\lib/perllocal.pod

C:\strawberry\perl\Win32-DriveInfo-0.06>dmake test
C:\strawberry\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl
1..11
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
Drive C: `dir' and module returned the same
Drive D: `dir' and module returned the same
Drive F: `dir' and module returned the same
Drive G: `dir' and module returned the same
ok 11


Re: module installation

2010-03-09 Thread Jyoti
Thanks for reply. I followed ur suggested steps but still getting same
error. I copied the error below.

C:\strawberry\perl\libwin32-0.29>perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for libwin32

C:\strawberry\perl\libwin32-0.29>nmake test

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

syntax error at -e line 1, next char )
Missing right curly or square bracket at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
'0xff'
Stop.

On Wed, Mar 10, 2010 at 10:57 AM, Sisyphus wrote:

>
> - Original Message - From: "Jyoti" 
> To: 
> Sent: Wednesday, March 10, 2010 3:46 PM
> Subject: module installation
>
>
>
>  i want to install libwin32-0.191 on my windows XP...
>>
>
> That's a fairly old version (July 2002). Is there a reason that you wish to
> install that particular version ?
> Source for the latest version (0.29) is available from CPAN:
>
> http://search.cpan.org/CPAN/authors/id/J/JD/JDB/libwin32-0.29.tar.gz
>
> In order to help you with any test failures we really need to see a
> copy'n'paste of the 'nmake' and 'nmake test' output.
> (Incidentally, you don't need to run 'nmake' and 'nmake test' separately -
> you can just run 'nmake test' straight after 'perl Makefile.PL'.)
>
> Cheers,
> Rob
>


module installation

2010-03-09 Thread Jyoti
i want to install libwin32-0.191 on my windows XP...
I downloaded it from CPAN ..
when I did perl Makefile.pl no any err ...
then nmake Makefile and then nmake test..
it showing fatal error...


Server Help

2009-11-04 Thread Jyoti
Heya,

I have a cgi script which works fine!!  It basically asks a user to enter
e-value and the user can enter then its accepted. But this script only works
in my linux terminal.
I want to allow users to same thing ( like enter text for same question ) on
my local server. If i run this same script on my server, its jus prints out
the question? n nothing user can do ??

How to allow users to enter some text or numbers or both for any question
asked by us using perl or cgi scripts???

Anyone can help me please?

Kind Regards,
Jyo


Fasta format !!

2009-10-29 Thread Jyoti
Hello All,

I just want help to open and read a file. I have to make a script so that it
should open and read a file which is in fasta format. I have done something
with subroutine but getting some errors. May be everyone do not know the
fasta format
Fasta format have peculiar feature: its starts with symbol " > " and
contains alpabets and numbers. So acc to that code have been given...

Can anyone please check the code n lemme know changes please!!!

Thanks...
#!/usr/bin/perl -w 
 
use strict;  
use CGI;  
use CGI::Carp qw ( fatalsToBrowser );  
use File::Basename;  
use Bio::SeqIO;


my $q = new CGI;  
my $filename = $q->param("file");
my $line;

&get_file_data($filename);

###

#subroutine to read fasta files.

sub get_file_data {

my @filename=();
my $line='';
my $j=0;
my($filename) = @_;

open(get_file_data, $filename);

foreach my $line (@_) {

chomp $line;
$line =~ s/[\s0-9]//g;

next;
  


# check blank line
if ($line =~ /^\s*$/) {
next;
  }

# check comment line
   else
{
 $line =~ /^\s*#/ ;
next;
  }
# check fasta header line
if($line =~ /^>/) { 
next; }
   
else {
print STDERR "Cannot open file \"$filename\n\n";
exit;
 }
 
close get_file_data;
}
return @_;

} 

# 


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


File Help

2009-10-21 Thread Jyoti
Heya,

Can anyone help me download my output results, please? I am actually doing
my (Blast program) search and getting the output result files in my
temporary folder, as I am told to do so.
Now, how can I save that output file or download the file from my temporary
folder.
I have to save as when we log off from system, the output file goes off as
its in temporary folder.

So, i need a code in *perl or cgi* so that it should open, save and download
file frm temporary folder to any of my new directories created in my home
folder.

Thanks

Kind Regards,
Jyoti


Database Help

2009-10-09 Thread Jyoti
Hello All,

I am able to connect to postgreSQL database via my server. I used PHP to
connect .. now i wanna know how to create databases via php and access
queries so that i get the results on my server.
I have to make php scripts. But where should I make .. in already existing
script where it connects to server. Or smhere else to access..

Please Help !!


Re: Server HELP-urgent

2009-10-06 Thread Jyoti
Thanks Ray,

Yepp, i think I need to be more specific. I am trying to design a web server
which can upload a user input file which contains number of protien
sequences. Then I need to blast this file to get blast results directly as
an output file.
But as m new to perl, I seriously dont have an idea how to proceed furthur.
I have to use perl and cgi...
Yepp basic URL in use to get results is *NCBI Blast.*

So layout is something like this :

BOX -> Upload File

BLAST> new button. On clicking this, I shud get the results, may be as
an output file.

Hope you can help me with some hints for code or smthing like that.

Thanks and Regards,
Jyo





On Wed, Oct 7, 2009 at 3:59 AM, Raymond Wan  wrote:

>
> Hi Jyoti,
>
>
> Jyoti wrote:
>
>> How to upload any file and get results for that uploaded file through a
>> redirected URL, in perl/cgi
>> I mean to ask, for example, I upload a file which contains protein
>> sequences. Now I want blast results for that uploaded file in my server.
>> Can anyone help me with few lines of Code, so that I can upload any file
>> with any number of sequences and get the results as well when I click on
>> Blast Results button.
>> Specific site from where I shud get results is : (
>> http://blast.ncbi.nlm.nih.gov/Blast.cgi). Can see the homepage!!!
>> Anyone can also explain me in general terms
>> Just help me to link a URL when I click a button OR directly get the
>> results
>> on my page ( as same as that URL).
>>
>
>
> I'm afraid you'll have to describe your problem a bit better.  You want to
> upload a file to NCBI (i.e., not your server), let it do some kind of
> processing, and then show its results in a web page?
>
> Most of what you're asking is related to NCBI and Blast and NCBI has
> provided an API to do things like this (I *think* -- I haven't used their
> API in a long time).  For example, go to here:
>
> http://www.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html
>
> And the first paragraph says,
>
> "Entrez Programming Utilities are tools that provide access to Entrez data
> outside of the regular web query interface and may be helpful for retrieving
> search results for future use in another environment."
>
> There's a lot of information there and you might want to go through it
> first.  I'm not sure if there are other API on their web site; you'll have
> to check.
>
> Once that's done, your results will be returned from their server and
> having it show up on your server (presuming you have it set up already)
> should be easy.
>
> And as Dave said yesterday, most people on this list aren't
> bioinformaticians so you should try to describe your problem in more general
> terms.
>
> Ray
>
>


Server HELP-urgent

2009-10-06 Thread Jyoti
Hello All,

How to upload any file and get results for that uploaded file through a
redirected URL, in perl/cgi
I mean to ask, for example, I upload a file which contains protein
sequences. Now I want blast results for that uploaded file in my server.
Can anyone help me with few lines of Code, so that I can upload any file
with any number of sequences and get the results as well when I click on
Blast Results button.
Specific site from where I shud get results is : (
http://blast.ncbi.nlm.nih.gov/Blast.cgi). Can see the homepage!!!
Anyone can also explain me in general terms
Just help me to link a URL when I click a button OR directly get the results
on my page ( as same as that URL).

Can anyone please help me with some few lines of code with perl or CGI

This will be really very useful.
Thanks in Advance.

Kind Regards,
Jyoti


BLAST HELP

2009-10-06 Thread Jyoti
Thanks for your help Dave.

Yes that was Javascript.. Just as m a beginner, I thot we can convert
javascipts to cgi scripts.!!! Am I wrong?

n for Blast, I have downloaded the latest netblast. Can you help me furthur.
There are instructions for searching protein sequences. But I should make a
script so that user can input their file of sequences and then click on
Blast. Then it should produce the Blast results ...

Kind Regards,
Jyo


BLAST HELP

2009-10-05 Thread Jyoti
Hello,

Can anyone help me to know how to make a script which can take any sequences
by user as user input and give blast results as user output. This should
work in a server.
Any sequences can be any protein sequences in Fasta format. And Blast is a
NCBI Blast main page which will be used and user should get the same results
when he runs my server.
Any Bioinformatician can understand my problem. Else if anyone can just give
me idea on how to give user input and get specific results accordingly..
Will be very helpful.

Thanks in Advance.

Kind Regards,
Jyo


Error HELP PLZ !!!

2009-10-05 Thread Jyoti
Hello All,

Can anyone please help with one small error I am getting for line 16( The
one which is bold n italic below.)
The error is : Can't call method "str" on an undefined value at firstpage.pl
line 16.


#!/usr/bin/perl
# standard settings plus call for CGI package
#use strict;
#use warnings;
use CGI;
use Bio::Seq;
use Bio::SeqIO;
use Bio::AlignIO;

#subroutine

&validate;

sub validate()
{
   * $q->str=document.form1.login.value; *
if(str.length > 6)
{
$q->number=str.indexOf("@");
if(number!=-1)
{
$q->number=str.indexOf(".");
if(number==-1)
{
$q->document.form1.login.focus();
alert("Please Enter a valid email id");
return false;
}
}
else
{
$q->document.form1.login.focus();
alert("Please Enter a valid email id");
return false;
}

}
else
{
$q->document.form1.login.focus();
alert("Please Enter a valid email id");
return false;
}
}

my $q = new CGI;
# generate HTML form using CGI methods
# define type of text
print $q->header("text/html"),
# make page title
$q->start_html(-title=>"Myserver",-BGCOLOR=>"skyblue"),
$q->h1("WEB"),

# produce a headline
$q->h2("Enter your list of sequences"),
# start form for user input.
$q->start_form(
-form => ("/tmp/start_annotator.pdf"),
-method => "post",
-action => "http://localhost/cgi-bin/firstpage.pl";),

# define the method of input plus default value
$q->textfield(
-name => "web",
-input => 'submit',
-value => " "),

$q->submit(-name => "START ANNOTATOR"),

$q->end_form,

$q->start_form(
-form => "form2",
-action => "second_new.pl"
-method => "post"),

$q->textfield(
-name => "Upload",
-input => "button",
-onClick => "return validate()"),

#close form
$q->end_form,
# close HTML page
$q->end_html;


Re: HI

2009-09-29 Thread Jyoti
Thanks Jeff

On Wed, Sep 30, 2009 at 4:40 AM, Jeff Peng  wrote:

> 2009/9/30 Jyoti :
> > Thanks for reply Rajiv. Will go through.Also can you explain me what this
> > error means:
> > Odd number of elements in anonymous hash at
> > /usr/lib/cgi-bin/websubroutine.pl line 18.
>
> That may mean, you passed wrong arguments to the method in a class.
> The method expects a hash, should have even number of elements.
>
>
> >
> > line 18 is as follows:
> >
> > print $q->header("text/html"),
> >
>
> Maybe you got wrong in other location.
> This statement has no problem for me:
>
> # perl -MCGI -e '$q=CGI->new;print $q->header("text/html")'
> Content-Type: text/html; charset=ISO-8859-1
>
>
> Jeff.
>


Fwd: HI

2009-09-29 Thread Jyoti
Thanks for reply Rajiv. Will go through.Also can you explain me what this
error means:
Odd number of elements in anonymous hash at
/usr/lib/cgi-bin/websubroutine.pl line 18.

line 18 is as follows:

print $q->header("text/html"),


HI

2009-09-29 Thread Jyoti
Hello,

Can anyone help me to explain how to call subroutines.
Also if possible, explain with example for running blast searches.

Many Thanks.


Re: Help Please

2009-09-10 Thread Jyoti
Thanks All...

Going through documentation as well as short explanation was useful.. I got
it [?]

Cheers!!!
<<330.png>>

Help Please

2009-09-10 Thread Jyoti
Can someone explain me what these symbols mean in regular expression:

my $trim = sub {local($_)=shift;
 $$_ =~ s/^\s*//;
 $$_ =~ s/\s*$//;};

Thanks.