the correct code is yes w/out $$name rather using $name i always use strict and warnings. its there in the code at the top.
sub _ce { print "IN CE SUB\n"; die "no parameter!\n" unless @_; my ($ce_ref) = @_; for my $name (@{ $ce_ref }) { @asof = +(split("/", $name, 0))[-3,-2,-4]; $lpname = +(split("/", $name, 0))[3]; print $csv "$lpname\n"; print $csv '*' x length($lpname),"\n"; print '*' x length($lpname),"\n"; print "$name\n"; open (my $i, "+<", $name) or warn $!; ### FAILS HERE ### while (<$i>) { chomp $i; next if $i =~ /$regexp_2_skip/; next if $i !~ /$regexp_2_get/; ($i) =~ s/:/,/g; ($i) =~ s/\s+//g; print $csv "$i,\n"; print "$i,\n"; } } print $csv "\n\nHost,Entitled CPU and RAM as of @asof,\n\n"; return; } __OUT__ SCALAR NPLPARS 30 SCALAR lparstat: 30 IN CE SUB ******** /opt/r2configs/edidev00/2018/03/13/lparstat-i.out No such file or directory at get_nonprod_AIX_resrcs_used.plx line 454, + <$lus> line 131. readline() on closed filehandle $i at get_nonprod_AIX_resrcs_used.plx +line 455. ********** /opt/r2configs/ediperqa00/2018/03/13/lparstat-i.out # ls -l /opt/r2configs/ediperqa00/2018/03/13/lparstat-i.out -rw-r--r-- 1 root system 2219 Mar 13 21:00 /opt/r2confi +gs/ediperqa00/2018/03/13/lparstat-i.out

In reply to Re^2: opening a file passed into sub as ref by teamassociated
in thread opening a file passed into sub as ref by teamassociated

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.