Jennifer Pan wrote:

> Hello all,
>
> I stdin a file name: xxx.txt
> and I would like to have a output file name called x.txt.yyy
>
> This is how I do it
>
> $FILENAME = <STDIN>;
> $output = "$FILENAME.y";
> print "$output";
>
> And the result is only
> .yyy
>
> How do I concatenate $FILENAME and .yyy?
>
> Thank you

I am not certain of your example but try this:

$FILENAME = <STDIN>;
chomp $FILENAME;
$output = "$FILENAME.yyy";
print "$output\n";

Steve

Reply via email to