in reply to meaning of if ($file !~ /\.tar(\.gz)?$/)

Matches all $file except .tar and .tar.gz endings.

if ( $file !~ # scalar $file tested for not matching /\.tar # an ending of .tar (\.gz)? # followed by an optional .gz $ # at the end of the name /x)

Replies are listed 'Best First'.
Re^2: meaning of if ($file !~ /\.tar(\.gz)?$/)
by filipebean (Novice) on Apr 08, 2013 at 16:17 UTC

    Hi,

    thank you, your answer is clear.

    it was the optional part that confused me :(

    best regards.