]> git.proxmox.com Git - pve-installer.git/commitdiff
use qr// for regex variable
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 22 Apr 2024 07:45:40 +0000 (09:45 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 23 Apr 2024 08:02:39 +0000 (10:02 +0200)
and don't wrap it within `m//` when using it...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Proxmox/Sys/Udev.pm

index 3213fd4371703918ce6706176f2a910863362ffe..89ada32cf1e242254c1d22e8c48bf7aefe7ae864 100644 (file)
@@ -3,7 +3,7 @@ package Proxmox::Sys::Udev;
 use strict;
 use warnings;
 
-my $UDEV_REGEX = '^E: ([^=]*)=(.*)$';
+my $UDEV_REGEX = qr/^E: ([^=]+)=(.*)$/;
 
 sub query_udevadm_info {
     my ($sys_path) = @_;
@@ -19,7 +19,7 @@ sub parse_udevadm_info {
 
     my $details = {};
     for my $line (split('\n', $udev_raw)) {
-       if ($line =~ m/$UDEV_REGEX/) {
+       if ($line =~ $UDEV_REGEX) {
            $details->{$1} = $2;
        }
     }