Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I notice you're referencing a few undefined variables (@sample1 ...), if you add strict/warnings, they'll warn you about that and other things, and in the process cut your development time in half!

I'd like to help, but your problem description is too long and wordy for me :)

Please read How do I post a question effectively? and post short sample input, expected/wanted output, actual output, and explain how the actual output of your program doesn't match the expected/wanted output.

You might write something like this

#!/usr/bin/perl -- use strict; use warnings; use Data::Dumper; #~ use LIMS::MT_Plate; #~ use Microarray; use autodie; # dies if open/close... fail Main( @ARGV ); exit( 0 ); sub Main { if ( @_ == 3 ) { print BreakSomePlates(@_); } else { Demo(); print Usage(); } } ## end sub Main sub BreakSomePlates { my( $infile, $queryplate, $plateno, $query ) = @_; open my ($inFh), '<', $infile; while(my $line = <$inFh>){ chomp $line; WalkThe( $line ); } #~ return "The sample $query placed in $queryplate is the location + $sample_name of Master Plate\n"; } sub WalkThe { rand 666 } sub Demo { my ( $Input, $WantedOutput ) = DemoData(); my $Output = BreakSomePlates( $Input, qw' plate 1 b2 '); require Test::More; Test::More->import( qw' no_plan ' ); Test::More::is( $Output , $$WantedOutput, ' BreakSomePlates works +as designed ' ); } sub Usage { <<'__USAGE__'; NAME well_identifier.pl - extract well location ... USAGE well_identifier.pl well_identifier.pl infile platename platenumber query well_identifier.pl infile Plate1/Plate2 b2 ... ARGUMENTS - infile path to BAC's 384 tab delimited text file - Plate Number Plate1/Plate2,Plate3 or Plate4 - Query i.e. b2 __USAGE__ } sub DemoData { my $Input = <<'__One__'; something __One__ my $ExpectedOutput = <<'__Two__'; blah blah __Two__ return \$Input, \$ExpectedOutput ; } __END__ not ok 1 - BreakSomePlates works as designed # Failed test ' BreakSomePlates works as designed ' # at pm.921846.pl line 40. # got: '' # expected: 'blah blah # ' NAME well_identifier.pl - extract well location ... USAGE well_identifier.pl well_identifier.pl infile platename platenumber query well_identifier.pl infile Plate1/Plate2 b2 ... ARGUMENTS - infile path to BAC's 384 tab delimited text file - Plate Number Plate1/Plate2,Plate3 or Plate4 - Query i.e. b2 1..1 # Looks like you failed 1 test of 1.

In reply to Re: Urgent : Biological problem by Anonymous Monk
in thread Urgent help needed! regarding a Biological problem by Bharat_Bioinfo

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found