I have tried and failed, you guys have been great. Can you please assist in formatting my output which goes to a file (spaceavail). I am trying to format disk space output, well something similar anyway. TIA
Filesystem kbytes used avail capacity Mounted on /xxxdev/xxxx/xxxxx 2016343 1392038 563815 72% / /ppppp 0 0 0 0% /proc mnrop 0 0 0 0% /etc/mnrop hd 0 0 0 0% /xxxdev/hd ssss 3888816 40 3888776 1% /var/run ssss 3888848 72 3888776 1% /tmp /xxxdev/xxx/xxxxxxxx 32442879 523718 31594733 2% /export/ho +me
format DISKSPACE = ====================== |@<<<<<<<<<<<<<<<<<<<| $Filesystem |@<<<<<<<<<<<<<<<<<<<| $kbytes |@<<<<<<<<<<<<<<<<<<<| $used |@<<<<<<<<<<<<<<<<<<<| $avail |@<<<<<<<<<<<<<<<<<<<| $capacity |@<<<<<<<<<<<<<<<<<<<| $Mounted_On ====================== . sub df_total { open my $dfout, "df -k|" or die "couldn't start df -k: $!"; open (DISKSPACE, "> spaceavail") || die "Error opening file spaceavail +"; while (<$dfout>) { #chomp; ($Filesystem, $kbytes, $used, $avail, $capacity, $Mounted_On) = split +(//); write (DISKSPACE); } } print "\n My First Perl Menu\n"; print "A. Current Date & Time\n"; print "B. Users currently logged in\n"; print "C. Name of working directory\n"; print "D. Contents of the working directory\n"; print "E. Names & Login names of user currently logged on to aries\n" +; print "F. Aries Disk Space Utilization\n"; print "Enter A, B, C, D, E, F: \n"; $answer = <STDIN>; chomp ($answer); if ($answer eq "A") { system "date \n"; } elsif ($answer eq "B") { system "who \n"; } elsif ($answer eq "C") { system "pwd \n"; } elsif ($answer eq "D") { system "ls -Fla \n"; } elsif ($answer eq "E") { system "finger \n"; } elsif ($answer eq "F") { system "df -k \n"; &df_total } else { print "The selection you entered: $answer, is incorrect. Please ent +er A, B, C , D, E or F \n"; }

In reply to Formatting Text Output by TekWannaBe

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.