I'm trying to split text out that is contained between a set of brackets [].
I tried to place both variables inside the $split variable, but it would only recognize one of the brackets. I came up with this option, which works:
$line1 = 'before[within]after';
$split= ('\[');
$split2 = ('\]')...
I have scanned in a book of definitions with their explanations.
I'd like to use perl to read each line in the file, filter the line, and save the various elements to a database.
For example, there are 52 lines in one file, and here is one:
1AB \'a-'be\ n (1927) : the one of the four ABO...
Here is my code:
#!/usr/bin/perl
$x = 2;
if ($x = 11) {
print "$x equals 11!";
} else {
print "$x does not equal 11!";
}
Why does it return, '11 equals 11'?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.