On Jan 25, 11:45 am, "john.swilting" <john.swilt...@wanadoo.fr> wrote:
> I try to test a scalar which ends by a .gif
You have to define what you mean by "test" a scalar.
> With any OS
>
> try
> if($data{attachement} = ~m/$`\.gif/){
If you'd enabled strict and warnings, Perl would tell you you'd done a
few things wrong here.
First, the operator is =~. Those two characters, right next to each
other. You can not put a space in betwene them. Second, the $`
variable is used *after* a successful pattern match, not within it.
Third, you are only testing if the scalar *contains* .gif, not if it
ends in .gif - you have to anchor the pattern.
if ($data{attachment} =~ m/\.gif$/) {
> It does not walk(work)
"work" is the correct English word here. "walk" makes no sense.
Paul Lalli
|