Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2013
    Messaggi
    6

    Assegnare valori ad una variabile con PERL!

    Ciao a tutti ...

    eseguendo un esercizio mi sono bloccata a tale punto:

    "It assigns the length of the sequence to another variable"

    si riferisce ad una sequenza di Dna :-)
    Qualcuno di voi sa come aiutarmi e i comandi da effettuare?

    grazieee!!!

  2. #2

    Moderazione

    Posta così la domanda è estremamente vaga... fornisci il codice che hai scritto finora e il testo dell'esercizio, altrimenti risulta difficile aiutarti.
    Amaro C++, il gusto pieno dell'undefined behavior.

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2013
    Messaggi
    6
    Develop a Perl program that receives from the standard input one
    aminoacid sequence and prints the length of the sequence and the
    number of basic aminoacids contained in the sequence.
    -It prints a message “Please insert an aminoacid sequence : ”
    -It reads the aminoacid sequence from STDIN
    -It substitutes all the white spaces and the newline character of the
    sequence with the empty character.
    -It checks with a pattern matching the sequence. If the sequence
    contains characters different from the twenty aminoacids it gives an
    error message.
    -It assigns the length of the sequence to another variable.
    -It counts the number of K+H+R.
    -It prints the message “The typed sequence is”, followed by the length
    of the sequence, followed by “ aminoacids long” followed by a new
    line.
    -It prints the message “It contains ”, followed by the number of
    K+H+R, followed by “ basic aminoacids”, followed by new line”.
    ed ecco cosa ho eseguito fino ad ora:

    codice:
    #!/usr/bin/perl -w
    print "Please insert an aminoacid sequence : ";
    $sequence=<STDIN>;
    $sequence =~ s/\s//g;
    
    # if-elsif-else conditionals
    if($word eq 'J') {
    
    print "error\n";
    
    } elsif($word eq 'O') {
    
    print "error\n";
    
    } elsif ( $word eq 'U' ) {
    
    print "error\n";
    
    } elsif ($word eq 'X' ) {
    
    
    print "error\n";
    
    }
    
    exit;

  4. #4
    Utente di HTML.it
    Registrato dal
    Jan 2013
    Messaggi
    6

    Perl

    ciao a tutti ...
    al momento ho eseguito questi comandi con perl:
    codice:
    #!/usr/bin/perl -w
    print "Please insert an aminoacid sequence : ";
    $sequence=<STDIN>;
    $sequence =~ s/\s//g;
    
    # if-elsif-else conditionals
    if($word eq 'J') {
    
    print "error\n";
    
    } elsif($word eq 'O') {
    
    print "error\n";
    
    } elsif ( $word eq 'U' ) {
    
    print "error\n";
    
    } elsif ($word eq 'X' ) 
    
    
    print "error\n";
    
    }
    
    exit;
    ADESSO DEVO: It assigns the length of the sequence to another variable.

    il comando:
    codice:
     
    $sequence = lenght($sequence)
    è giusto???

    grazie!!!

  5. #5
    Utente di HTML.it
    Registrato dal
    Jan 2013
    Messaggi
    6
    risolto ....

  6. #6

    Moderazione

    Ho unito le due discussioni (dato che sostanzialmente erano sullo stesso tema) e aggiunto i tag [co­de] ... [/co­de], in modo da non perdere l'indentazione; in futuro ricordatene da te.
    Amaro C++, il gusto pieno dell'undefined behavior.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.