FAQ
I have a script with these three lines and it works

$line =~ s/^\s*//; # Remove leading spaces
next if ($line =~ /^#/); # Skip line if it starts with #
next if ($line =~ /^\s*$/); # Ship blank lines

I can replace lines 1 and 2 above with

next if($line =~ /\s+|#/);

However my attempts to replace all three lines

next if($line =~ /\s+|#.*$/);

gives a warning

Use of uninitialized value in concatenation (.) or string and produces return vale? of 1

for blank lines.

How can I avoid these warnings with the regexp




TIA



Owen

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedJun 26, '05 at 1:21a
activeJun 26, '05 at 4:51a
posts2
users2
websiteperl.org

2 users in discussion

John W. Krahn: 1 post Owen: 1 post

People

Translate

site design / logo © 2022 Grokbase