develooper Front page | perl.beginners | Postings from August 2022

Re: What is the mean of the following syntax?

Thread Previous
From:
Olivier
Date:
August 3, 2022 07:00
Subject:
Re: What is the mean of the following syntax?
Message ID:
wu7v8r9g6c3.fsf@banyan.cs.ait.ac.th
William Torrez Corea <willitc9888@gmail.com> writes:

> Mean: !~ /\*/

!~ is "not matching the following regular expression"
/\*/ is a regular expression matching a star (*).

So the condition is true if $extension contains no star.

Regular expressions is the heart of Perl, you may want to read a bit
about it :)

Best regards,

Olivier

> I have the following code:
>
> if ($extension !~ /\*/) {
> $backup = $ARGV . $extension;
> }

-- 

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About