Categories
Perl

Perl LWP UserAgent Example: Get Picture Using LWP

Perl LWP UserAgent is an amazing tool for automating web queries. Here is the simple text to get HTTP or FTP data using the Perl LWP UserAgent:

Categories
Perl

Perl LWP UserAgent Example: Get a http or ftp data

Perl LWP UserAgent is an amazing tool for automating web queries. Here is the simple text to get HTTP or FTP data using the Perl LWP UserAgent:

Categories
Perl

Perl Shorthand If Clause

Perl has a ton of short hand features. One that a lot of non-beginners use, and that I forget frequently, is the perl short hand if clause. This tutorial will show you how to use the shorthand if clause in perl:

Categories
Perl

Perl Script Process a CSV File Line by Line

I use a program called jmemorize to assist with rote memorization. It’s pretty common to find a spreadsheet with a list of things you have to memorize, and jmemorize will allow to import CSV format if you add specific column headers.
The problem is wanting to format the questions and answers in a specific way, or add something on each line. Perl can process a file line by line and output it however you want. While the following Perl script probably won’t be used exactly like I used it – you can still benefit from processing files line by line. Here is how you open a file in Perl, process it line by line (instead of slurping the entire file inefficiently) and modify each line as you go: