#!/usr/local/bin/perl -T
use strict;
use warnings;
my ( $id, $port, $description );
while(<>) {
chomp;
# Ignore comments.
next if /^#/;
# Do very rudimentary syntax checking on the ID and port fields
( $id, $port, $description ) =
m#^\s*(\w+-\w+)\s+(\w+/\d+/\d+)\s+(.*)$#;
# Here in my real program I do some database stuff.
print "ID: $id, Port: $port, Description: $description\n";
}
####
syntax error at ./vipatch.cgi line 237, near "( $id, $port, $description ) = m#^\s*(\w+-\"
####
There is no previous '(' to match a ')' on line 237
237: ( $id, $port, $description ) = m#^\s*(\w+-\w+)\s+(\w+/\d ...
^
There is no previous '(' to match a ')' on line 237
237: ... n ) = m#^\s*(\w+-\w+)\s+(\w+/\d+/\d+)\s+(.*)$#;
^
268: ( $id, $port, $description ) = m#^\s*(\w+-\w+)\s+(\w+/\d ...
^
found Scalar where operator expected
There is no previous '(' to match a ')' on line 268
268: ( $id, $port, $description ) = m#^\s*(\w+-\w+)\s+(\w+/\d ...
^
398: The logfile vipatch.cgi.LOG may contain useful information