In order to help you proceed, it would be very kind of you to provide the following:

1) What is that first command line parameter supposed to be? You can simply give me a string to use, or better, if you have time, also explain what it is supposed to be in a more conceptual manner.

2) Where in your script were you expecting to read in the lines from your two files and process them?

We can solve this problem, but to do so we must BOTH understand what is going on. YOU possess the knowledge of what is to be done. WE possess the knowledge of how you can get it done in Perl. But we haven't connected these two bits of knowledge yet, and we must do that in order to make useful progress.

OBSERVATIONS:

  1. In your opening note, you mention two input files. I don't see you opening any two files for input in the Perl script. If you want to read multiple lines from a file, you generally have to open it and read the lines in a loop. Sort of like this:
    #!/usr/bin/perl -w use strict; if (open INPFIL, "<file1.dat") { # File opened. Proceed. while (my $inpbuf = <INPFIL>) { # Next line from input file chomp $inpbuf; &processInputLine($inpbuf); } # Cleanup close INFPIL; } exit;
  2. In your script, you blindly absorb two parameters from the command line without explanation or recourse. I get it; you wrote the code, you know what needs to go on the command line. But you didn't pass that information along with the code, so I don't know what to put in there. I can see the second parameter needs to be a filename, and further deduce we will be writing something to that file. But there's no clue at all for an outsider to understand what is to be supplied with the first parameter. I like to give the user options:
    #!/usr/bin/perl -w use strict; # Grab command line parameters my ($seqcod, $outfnm) = @ARGV; # Avoid Perl warnings about undefined values if (!defined $seqcod) { $seqcod = ''; } if (!defined $outfnm) { $outfnm = ''; } # Ask user to supply missing parameters. Exit if user just presses En +ter. if ($seqcod =~ /^\s*$/) { print " Sequence Code: "; $seqcod = <STDIN>; } if ($seqcod =~ /^\s*$/) { exit; } if ($outfnm =~ /^\s*$/) { print "Output Filename: "; $outfnm = <STDIN>; } if ($outfnm =~ /^\s*$/) { exit; } # All parameters verified. Proceed. &doTheRealWork($seqcod, $outfnm); exit;

I await your reply that we may proceed.

edit: The script does open one file for read, but it does not open two.


In reply to Re^5: string value assignment by marinersk
in thread string value assignment by abidq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.