karmas has asked for the wisdom of the Perl Monks concerning the following question:
and generating html. $1 (below) sometimes gets trailing spaces, so I thought to strip'em off:some text ()\xA1 file.txt
But I'm getting error: "Use of uninitialized value in concatenation (.) or string at F:\downloads\lib.pl line 23, <IN> line 4." If I comment (3) everything works fine (except trailing spaces of course). It looks that $2 is somehow invalidated in line 3. TIA(1)if ($line =~ /(.+)\s*\(\)\xA1\s*(.+\.txt)/) { (2) $file = $1; (3) $file =~ s/\s*$//; (4) print OUT "<a href=\"$2\">$file</a><br>\n" }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: RegExp help
by Fastolfe (Vicar) on Nov 01, 2001 at 20:39 UTC | |
Re: RegExp help
by japhy (Canon) on Nov 01, 2001 at 20:48 UTC | |
Re: RegExp help
by tfrayner (Curate) on Nov 01, 2001 at 20:50 UTC | |
(jeffa) Re: RegExp help
by jeffa (Bishop) on Nov 01, 2001 at 20:42 UTC | |
Re: RegExp help
by karmas (Sexton) on Nov 01, 2001 at 21:02 UTC |