Perl: the Markov chain saw | |
PerlMonks |
Re: remove 16 Zerosby ww (Archbishop) |
on Oct 13, 2015 at 12:20 UTC ( [id://1144688]=note: print w/replies, xml ) | Need Help?? |
Frankly, I find your question hard to understand... and not just because you failed to use proper markup -- i.e., code tags (<c> ... </c>) around data and code. Please see the markup instructions at the text entry box or read Writeup Formatting Tips). But addressing what I surmise you may think is a partial approach to your problem (including the possibility of a variable char count before your 16 zeros), the following should do the job:
Your "partial approach" " if ($line =~ /pvid\+(.*$)s{0000000000000000}{ $pvid = $1 }"
As a prophet once said, you can't just make stuff up and expect the computer to understand. Note also the "my $pvid which makes the variable global, and allows perl to pass its content back to the code outside the if clause. As others observed, best you read docs such as perldoc perlre and perldoc perlretut... available at your own console... and perhaps tutorials (Tutorials) here such as Getting Started with Perl. Updated: textual typos corrected and formatting changed for readability.
In Section
Seekers of Perl Wisdom
|
|