How do i resolve this error message Please! I need help

Discussion in 'Perl Misc' started by Adebiyi Marion, Mar 30, 2013.

  1. the error message is;
    Can't modify concatenation (.) or string in scalar assignment at theScript.pl line 67, near ");"

    theScript is as below;

    use strict;

    my $file = shift @ARGV;
    open(FILE, "$file") or die "Cannot open file: $!";

    while(<FILE>)
    {
    chomp;
    my $gene = $_;
    system("wget -O " . $gene . ".fasta
    \"http://www.uniprot.org/uniprot/?query=gene%3a" . $gene .
    "&format=fasta\"");

    open(FASTA, $gene . ".fasta") or die "Cannot open FASTA file
    $gene: $!";
    my $sequence;

    while(<FASTA>)
    {
    chomp;
    $sequence .= $_ unless /^>/;
    }
    close FASTA;

    system("wget -O " . $gene . ".out
    \"http://web.expasy.org/cgi-bin/blast/blast.pl?sequence=\"" . $sequence
    .. "\"&action=PlainText&protdb_section=HUMAN&showsc=3&showal=0\"");

    open(BLAST, $gene . ".out") or die "Cannot open BLAST file
    $gene: $!";
    my $idMapping;

    while(<BLAST>)
    {
    if (/^(sp|tr)\!([A-Z\d]+)/)
    {
    $idMapping .= $2 . " ";
    }
    }
    close BLAST;

    if ($idMapping)
    {
    open(OUT, ">$gene.up2ensembl") or die "Cannot open OUT
    for writing: $!";
    print OUT &getIdMappingResult($idMapping);
    }
    }
    close FILE;

    sub getIdMappingResult
    {
    my ($list) = (@_);

    my $base = 'http://www.uniprot.org';
    my $tool = 'mapping';

    my $params = {
    from => 'ACC',
    to => 'ENSEMBL_ID',
    format => 'tab',
    query => $list
    };

    my $contact = ''; # Please set your email address here to help
    us debug in case of problems.
    my $agent = LWP::UserAgent->new(agent => "libwww-perl $contact");
    push @{$agent->requests_redirectable}, 'POST';

    my $response = $agent->post("$base/$tool/", $params);

    while (my $wait = $response->header('Retry-After')) {
    print STDERR "Waiting ($wait) ; Query: $base/$tool/ ;
    Parameters: ...\n";
    sleep $wait;
    $response = $agent->get($response->base);
    }

    $response->is_success ?
    return $response->content :
    die 'Failed, got ' . $response->status_line . ' for ' .
    $response->request->uri . "\n";
    }


    My list can be attached asap if need be.

    Marion
     
    Adebiyi Marion, Mar 30, 2013
    #1
    1. Advertising

  2. Adebiyi Marion <> writes:
    > the error message is;
    > Can't modify concatenation (.) or string in scalar assignment at theScript.pl line 67, near ");"
    >
    > theScript is as below;


    Consider using a less bizarre way of distributing 'long sequences of
    somethings' over several lines of file ...

    [...]

    > my $contact = ''; # Please set your email address here to help
    > us debug in case of problems.


    .... the problem that you split this comment incorrectly, causing the perl
    compiler to try to compile

    us debug in case of problems.

    which - in turn - caused the initially quoted error message to be
    printed hadn't occured then ...
     
    Rainer Weikusat, Mar 31, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TJS
    Replies:
    2
    Views:
    471
    Steve C. Orr [MVP, MCSD]
    Jan 16, 2004
  2. KK
    Replies:
    4
    Views:
    332
    John Carson
    Dec 3, 2005
  3. Replies:
    1
    Views:
    10,253
  4. TJS

    how to resolve delegate error message

    TJS, Mar 31, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    165
    Brock Allen
    Mar 31, 2005
  5. willmann817
    Replies:
    5
    Views:
    495
Loading...

Share This Page