I have a variable $location whose value is data,I want to match another variable $file with /$location/ making the later "/" optional,meaning match $file to /data/(later "/" is optional),how can I make the later "front slash(/)" optional?If it is present it should match,if it not present ignore
$location="data"; next if $file !~ /$location[/]
In reply to Making the later front slash "/" optional by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |