Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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:Thank you in advance Max#!/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 "; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing in a variable scalar and text togheter
by choroba (Cardinal) on Jul 31, 2012 at 18:45 UTC | |
|
Re: printing in a variable scalar and text togheter
by Anonymous Monk on Jul 31, 2012 at 18:43 UTC |