Hi Everyone,

I have the below program which was written for MAC OS 1997. And now I would like to use this program to run this in windows vista in the active perl.

Could anyone helpe me to make the below program work for VISTA? Any help is highly appreciated. Thanks

print STDERR "Split up datafile - JATD - 23/9/97\n"; print STDERR "This splits a long luminometer run into separate files, +one for each tube.\n"; print STDERR "Data for each tube should be preceeded by \'no 03\' etc. +\n"; print STDERR "Just drag your datafiles in turn onto the program icon,\ +n"; print STDERR "in the order in which they are to be processed.\n"; print STDERR "The program automatically appends data to existing files +,\n"; print STDERR "or creates new ones as needed.\n"; print STDERR "Files are placed in the same folder as the input files.\ +n\n"; $numargs=@ARGV; $state=0; $n=0; print STDERR "ARGV contained $numargs arguments.\n"; for ($m=0; $m<$numargs; $m++) { open (INFILE, $ARGV[$m]) || die "Couldn't open infile\n"; print STDERR "Opened file: $ARGV[$m]\n"; # establish path of infile @path=split(/:/,$ARGV[$m]); $pathlength=@path; $num= $path[$pathlength-1]; $path[$pathlength-1]=""; $root=join(":",@path); while (!(eof(INFILE))) { # get next record $n++; $i=<INFILE>; # does it contain text? if ($i =~ /[A-HJ-Za-z]/) { @array=split(/ /,$i); $arraylength=@array; $num= $array[$arraylength-1]; $array[$arraylength-1]=""; # close any existing file close (OUTFILE); if ($recnum) {print STDERR " - $recnum lines written.\n"; } # work out full pathname of the desired file $filename=join(" ",@array); $filename=~ s/[ ]+/ /g; if ($filename =~ /(no [0-9]+)/) { $filename = $1; } $file=$root; $file.= $filename; if (-e $file) { print STDERR "Adding to existing outfile: $file"; } else { print STDERR "Opening new outfile: $file"; } open (OUTFILE, ">>$file") || die "Couldn't open outfile\n"; $recnum=1; $i=$num; } $i =~ s/[ ]+/ /g; $recnum++; print OUTFILE $i; } # now at the end of the input # close any existing file close (OUTFILE); if ($recnum) {print STDERR " - $recnum lines written.\n"; } print STDERR "\nInput file contained $n records.\n"; } print STDERR "All finished.\n";

20100222 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips


In reply to How How to make mac written perl program to work in VISTA by Bestrophin

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.