You can simplify that a bit. Regexes operate on $_ by default, and when you assign the results to @_, it will overwrite anything that is there, so there is no need to initialise it. You can also combine the statements into 1
Updated code with corrections by animator
perl -ne '@_=/(\w{3,})/g and print"$.:@_$/"' test.jpg
That said, linenumbers don't make much sense in a binary file, and if you supply multiple files or a wildcard, the linenumbers will not reset to 1 for each new file.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|