in reply to Re: regex/perl question about uninitialized value
in thread regex/perl question about uninitialized value
This is an interesting hipothetic situation:
#!/usr/bin/perl -w use strict; open <ID>, '<', 'textfile.txt'; # a lot of lines later... my $mystring = "ABC<ID>blahblah</ID>DEF"; if ( $mystring =~ /<ID>(.*?)<\/ID>/) { my $ID = $1; print "$ID\n"; # OOOPS.... }
The moral of the history is... always check the ""
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: regex/perl question about uninitialized value
by JavaFan (Canon) on Nov 03, 2011 at 21:46 UTC | |
by pvaldes (Chaplain) on Nov 03, 2011 at 22:41 UTC |