Dear all I apologize if I am going to ask a question that may be easy

I'm trying to read a list of file in a specific directory that are all done in this way: word-number.box When the script find the file it should go elsewhere launching a different program on each individual file found with this structure. My main issue is how to put in the variable $filename text and scalar together.

$filename=print($a,$x,$c) ;

This command is printing in the proper way but is not setting them in the $filename $a and $c are texts while $x is a number.

Here is the code:
#!/usr/bin/perl -w $job="eman-ctf.b"; for ($x=3 ; $x <=4 ; $x++){ $a='/sData/users/Musa/Necen/process/EspB-trunc/espbtrunc-imagi +c-ctf/3-img-no-ctf/box/et3f-' ; $c='.box'; $d=print($a,$x,$c) ; $filename = $d; print $d ; if (-e $filename) { print "File Exists!"; @_=($job,$x); system(@_) == 0 or warn "system @_ failed "; } }
Thank you in advance Max

In reply to printing in a variable scalar and text togheter by Anonymous Monk

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.