Hello Monks - I am working on a script and I am stuck. I have scoured the web but I must be asking the wrong questions. I have this sub that takes information from another piece of perl code. it looks like this:
$ejected_tapes=0 ; my @tapes_to_eject=@_ ; # Going to add the file checks and date stuff in perl – ongoing # We are going to have to generate a unique file # Todo: make better use of array itteration $stamp=`/bin/date +%Y%m%d%H%M%S`; `/bin/touch /u01/scripts/logs/$stamp.tapes`; $file="/u01/scripts/logs/$stamp.tapes"; # Now lets open a unique file and not worry about deleting each time open (MYFILE, '>>$file'); print MYFILE "$\@_[0]:$\@_[1]:$\@_[2]:$\@_[3]:$\@_[4]:$\@_[5]:$\@_[6]: +$\@_[7]:$\@_[8]:$\@_[9]:$\@_[10]:$\@_[11]:$\@_[12]:$\@_[13]:$\@_[14]" +; close (MYFILE); $media_list=`/bin/cat /u01/scripts/logs/$file`; If ( $ejected_tapes == $maxslots ) { print "The export door in robot $robot_num only holds $maxslot +s tape(s), \n"; print "and BLAM has now ejected that many tapes. Please go and + empty the\n"; print "import/export doors and press <RETURN> when you're fini +shed"; $ready=<STDIN>; $ejected_tapes=0; } `/usr/openv/volmgr/bin/vmchange -res -multi_eject -w -verbose +-rn $robot_num -rt tld -rh $robot_host -ml $media_list` ; }
ultimatly the $media_list var should just be a list of number:number:number etc. I pass it this through a file right now that I have to manually zero out each time I run the script. I want to create a file or blat the number out of the array directly to the command. Can someone give me a hint on how to do either? Thanks.

In reply to Help With Perl and Files by mrbbq

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.